On Apr 6, 7:35 pm, Jitadity Kumar <[email protected]> wrote:
>
> What is going on ?

GDirections is asynchronous. In this line
           gdir.loadFromWaypoints(myPoints);
you request some directions. That takes a bit of time to generate, but
immediately your code then does
           var theDistance = gdir.getDistance();
and at that point the directions haven't been returned and the
distance is null.

You need to add a listener to gdir, listening for "load", in order
that you can do things like get the distance when the directions are
loaded. See the documentation.
http://code.google.com/apis/maps/documentation/reference.html#GDirections.GDirections

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
-~----------~----~----~----~------~----~------~--~---

Reply via email to