>--
>You received this message because you are subscribed to the Google Groups
>"Google Maps JavaScript API v3" group.
>To post to this group, send email to
>google-map...@googlegroups.com.
>To unsubscribe from this group, send email to
>google-maps-js-a...@googlegroups.com.
>For more options, visit this group at
>http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>
I have a similar need. I'd like to be able to open a map, add a load
of markers (the position of vehicles performing certain duties).
I have a mechanism to periodically get the lastest data and to update
the positions of the vehicles.
Based upon the example code that Pil provided, I think I can get that
bit all working.
I can handle a new vehicle (vehicles go on and off jobs, so as a
vehicle goes on job it appears on the map).
The part I can't seem to do is to deal with a vehicle that goes off job.
I think ...
var marker = new google.maps.Marker(...);
could be ...
var singleMarker = {
id: 'this_markers_id',
lastUpdated : Date.now(),
marker : new google.maps.Marker(...)
};
myMarkers.push(singleMarker);
Ideally, I'd like to use the ID as a key (like in an associative array).
So, maybe ...
myMarkers['this_markers_id'] = singleMarker;
Does this sound feasible?
--
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea
You can do this by defining a custom .toString method, like:
singleMarker.toString = function() {
return this.id;
};
Then you can write:
myMarkers[singleMarker] = singleMarker;
- Ben
Android brevity