Opened 8 years ago

Closed 8 years ago

#3923 closed enhancement (fixed)

cascading getLegendGraphic

Reported by: stetou Owned by: mapserverbugs
Priority: normal Milestone: 6.2 release
Component: WMS Client Version: 5.6
Severity: normal Keywords:
Cc: dmorissette

Description (last modified by dmorissette)

I have several external WMS layers in my mapfile, using

...
CONNECTION "xxxxxxx" 
CONNECTIONTYPE WMS 
...

I use geoext layertree and would like to show the legend of the external WMS layers in the tree. Currently I ask the provider for the CLASS definition of the layers and paste it in my mapfile. Is there already another way to get the legend of a remote WMS layer? If not, would it be a possible enhancement?

Change History (4)

comment:1 Changed 8 years ago by dmorissette

Cc: dmorissette added
Description: modified (diff)

I confirm that cascading of GetLegendGraphic? is not currently supported.

With respect to adding this, I'm not clear on what could be done and how much work would be involved... we'd have to find/take some time to look into our options.

comment:2 Changed 8 years ago by aboudreault

Fixed and committed in r12592.

A GetLegendGraphic? request will be cascaded if:

  • The request is enabled via the *_enable_request metadatas.
  • The layer do not contain any class with the name property. This is to keep the current GetLegendGraphic? behavior on a WMS layer. So, a layer with a similar class:
      CLASS
        NAME "near white"
        EXPRESSION ([red] > 200 AND [green] > 200 AND [blue] > 200)
        STYLE
          COLOR 0 255 0
        END
      END
    

won't be cascaded. The legend returned will use that class. Remove/comment the NAME "near white" line and it will be cascaded.

NOTE: If you know that the external WMS layer *do not* support GetLegendGraphic?, you'll have to disable manually the GetLegendGraphic? for your layer using the *_enable_request metadata. Otherwise... you will simply get the XML exception from the cascaded server.

comment:3 Changed 8 years ago by dmorissette

Milestone: 6.2 release

Docs update in SVN trunk r12628.

comment:4 Changed 8 years ago by dmorissette

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.