On Jun 4, 12:05 pm, zeddy <[email protected]> wrote: > Thanks Mike. I'm definitely going to have more than 25 waypoints on > the route. I'm aware of both the asynchronous nature of load/ > GetPolyline as well as the need to copy before re-using each instance. > > Another problem I have is that some of the trip is in Mexico and > GDirections doesn't work there, even if you plug in (lat,long) for the > waypoints. So there I need to digitize a set of points and create my > own GPolyline. So my data file needs to a mixture of polyline points > and waypoints for GDirections. I can manage that ok and have the code > recognize each type of point. > > Am I right in thinking that it's not unreasonable to take 200 > waypoints (for example) and split it up into 8 requests of 25 points > each? In fact I have tried that, and it seems ok, but I'm having > problems with the asynchronous part.
If this is a road trip that you took or are going to take and want to document the plan, you can capture the polylines from GDirections and display them on your map as regular polylines. This map shows a polyline following I5 in California that was captured from a GDirections call (with one waypoint): http://www.geocodezip.com/GenericMapBrowser.asp?filename=I5Polyline.xml If you want all the infoWindows and directions information from the GDirections call, that would be a little more work. -- Larry > How do I make 8 'load' requests > and have it wait for the 'load' listener to complete the task of > retrieving the polyline and adding it as an overlay? I could use > javascript timeout to simulate sleep, but it's really ugly and you > have to choose a specific time delay. I would like to delay until an > event occurs, e.g. until I have retrieved the polyline in the 'load' > listener function and added it to the map. Doing all of these loads > sequentially would play nicer with the Google service too, instead of > firing off a bunch of parallel requests. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
