On Dec 15, 6:20 pm, Ian Beyer <[email protected]> wrote:
>
> If I simply poll at a setInterval, it will add new markers to the map,
> but not remove old ones when they are no longer connected. I can clear
> the map, but that makes it flicker, and if anyone has clicked on a
> particular marker, they get kicked off.

This could get rather messy. If you were doing this manually, you
would go through your data file and for each entry you would find the
marker (or add one if it wasn't there) and correct its position; then
any left over at the end you remove.

So you could just automate that. Read in the datafile and for each
entry, go through the array of markers and update the matching marker
(or add one if you don't find a matching marker). You also need to add
an attribute which indicates you have updated it -- perhaps a number
for each update, or the time you started the update. Then at the end
of your data, go through the markers one last time and remove any
which don't have the update attribute set to the latest value.

Or: you might be able to construct an additional database query of
markers which *were* valid but no longer are, and simply remove those
in the same way that you update the others. That could be a new php
script, or a second dataset within the existing one.

[I haven't checked your map; I've simply answered a philosophical
question.]

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API V2" 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