Driving directions with waypoints?

Sep 19, 2009 at 1:20 PM
Edited Sep 19, 2009 at 2:00 PM

Hi,

Is it possible to use waypoints with the driving directions method to display a journey from A to B with several locations between them?

Thanks

*EDIT* I just read someone elses post asking for something similar.  Am I correct in thinking that this control only accepts a query parameter eg "from: address1 to: address2"?  I'm pretty sure I'm correct and would welcome anyones advice/code on how to expand on this to accept a waypoint markers as part of the route and to then draw directions between start and end and including the waypoints.

Oct 14, 2009 at 2:45 PM

Hi,

If you check the sample site you will see it here:-

Query - Gets or sets the query of GoogleDirection. The query parameter is a string containing any valid directions query, e.g. "from: Seattle to: San Francisco" or "from: Toronto to: Ottawa to: New York".

Text highlighted in red, if your doing it from the code behind use a StringBuilder and then load it using the following:-

 GoogleMap1.Directions.Add(new GoogleDirection(finalroute, "route", locale));

Hope this helps

 

Oct 23, 2009 at 4:19 PM
Edited Oct 23, 2009 at 4:21 PM

And if i only had the the poins of a route;

Ex: A car passed by points (37.38047,-122.41945) and (37.77506,-122.06877). How do i create this route?

Oct 23, 2009 at 5:46 PM

the same way:-

from: 37.38047,-122.41945 to: 37.77506,-122.06877


so you have your start and end points and if you want to add another point do:-

from: 37.38047,-122.41945 to: 37.77506,-122.06877 to:12345,-12345

hope that helps

Oct 23, 2009 at 10:39 PM
Thanks Smile emoticon Thats brilliant. You've done a great job on wrapping the Google maps API's. I'm only a newbie but I can appreciate the amount of hard work and thought that has gone into writing these api's. Keep it up Smile emoticon

From: [email removed]
Sent: Friday, October 23, 2009 6:46 PM
To: [email removed]
Subject: Re: Driving directions with waypoints? [googlemap:69468]

From: webfort

the same way:-

from: 37.38047,-122.41945 to: 37.77506,-122.06877


so you have your start and end points and if you want to add another point do:-

from: 37.38047,-122.41945 to: 37.77506,-122.06877 to:12345,-12345

hope that helps

May 13, 2010 at 12:36 PM
webfort wrote:

Hi,

If you check the sample site you will see it here:-

Query - Gets or sets the query of GoogleDirection. The query parameter is a string containing any valid directions query, e.g. "from: Seattle to: San Francisco" or "from: Toronto to: Ottawa to: New York".

Text highlighted in red, if your doing it from the code behind use a StringBuilder and then load it using the following:-

 GoogleMap1.Directions.Add(new GoogleDirection(finalroute, "route", locale));

Hope this helps

 

About the Directions

There are other properties for DirectionsRequest, How can I add the follow properties:

avoidHighways, avoidTolls, travelMode.

Regards,

LEO