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

The Bun rosario.carbone at ipl.com
Fri Oct 12 17:12:10 EDT 2007

Daniel.Huber wrote:
>> -----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
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ka-map-users

Hi Daniel,

I thought to a client solution at the beginning of my testing but that mean
I need to get all the coordinates from the server and send HTTP request back
from the client, it seemed to be not too good to me so for that reason I
decided to test the possibility to create the image in tile.php included
with my temporary layer just before the imgage is cached the first time, as
my data are already available but may change for different sessions and then
a server solution I thought it was ideal.

But believe me, I tested at least 100 variations of the code below and I
couldn't see anything, noone of my point on the map, I guess maybe I need to
have something pre-set in the mapfile? I am surely missing something, I
don't know MapServer very well (that is the reason I am testing) but a
syntax like this:

$point->draw($oMap, $point_layer, $image, 0, "");

for the mushups seems suspicious to me.

I have passed last two days trying and trying, nothing, I for sure haven't
understood how the object model works as other people is able to do the same
thing I am trying to do. I thing at the end I have to work around as you
said, though I am not really happy of that as from kamap I only would like
rely for things like zooming and panning, but the code seems to be easy and
surely I'll have a go next Monday when I am back at work, if performances
are good then I'll be happy. 

Thank you very much.


View this message in context: http://www.nabble.com/Dynamic-points-on-the-map%2C-can-you-help-please--tf4614164.html#a13183138
Sent from the ka-map-users mailing list archive at Nabble.com.

More information about the ka-Map-users mailing list