[Mapserver-users] annotating multiple inline features

Steve Lime steve.lime at dnr.state.mn.us
Fri Mar 21 11:24:10 EST 2003


Are you drawing the label cache further down in your code?

>>> Dylan Keon <keon at nacse.org> 03/20/03 06:22PM >>>
Hi,

I'd like to label multiple inline features with text from user input. 
 From the 3.7 PHP MapScript docs it sounds like the ShapeObj draw() 
method should do this ("The text string is used to annotate the
shape"). 
  I figured I could label each feature this way as long as each feature

was put in a separate shape.  The features are created just fine, but I

don't get any labels.  I'm using 3.7 from a week ago.

Is it related to this old bug?
http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=36 

If this method is no longer available, can someone recommend a way to 
label inline features in a similar manner?

Thanks,
Dylan


   $image = $map->draw();
   $layer = $map->getLayerByName('flightlines');

   for($i = 0; $i <= (count($beginlat) - 1); $i++) { 

     $shape = ms_newShapeObj(MS_SHAPE_LINE); 

     $line = ms_newLineObj(); 

     $line->addXY($beginlon[$i], $beginlat[$i]);
     $line->addXY($endlon[$i], $endlat[$i]);
     $shape->add($line); 

     $shape->draw($map, $layer, $image, 0, $label[$i]); 

     $line->free(); 

     $shape->free(); 

   }


LAYER
   NAME flightlines
   STATUS ON
   #DATA #not needed, dynamic layer
   TYPE LINE
   CLASS
     COLOR 255 0 0
     SYMBOL 'circle'
     SIZE 4
     LABEL
       TYPE TRUETYPE
       FONT ARIAL
       SIZE 14
       COLOR 0 0 0
     END
   END
END

_______________________________________________
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