Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The GetLegendGraphic request works well. I display the legend at a fixed position in my viewer using OpenLayers. But I would like to know if there is any way to add some custom text to the legend.

The legend that geoserver produces is like this:

But I need to produce a legend with a title:

Does anyone know if the GetLegendGraphic request in GeoServer, or the SLD style have a way to add this?

UPDATE (23/08/12)

For now I´ll use a litle trick to add a title by adding in my SLD another custom rule above all others that not match any other rules:


        <sld:CssParameter name="fill">[MATCH_BACKGROUND_COLOR]</sld:CssParameter>
share|improve this question

share|improve this answer

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – iant Aug 14 '12 at 10:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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