Hi Raffaele, After doing some research, you are right and html legends do not belong to WMS but only to Mapserver CGI which I have never used myself. Reasoning:
1) From WMS 1.1.1 specification OGC 01-068r3, page 54: 7.5 GetLegendGraphic (SLD WMS only) The optional GetLegendGraphic operation applies only to a Styled Layer Descriptor WMS. See the SLD specification [3] for this operation. 2) From Styled Layer Descriptor Implementation Specification (v. 1.0.0), OGC 02-070, page 72: FORMAT: This gives the MIME type of the file format in which to return the legend graphic. Allowed values are the same as for the FORMAT= parameter of the WMS GetMap request. Same text is in SLD 1.1.0 specification. Because html is not a possible format for GetMap it is not possible to use is for GetLegendGraphic either. What remains is a small Mapserver bug with the wms_getlegendgraphic_formatlist metadata item because GetCapabilities may advertise different formats than those which are really supported. -Jukka Rahkonen- -----Alkuperäinen viesti----- Lähettäjä: [email protected] [mailto:[email protected]] Puolesta Raffaele Morelli Lähetetty: 4. elokuuta 2015 12:29 Vastaanottaja: [email protected] Aihe: Re: [mapserver-users] html legend not working On 04/08/15 at 08:34am, Rahkonen Jukka (MML) wrote: > Raffaele Morelli wrote: > > > > Reply to myself because I've found it's not a mapserver related issue but a > > geomoose one (no matter about LEGEND and TEMPLATE statements it always > > produces a png image) . > > I don't quite agree. If GeoMoose is always making the GetLegendGraphic > request by using image/png as a format then it is naturally getting a png > image back. But so far I have not discovered how to make Mapserver to support > html as one of the supported WMS GetLegendGraphic formats and what the WMS > client should then use as a format in &format= parameter so there is also a > Mapserver related aspect. I won't say that, doc is very clear about WMS request returning an image: [quote] GetLegendGraphic: returns a legend image (icon) for the requested layer, with label(s). More information on this request can be found in the GetLegendGraphic section later in this doc. GetLegendGraphic Request This request returns a legend image (icon) for the specified layer. The request will draw an icon and a label for all classes defined on the layer. If the requested layername is a GROUP-name, all included layers will be returned in the legend-icon. [/quote] GeoMoose is doing a WMS request so no error on Mapserver side (and after all) nor on the GeoMoose one. TEMPLATE statement works well (returning html legend) when doin a cgi request. /raffaele -- «My mama said to get things done You'd better not mess with Major Tom» _______________________________________________ mapserver-users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/mapserver-users _______________________________________________ mapserver-users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/mapserver-users
