A tight loop triggering "click" events is just as fast as a tight loop
performing the GDirection calls.
What you need to do is listen for the GDirection "load" event, and issue
the next GDirections call from there. In order to do that, you'll
probably need to have a global variable where you remember how far
through the points array you are.
GEvent.addListener(GDir1,"load",function() {
nextpoint += 1;
if (nextpoint < points.length - 1) {
GDir1.loadFromWaypoints([points[nextpoint], points[nextpoint+1]], {
getPolyline:true
});
}
});
--
Mike Williams
http://econym.org.uk/gmap
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---