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

Eric Bridger eric at gomoos.org
Wed Aug 13 13:32:01 EDT 2003


Matt,
You might be right.  I haven't tried the $layer-addFeature(),
$layer->draw() approach with no point->draw()'s.  But it seems like it
should work.  

On Wed, 2003-08-13 at 20:44, Matt Doggett wrote:
> Your reply helps a lot. Thanks.
> 
> I'm still not clear about the difference between the Point->draw() and
> the LayerObj->draw().  In my code, I step through each of my points and
> add them to the LayerObj using LayerObj->addFeature($shape). Then, like
> you, I call Point->draw(MapObj,LayerObj,Img,...).  But what is the
> difference between calling Point->draw() for each point as it is added
> to the layer, or calling LayerObj->draw() after all the points have been
> added to the layer?  It seems to me that once all the points (or
> whatever other objects) are added to the layer, calling LayerObj->draw()
> would do the trick.
> 
> Matt
> 
> -----Original Message-----
> From: Eric Bridger [mailto:eric at gomoos.org] 
> Sent: Wednesday, August 13, 2003 9:27 AM
> To: mdoggett at coas.oregonstate.edu
> Cc: Mapserver List
> Subject: Re: [Mapserver-users] help with ???->draw() mapscript function
> 
> If you use MapObj->prepareImage() you should not use MapObj->draw(). You
> are responsible to do all the drawing using LayerObj->draw(), which
> draws on the image prepared and Point->draw() or Rect->draw() etc. which
> take both the prepared image and a layerObj.  After you've finished all
> your drawing you should call MapObj->drawLabelCache($img) to draw the
> labels.
> 
> Typically I loop thru each layerObj, turning it on and calling
> LayerObj->draw().  I make sure to skip any dynamic point layers.
> Then I get the point layer obj and call Point->draw() for each point:
> 
> $point->draw($map, $layerObj, $img, undef, $text);
> 
> Finally I call $MapObj->drawLabelCache($img);
> 
> HTH
> 
> Eric
> 
> 
> > 
> On Wed, 2003-08-13 at 19:17, Matt Doggett wrote:
> > Can anyone help me out with the mapscript "draw" function?
> > 
> >  From what I see we've got a PointObj->draw(),  LayerObj->draw(),
> > MapObj->draw(), RectObj-draw(), etc. etc.  So which one should I use?
> > I'm using mapscript to dynamically create a layer containing point
> > observations and I get different results depending on which object
> > function I use.
> > 
> > Matt
> > 
> > Matt Doggett
> > Spatial Climate Analysis Service
> > Oregon State University
> > 316 Strand Ag Hall
> > Corvallis, OR 97331
> > (541)737-9153
> > mdoggett at coas.oregonstate.edu
> >  
> > 
> > 
> > _______________________________________________
> > Mapserver-users mailing list
> > Mapserver-users at lists.gis.umn.edu
> > http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> > 
> 
> 
> 





More information about the mapserver-users mailing list