[mapserver-users] RE: drawing acetate shapes with PHP/Mapscript
Puneet Kishor
pkishor at GeoAnalytics.com
Thu Apr 25 16:48:39 PDT 2002
sorry,
instead of
> $imgObj = $mapObj->draw(); // imgObj
I intended
> $imgObj = $mapObj->prepareImage(); // imgObj
any advice on this would be much appreciated.
Thanks.
Puneet.
> -----Original Message-----
> From: Puneet Kishor
> Sent: Thursday, April 25, 2002 5:01 PM
> To: mapserver-users at lists.gis.umn.edu
> Subject: drawing acetate shapes with PHP/Mapscript
>
>
> once a map is drawn, I'd like to add a triangle, a circle, or
> a square, or whatever... (but, let's take the example of a
> triangle for now) on top of everything.
>
> the way I understand it, I would have to --
>
> 1. have an "acetate" layer with 'STATUS off' in my map file like so...
>
> LAYER
> NAME "acetate"
> TYPE polygon
> STATUS off
> CLASS
> OUTLINECOLOR 255 0 0 # red outline
> COLOR 0 255 0 # green fill
> END
> END
>
> 2. and use Mapscript like so...
>
> $layerObj = $mapObj->getlayerbyname("acetate"); // new layerObj
> $classObj = $layerObj->getClass(0); // classObj
> $imgObj = $mapObj->draw(); // imgObj
> $shpObj = ms_newShapeObj(MS_SHAPE_LINE); // new shpObj
>
> $pointObj1 = ms_newPointObj(); // point1
> $pointObj1->setXY(300, 300);
>
> $pointObj2 = ms_newPointObj(); // point2
> $pointObj2->setXY(450, 600);
>
> $pointObj3 = ms_newPointObj(); // point3
> $pointObj3->setXY(600, 300);
>
> $pointObj4 = ms_newPointObj(); // point4
> $pointObj4->setXY(300, 300);
>
> $lineObj = ms_newLineObj(); // new line
> $lineObj->add($pointObj1);
> $lineObj->add($pointObj2);
> $lineObj->add($pointObj3);
> $lineObj->add($pointObj4);
> $shpObj->draw($mapObj, $layerObj, $imgObj, 0, "foo")
>
> $layerObj->set("status", 1); // turn on the layer
>
>
>
> ==============
>
>
> am I right or am I way off?
>
> Tia,
>
> pk/
>
More information about the MapServer-users
mailing list