Hello,
sorry for my bad eanglish, i hope this will be readable.
I have a little problem with markers on google maps, and i really need
some advice.

I`m trying to show on map position of some cars, this positions can be
changed any
time, so markers have to move. So i have an iframe, that reloads every
30 seconds,
and call functions that remove markers from map, and add new with new
coords. But
this solution give a major problem. It seems that old markers stay in
browser memory,
and after some time memory that use browser start to grow.

So i decided, that it will be better to move markers that already are
displayed, but it`s
not a good way to declare every marker with new variable, like :
var marker1 = new GMarker ...
var marker2 = new GMarker ...
because markers could be a lot, and code will be too big.

Now, what i`m trying to do now, i want to add id for each marker, and
then use those
id`s to call some function that will change it position.

function addicon(x,y,id)
{
        var icon;
        var point = new GLatLng(x,y);
        var marker = new GMarker (point,icon);
        marker.setId = id;
        map.addOverlay(marker);
}

function changePos(x,y,id)
{
   var marker = document.getElementById(id);
   marker.setLatLng(x,y);
   return 0;
 }

i`ve tryied this functions, but "var marker = document.getElementById
(id);"  this string
return NULL. I`m not good in javascript programming, but i thought
such construction
will work ;( it dosent.

Can you advice me something ?
Thanks for reading so much words. Really hope that you can help me.
( Searching in
google.com haven`t helped me ;(  )

Alexander Romanuk

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to