Here is how I do it:
$point = ms_newPointObj();
$point->setXY(2119500,757263);
$line = ms_newLineObj();
$line->add($point);
$shape = ms_newShapeObj(MS_SHAPE_POINT);
$shape->add($line);
$shape->set('text', 'new point');
$newLayer->addFeature($shape);
_____
From: [email protected]
[mailto:[email protected]] On Behalf Of Helen Eskina
Sent: Wednesday, November 25, 2009 5:39 PM
To: [email protected]
Subject: [mapserver-users] Can not draw single point
Hello,
I try to draw single point on the map. My point is defined by lat/long
coordinates. The problem is that the point is always in the same place on
the map regardless of the lat/long defined.
Here is my code:
$map = ms_newMapObj($map_path."mymap.map");
$daLayer = ms_newLayerObj($map);
$daLayer->set("type", MS_LAYER_POINT);
$daLayer->set("status", MS_ON);
$class = ms_newClassObj($daLayer);
$style = ms_newStyleObj($class);
$style->color->setRGB(255,0,0);
$style->set("symbolname", "circle");
$style->set("size", 10);
$my_point = ms_newpointObj();
$my_point->setXY(42.19,-75.46);
$image=$map->draw();
$my_point->draw( $map, $ daLayer, $image, 0, "Temp Point" );
$image_url=$image->saveWebImage();
What is wrong with it? I will appreciate any help.
Thank you,
Helen
_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users