<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0" 
    xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" 
                   <CssParameter name="fill">#CC3300</CssParameter>

This is my style file. I want to get legend graphic wit a query http://localhost:8080/geoserver/PGIS/wms?REQUEST=GetLegendGraphic

This is returning a circle but not include text: enter image description here

Bu it should be like this: enter image description here

If I add multiple rules, text label is appearing.

  • Try to give a title for the rule <FeatureTypeStyle> <Rule> <Title>your_title</Title>
    – user30184
    Dec 2, 2014 at 11:51

1 Answer 1


If you add LEGEND_OPTIONS parameter to your request and the value forceLabels:on then you can force GeoServer to draw the text for a single rule. Here is an example of a request:


  • This example doesn't print the label, currently. Not sure what's going on there!
    – Alex Leith
    Mar 15, 2016 at 22:07
  • That is because the title in the polygon SLD was removed in the demo server. If you change the STYLE parameter from polygon to point then you will see the label again.
    – taudorf
    Mar 16, 2016 at 8:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.