[Mapserver-users] How to add text to a legend

Eric Bridger eric at gomoos.org
Fri Jul 9 14:02:00 EDT 2004


On Fri, 2004-07-09 at 12:02, Attri, Abhishek wrote:
> Hi All,
> 
> I want to add name or text in front of my legend image. For example, if
> a layer has two classes which are highlighted according to a particular
> criterion, then I would like to show the legend for each class, and the
> criterion (text) along with it.
> 
> It should look like: - Legend image1 text 1(or label)
> 
>                              Legend image2 text2
> 
> I tried giving different names to classes, but that didn't help. I guess
> it has something to do with symbols. I am using PHP Map script, but any
> sort of explanation would be helpful.

The CLASS NAME is the text used for the legend text, so what you
describe doing should work.  In mapscript you must make sure to set the
status of each layer to MS_ON first.

Eric





More information about the mapserver-users mailing list