Dynamic Legend with Labels

sylvain.perrinel sylvain.perrinel at AGRICULTURE.GOUV.FR
Wed Jun 29 02:18:03 PDT 2005


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



More information about the MapServer-users mailing list