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.


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):


Your Answer

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

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