Home | Products | Issue Tracker | FAQ | Download | |
Date: | 2013/07 |
---|---|
Author: | Thomas Bonfort |
Contact: | thomas.bonfort@gmail.com |
Status: | Adopted |
Version: | MapServer 6.4 |
The WMS GetLegendGraphic currently returns a legend image whose content matches the classes that are defined in the mapfile (which may also be overriden by an SLD), as specified by the WMS specification. This RFC proposes an extension to the GetLegendGraphic response by returning a legend that corresponds to the features that are actually present/rendered in the requested extent.
The use-case of this RFC is to be able to display a legend alongside a mapview, with the content of the legend that only matches features that are actually present in the mapview.
Let us suppose we have a legend for a road network, comprising three classes for motorways, major roads and minor roads. - When fully zoomed out, a GetLegendGraphic call will return an image
containing the 3 road legend icons, one for each class.
Support for content dependant legends will be supported for WMS GetLegendGraphic calls on POINT, LINE and POLYGON layers, when the client includes the (non-standard) BBOX, SRS/CRS and EXTENT parameters (i.e. like for a GetMap request) in the request URL. If these parameters are not present, the classical legend rendering will occur.
http://server/wms?SERVICE=WMS&VERSION=1.1.0 &REQUEST=GetLegendGraphic&SRS=EPSG:3978 &WIDTH=560&HEIGHT=350&LAYER=layer1&FORMAT=image/png &BBOX=2258982,-70747,2615354,495480