On Nov 4, 2:51 pm, Francesco <[EMAIL PROTECTED]> wrote: > Thanks! > I create my page:http://www.geocities.com/coachchecco/geocDirection.html > You can try with these addresses: "via piave 19, ponte san nicolò" and > "via dante 3, padova".
There's a more fundamental problem than moving the map to show both lines. geocoder.getLatLng() is asynchronous, so your code does ... geocoder.getLatLng(a...) and sets that process off. departureIndex is set when the latlng is returned, but in the meantime geocoder.getLatLng(b...) has been set off. Those two processes are independent, and the second one could finish before the first one does. That means that departureIndex will not be ready when it's needed -- which is what's happened to me. I never reach setting the map to show two lines, because the geocoding doesn't complete in the right order. You need to put geocoder.getLatLng(b...) INSIDE the callback function of the first getLatLng. That means that the first one will always have finished before the second one is done, and all the results will be available when they are needed. Andrew --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
