On Sep 23, 9:20 pm, WebProgrammer <[email protected]> wrote: > I want to get the distances between seven postcodes at a time. I just > put the > > "getDistance().meters on load " in a loop. But it just gives me only > the last distance repeatedly ie, > > say post code a,b,c,d,... distance between a & b, b& c, c& d,.... I > found the lat and long for each post code and put the pair(lat,lon > (a),lat,lon(b))... pair(lat,lon(b),lat,lon(c)) , .... in a for loop > and get the driv distance. But all the time I get is the same distance > between last two postcodes. > > Please help.
GDirections is asynchronous, each call replaces the last in the queue to the server. Don't do it the way you are doing it. If it is only 7 locations, you can put them all in one call, and get the distance of each of the pieces. See the documentation: http://code.google.com/apis/maps/documentation/reference.html#GDirections and Mike Williams tutorial: http://econym.org.uk/gmap/ for details. Follow the posting guidelines and post a link if you need additional help: http://groups.google.com/group/google-maps-api/web/suggested-posting-guidelines -- Larry --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
