PHP/MapScript: How to add a point as an inline feature ?

Skalski Artur - askals Artur.Skalski at ACXIOM.COM
Tue Feb 14 06:58:26 PST 2006


lokk a this code:

				$spoint = ms_newPointObj();
    				$spoint->setXY(your x, your y);

				$sline = ms_newLineObj();
    				$sline->add($spoint);

				$sshape = ms_newShapeObj(MS_SHAPE_POINT);
    				$sshape->add($sline);

				$slayer = $gpoMap->getLayerByName("selpoint");
				$slayer->addFeature($sshape);

this works for me - adds dynamic point to a layer, layer is set in mapfile, like this:

LAYER
    NAME selpoint
    TYPE POINT
    STATUS DEFAULT
	PROJECTION
		"init=epsg:4326"	#lon/latwgs84
	END
   CLASS
       NAME "selpoint"
       STYLE
          SYMBOL 'C:\Inetpub\wwwroot\mapserver\framedefs\etc\tutaj_red.gif'
       END
   END 
END

is this what your looking for?

Artur Skalski



Hello list,

Using MapScript 4.5, and I've now re-read the class doc several times, but I
can't seem to find the appropriate way to add points to a layer as inline
features.

Adding features to a layer require shapeObj's. I can create a shape with
type MS_SHAPE_POINT, but can't set the coordinate values.

I can use the x and y to create a pointObj, but can't seem to find a way to
use a pointObj to create a shapeObj.

I probably missing something obvious here, but what ? Please help ....

Best regards / Med venlig hilsen
Lars V. Nielsen
--------------------------------------------------------
Hvenegaard A/S
Rugaardsvej 55, DK-5000 Odense C
Denmark
Tel. +45 6313 5050
http://www.hvenegaard.dk
***************************************************************************
The information contained in this communication is confidential, is
intended only for the use of the recipient named above, and may be legally
privileged.

If the reader of this message is not the intended recipient, you are
hereby notified that any dissemination, distribution or copying of this
communication is strictly prohibited.

If you have received this communication in error, please resend this
communication to the sender and delete the original message or any copy
of it from your computer system.

Thank You.
****************************************************************************



More information about the MapServer-users mailing list