[Geoserver-users] GetLegendGraphic leaves off the Title when you specify &Rule=XXX

Create a layer with an SLD with multiple rules (for different zoom levels, or different filters, say), with a <Title> and <Name> for each rule. now do a GetLegendGraphic request for that layer. you get a sexy-ass legend with an icon and title for each Rule. however, if you want to pick only one of those Rule's to represent the layer in your legend, when you add &Rule=RULE, it shows the icon for that rule but the Title goes away. eg:

http://64.119.128.70/geoserver/wms?VERSION=1.1.0&REQUEST=GetLegendGraphic&LAYER=massgis:GISDATA.COUNTIES_POLY&STYLE=GISDATA.COUNTIES_POLY::Default&WIDTH=16&HEIGHT=16&FORMAT=image/png

vs

http://64.119.128.70/geoserver/wms?VERSION=1.1.0&REQUEST=GetLegendGraphic&LAYER=massgis:GISDATA.COUNTIES_POLY&STYLE=GISDATA.COUNTIES_POLY::Default&WIDTH=16&HEIGHT=16&FORMAT=image/png&Rule=Barnstable

(note: I'm linking to the Mass GIS server, but I see the same behavior of my installation of GeoServer 1.5.1, which they are also using).

thanks,
Mike

Hi Mike,

We recently redid our GetLegendGraphic code and basically mimicked what
mapserver does. Described in this thread with an example:

http://mapserver.gis.umn.edu/data2/wilma/mapserver-users/0405/msg00194.html

If you append RULE=Unclassified for example you don't get the title.

-Justin

Michael Frumin wrote:

Create a layer with an SLD with multiple rules (for different zoom
levels, or different filters, say), with a <Title> and <Name> for each
rule. now do a GetLegendGraphic request for that layer. you get a
sexy-ass legend with an icon and title for each Rule. however, if you
want to pick only one of those Rule's to represent the layer in your
legend, when you add &Rule=RULE, it shows the icon for that rule but the
Title goes away. eg:

http://64.119.128.70/geoserver/wms?VERSION=1.1.0&REQUEST=GetLegendGraphic&LAYER=massgis:GISDATA.COUNTIES_POLY&STYLE=GISDATA.COUNTIES_POLY::Default&WIDTH=16&HEIGHT=16&FORMAT=image/png
<http://64.119.128.70/geoserver/wms?VERSION=1.1.0&REQUEST=GetLegendGraphic&LAYER=massgis:GISDATA.COUNTIES_POLY&STYLE=GISDATA.COUNTIES_POLY::Default&WIDTH=16&HEIGHT=16&FORMAT=image/png&gt;

vs

http://64.119.128.70/geoserver/wms?VERSION=1.1.0&REQUEST=GetLegendGraphic&LAYER=massgis:GISDATA.COUNTIES_POLY&STYLE=GISDATA.COUNTIES_POLY::Default&WIDTH=16&HEIGHT=16&FORMAT=image/png&Rule=Barnstable
<http://64.119.128.70/geoserver/wms?VERSION=1.1.0&REQUEST=GetLegendGraphic&LAYER=massgis:GISDATA.COUNTIES_POLY&STYLE=GISDATA.COUNTIES_POLY::Default&WIDTH=16&HEIGHT=16&FORMAT=image/png&Rule=Barnstable&gt;

(note: I'm linking to the Mass GIS server, but I see the same behavior
of my installation of GeoServer 1.5.1, which they are also using).

thanks,
Mike

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4007,4672c015106882458217002!

--
Justin Deoliveira
The Open Planning Project
jdeolive@anonymised.com