3

I have to style some Rasters with SLD and get the legend from Geoserver to show it in my webapp.

By default, labels are placed right to the Color Ramp.

enter image description here

Is there any option, by using SLD or maybe any parameters I can pass to the request for the legend, so that I can place labels at some other position?

So far I tried with LEGEND_OPTIONS, but it seems there's no parameter that fits my needs.

.../geoserver/temper/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&LAYER=temper:DICIEMBRE2017&WIDTH=20&HEIGHT=5&transparent=true&LEGEND_OPTIONS=fontSize:12;fontStyle:bold;fontColor:0xFFFFFF;dpi:180;
  • you can try it using legend_options parameter in your request and pass values docs.geoserver.org/latest/en/user/services/wms/… – Fran Raga Jan 4 '18 at 13:48
  • Thanks for the reply @FranciscoRaga, I've already tried it with no luck. – Jose Hermosilla Rodrigo Jan 4 '18 at 16:13
  • Only for clarify,need a dinamic legend?you can put the labels on the left but i understand that need only one sld and change this position in each request,its okey? – Fran Raga Jan 4 '18 at 16:27
  • It would be better for me if I could do this with a request parameter, because I've so many SLDs, one for each raster source, and I have a lot. But if the only way is to change the SLD it's okay. – Jose Hermosilla Rodrigo Jan 4 '18 at 16:34
  • i'm not sure but i think that is not possible,check this options github.com/geoserver/geoserver/wiki/GSIP-146 – Fran Raga Jan 4 '18 at 18:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.