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

I want to create a color legend on mapserver. It is working but now I have to group several classes together like a heading with a group of color in it and so on. I have 10 such groups of classes.

I tried using the concept of classgroup and group in a class, but now it only returns the last classgroup with no label/heading.

I want an ordered hierarchy showing group and contained classes.

Please, it would be really helpful if somebody could help me as to how to display all the groups of classes.

share|improve this question

Since Mapserver also supports HTML legends, you could try that. It should be flexible enough to allow grouping and nesting as you require.

This is the link to the documentation:

In particular make sure you check example #3 which does something similar to what you require (albei less complex):

share|improve this answer

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.