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

Lars V. Nielsen (Hvenegaard) LVN at HVENEGAARD.DK
Tue Feb 14 10:30:37 EST 2006


Thanks Artur,

It works, and it was simple, but I just couldn't see it :-)

I had an additional problem, having trouble getting transparent pixmap
symbols to display transparently. I got that solved too, now my display
problem was fixed.

Appararently setting  $layer->set("transparency",MS_GD_ALPHA)  in MapScript
trashes the mapfile layer setting  TRANSPARENCY ALPHA, rendering the symbols
in the layer non-transparent. !??

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

----- Original Message ----- 
From: "Skalski Artur - askals" <Artur.Skalski at ACXIOM.COM>
To: <MAPSERVER-USERS at lists.umn.edu>
Sent: Tuesday, February 14, 2006 3:58 PM
Subject: Re: [UMN_MAPSERVER-USERS] PHP/MapScript: How to add a point as an
inline feature ?


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