On Sep 24, 12:04 am, hidayat <[EMAIL PROTECTED]> wrote:
> The Method I m using is given below
> function getDistanceBtTwoPoints(pnt1,pnt2)
>   {
>
>                 var di = new GDirections();
>                 var pointsArray = [pnt1,pnt2];
>                 di.loadFromWaypoints(pointsArray);
>                  var distance = di.getDistance().meters;
>                  return distance;
>
>     }
> please correct me if I m doing it wrong

You don't understand the asynchronous nature of the GDirections call:
Part 2 Asynchronous I/O
http://econym.org.uk/gmap/async.htm

You need to wait for the load event before using the getDistance()
method.

>
> thanks in advance
> .....
>
> On Sep 24, 11:59 am, hidayat <[EMAIL PROTECTED]> wrote:
>
> > Thanks for the quick reply,
> >  I m already doing that still the getDistance() returns null, and one
> > more thing... how will we query the GDirection.load(query) such that
> > we can pass Lantitude and longitude instead of Address...
>
> > thanks
>
> > On Sep 24, 11:49 am, "warden [Andrew Leach - Maps API Guru]"
>
> > <[EMAIL PROTECTED]> wrote:
> > > On Sep 24, 7:42 am, hidayat <[EMAIL PROTECTED]> wrote:
>
> > > > how will I find
> > > > the road distance from Point A to different marker without showing
> > > > lines b/w them....
>
> > > If you've found GDirections then you will have found the arguments
> > > which put the line and directions-text on the page. Both can be null.
> > > Note that if you don't display what is being returned, you should
> > > still use the copyright data returned and display that to show how the
> > > data is being found.
>
> > > 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