[ka-Map-users] Dynamic points on the map, can you help please?

Daniel.Huber at ch2m.com Daniel.Huber at ch2m.com
Fri Oct 12 12:19:45 EDT 2007


 

> -----Original Message-----
> From: ka-map-users-bounces at lists.maptools.org 
> [mailto:ka-map-users-bounces at lists.maptools.org] On Behalf Of The Bun
> Sent: Friday, October 12, 2007 9:08 AM
> To: ka-map-users at lists.maptools.org
> Subject: [ka-Map-users] Dynamic points on the map, can you 
> help please?
> 
> 
> Hi 
> 
> I am trying to add points in my prototype dinamically, this 
> is more or less the code I have tested, with something like 
> 100 variations but always with the same result, the Point 
> doesn't come out on the image ($image), the projection of the 
> map and other layers is "latlong" and the extend is:
> EXTENT -180 -90 180 90. What I am doing wrong? I spent two 
> days but I cannot prove I can add a point dinamically, Please 
> can you help? I know .... I send this post on the MapServer 
> forum but the fact is I am using ka-map demo and I changed 
> the code in tile.php so I thought to post in this forum as 
> well, please can you help?
> 
>         // create a temp layer to hold our points
>         $point_layer = ms_newLayerObj($oMap);
>         $point_layer->set("name", "markers");
>         $point_layer->set("type", MS_LAYER_POINT);
>         $point_layer->set("status", MS_ON);
>         $point_layer->setProjection("proj=latlong",MS_TRUE);
>         $point_layer->set("transparency", MS_GD_ALPHA);
>         // create a class and style for this layer
>         $point_class = ms_newClassObj($point_layer);
>         $point_class->set("status", MS_ON);
> 
>         $symbolid = ms_newSymbolObj($oMap, "cpoint");
>         $oSymbol = $oMap->getsymbolobjectbyid($symbolid);
> 
>         $point_style = ms_newStyleObj($point_class);
>         $point_style->set("symbol", $oSymbol);
>         $point_style->set("symbolname", "cpoint");
>         $point_style->set("size", "20");
>         $point_style->color->setRGB( 250,50,0);
> 
>         $point->setXY(40, 40);
> 
>         // draw our image without the points
>         $image = $oMap->draw();
> 
>         // MS_SUCCESS or MS_FAILURE
>         $return = $point->draw($oMap, $point_layer, $image, 0, "");
> 
>         $image->saveImage($szMetaImg);
>         $image->free();


Have you looked at the Overlay API page?  

http://ka-map.ominiverdi.org/wiki/index.php/Adding_objects_to_map


Not the same methods you were attempting, but it does work.  

When I created an app that needed a dynamic feature layer, I had to
modify the config.php file to point to the new map file.


Dan



More information about the ka-Map-users mailing list