http://groups.google.com/group/Google-Maps-API/web/suggested-posting-guidelines
On Dec 14, 5:10 am, Figment <[email protected]> wrote: > Hi, I have code like this; > > GEvent.addListener(directions[i],"load", function() { > distances[i] = directions[i].getDistance().meters; > ...} > > where directions is an array of GDirection objects and distances is > just integers or whatever number getDistance() returns. > > Now, I need a way to to wait for all the handlers to finish. I tried > writing: > GEvent.addListener(directions[i],"load", function() { > distances[i] = directions[i].getDistance().meters; > finished[i] = true; > > ...} > and then use a busy waiting loop that constantly checks if all finished > [] elements are true, but the overhead seemed so bad that I never got > the results? (+internet explorer constantly asks if I want to stop the > script because its running). There's nothing wrong with the loop, so I > need another way. Any help? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
