Dynamic Legend with Labels

Lionel Bargeot l.bargeot at EDUCAGRI.FR
Wed Jun 29 06:02:24 EDT 2005


Hi,

you can use a METADATA personal option to do this.
METADATA
    your_label true
END
Then you ca obtain your_label value.

Inconvenient is that you can't proceede dynamicaly. You have to specify
this for each layer.
Regards,

Lionel

sylvain.perrinel at AGRICULTURE.GOUV.FR le Mercredi, Juin 29, 2005 à 11:18 AM
 a écrit :


>Hello,
>I make a dynamic legend in PhpMapscript for mapserver interface. I can 
>turn on/off the layers of my mapfile with checkbox and I include legend 
>icons.
>I would like to do same thing with the labels of the layers. If a label 
>definition of a layer is described in the mapfile, I'd like a checkbox 
>to turn on/off the labels. But I don't know in phpMpascript how to know 
>if a label definition exist or not.
>
>I think about that to detect a label definition :
>
>  if ($Layer->label)
>	{
>	"label defintion exist !"
>}else{
>	"label definition doesn't exist
>}
>
>and to turn on/off the labels, I think about the "LABELMAXSCALE" and 
>"LABELMINSCALE" properties :
>off : LABELMAXSCALE=0 and LABELMINSCALE=0
>on : original LABELMAXSCALE and LABELMINSCALE.
>
>Anyone have any advice?  Does this make sense?
>
>Thanks.

>
>
>-- 
>Sylvain Perrinel
>Ministère de l'Agriculture et de la Pêche
>Toulouse
>France
>


Lionel Bargeot
Agrogeomatic    03.80.77.28.49      http://www.igcs-stb.org/
4 rue Champs-prevois, bat grand-champs, 21000 Dijon



More information about the mapserver-users mailing list