[mapserver-users] Annotating inline features (PHP)

Chris Barber barberc at msu.edu
Wed Aug 22 08:48:06 PDT 2001


Howdy all,

I thought this was brought up recently but I can't find it in the list
archives, so...

Using PHP/Mapscript, I'm creating shape objects from query result data
and adding them to the map as inline features. And that works great. Now
I'm trying to annotate each feature with a unique text string generated
from the same query. It seemed as tho $ShapeObj->draw() would be able to
do this, but it won't seem to work. I'm guessing that there's something
I need in my map file to let this happen. Can anybody point me in the
right direction here please?? 

Mapfile excerpt:
LAYER
  NAME ETM
  TYPE POLYGON
  STATUS ON
  FEATURE
  END
  CLASS
    NAME "ETM+"
    OUTLINECOLOR 255 0 0
    LABEL
      SIZE 6
      FORCE TRUE 
      COLOR 0 0 0
      TYPE TRUETYPE
      FONT verdana-bold
      ANTIALIAS
      PARTIALS FALSE
    END
  END
END

PHP-ish excerpt:
for each result record
  $ShapeObj = ms_newShapeObj(MS_SHAPE_POLYGON);
  $LineObj  = ms_newLineObj();
  $LineObj->addXY($point1[1],$point1[0]);
     ... and so on for all points, ending w/ point1 to close ...
  $ShapeObj->add($LineObj);
  $ShapeObj->draw($mapObj,$layerObj,$imgObj,0,$featurename);

I get the features no problem, just no text.
MapServer/3.5, PHP/4.0.6

Thanks much,
Chris


-- 
__________________________________________________
Christopher P. Barber
Basic Science & Remote Sensing Initiative
Dept. of Geography, Michigan State Univ.
http://bsrsi.msu.edu

Rm. 210 Manly Miles Bldg.
1405 S. Harrison Road 
East Lansing, MI 48823-5243
517.432.1883  Phone
517.353.2932  FAX
barberc at msu.edu



More information about the MapServer-users mailing list