with that and other hints in the blog it now works
for those who follow:
directions.load("from: "StartAddress" to: "EndAddress" ,
{getSteps:true});
GEvent.addListener(directions, "load" , function() { //
code to do assignment goes inside this block
document.getElementById
('distance').innerHTML=directions.getDistance().html
var dur=directions.getDuration().seconds; //or .html
map.openInfoWindow(map.getCenter(),
document.createTextNode("Hello from " +
map.getCenter() + " dur=" + dur + " sec" ));
} //end block
); //end GEventListener
On Mar 26, 11:46 am, "[email protected]" <[email protected]>
wrote:
> On Mar 26, 11:28 am, Bill <[email protected]> wrote:
>
> > Hi
> > I am trying to build an app for which i need the time for a route. I
> > can not seem to find the right way to get the info.
> > When I use the getNumRoutes() method of GDirections I get an
> > undefined value.
>
> > Here is a link toi the web page where I am getting the
> > errorhttp://www.optwise.com/protected/mapletTry1.htm
>
> GDirections is asynchronous. You can't use the results until it
> returns the data from the server.
>
> From Mike Williams' tutorial:
> Part 2 Asynchronous I/Ohttp://econym.org.uk/gmap/async.htm
>
> also look at his examples that use the GDirections object.
>
> -- 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
-~----------~----~----~----~------~----~------~--~---