[Mapserver-users] annotating multiple inline features

Dylan Keon keon at nacse.org
Thu Mar 20 16:22:19 PST 2003


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




More information about the MapServer-users mailing list