[Mapserver-users] help with ???->draw() mapscript function

Matt Doggett mdoggett at coas.oregonstate.edu
Thu Aug 14 14:39:01 EDT 2003


Thanks. That helps a lot. Exactly what I needed.

matt


-----Original Message-----
From: Vinko Vrsalovic [mailto:vinko at cprsig.cl] 
Sent: Wednesday, August 13, 2003 5:51 PM
To: Matt Doggett
Cc: 'Eric Bridger'; 'Mapserver List'
Subject: Re: [Mapserver-users] help with ???->draw() mapscript function

On Wed, Aug 13, 2003 at 03:46:05PM -0700, Matt Doggett wrote:
> Well I just discovered a difference...
> 
>   If I use Point->draw() for each of the points individually, the
point
> Labels will appear in the final map.  But if I use Layer->draw()
(where
> the Layer contains the point shape objects)  the point labels do NOT
> appear.
 
You must set the text and classindex properties of the shapeObj for the
labels to appear as defined in the layer's classObj's (and styleObj's if
MS_VERSION >= 3.7). Example:

$shp = ms_newShapeObj(MS_SHAPE_LINE);
$shp->add($line); //$line is a valid LineObj
$shp->set('text',"MY LABEL");
$shp->set('classindex',0); // Important to choose the class this point
			   // will be rendered in. That's class 0 in
			   // $layer
$layer->addFeature($shp);
$layer->draw(); 

 
-- 
Vinko Vrsalovic <el[|- at -|]vinko.cl>
http://www.cprsig.cl




More information about the mapserver-users mailing list