Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 1.6.0-RC1
-
Fix Version/s: None
-
Component/s: WMS
-
Labels:None
-
Number of attachments :
Description
It would be nice to be able to grab a legend for a label that looks the same way the label is rendered.
If the SLD for a style contains ONLY a TextSymboloizer, respond to a GetLegendGraphic by creating a legend graphic that contains the word "Label", rendered in the font-family, font-style, and font-size, and font-color of the SLD.
For example, this request
has in it's SLD:
<Font>
<CssParameter name="font-family">Arial</CssParameter>
<CssParameter name="font-weight">bold</CssParameter>
<CssParameter name="font-size">12</CssParameter>
</Font>
<Fill>
<CssParameter name="fill">#000000</CssParameter>
</Fill>
So I would prefer a graphic with "Label" in Arial, bold, 12 point, black (see attached image label_1.png)
whereas this request:
has in it's SLD:
<Font>
<CssParameter name="font-family">Arial</CssParameter>
<CssParameter name="font-style">italic</CssParameter>
<CssParameter name="font-size">10</CssParameter>
</Font>
<Fill>
<CssParameter name="fill">#004DA8</CssParameter>
</Fill>
So I would prefer a graphic with "Label" in Arial, italic, 10 point, blue (hex = #004DA8) (see attached image label_2.png)
(Halo would be nice to include, but I use it rarely and sometimes it's white, so I put that as super low priority.)
I'd like to update the examples above with working ones:
An example of black Arial bold 12 pt:
<CssParameter name="font-family">Arial</CssParameter>
<CssParameter name="font-style">bold</CssParameter>
<CssParameter name="font-size">12</CssParameter>
<Fill>
<CssParameter name="fill">#000000</CssParameter>
</Fill>
http://170.63.166.213:8080/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=massgis:GISDATA.GEONAMES_PT_PLACES&styles=&bbox=232223,907783,236963,910658&width=537&height=330&srs=EPSG:26986&format=application/openlayers
Instead of what is currently produced for a legend graphic (version 2.0.3):
http://giswebservices.massgis.state.ma.us/geoserver/wms?VERSION=1.1.0&REQUEST=GetLegendGraphic&LAYER=massgis:GISDATA.GEONAMES_PT_PLACES&STYLE=&WIDTH=16&HEIGHT=16&FORMAT=image/png
It would be nice to have a label in the style of the text such as label_1.png above.
An example of brown Arial italic 10 pt:
<CssParameter name="font-family">Arial</CssParameter>
<CssParameter name="font-style">italic</CssParameter>
<CssParameter name="font-size">10</CssParameter>
<Fill>
<CssParameter name="fill">#732600</CssParameter>
</Fill>
http://170.63.166.213:8080/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=massgis:GISDATA.GEONAMES_PT_HYPSO&styles=&bbox=232223,907783,236963,910658&width=537&height=330&srs=EPSG:26986&format=application/openlayers
Instead of what is currently produced for a legend graphic (version 2.0.3):
http://giswebservices.massgis.state.ma.us/geoserver/wms?VERSION=1.1.0&REQUEST=GetLegendGraphic&LAYER=massgis:GISDATA.GEONAMES_PT_HYPSO&STYLE=&WIDTH=16&HEIGHT=16&FORMAT=image/png
It would be nice to have a label in the style of the text such as label_3.png.