Hi, Simple question...is it possible to have a route with multiple stops on it. I don't want to just go from A to B, I want to go from A to B to C to D. Is there something I'm missing or is this a fundamental omission
I don't believe you can use the current findroute implementation to do this, however, using Polyline you can draw any "route" you like. I am storing my own routes in some XML and can ply almost anything I want using the lat/long coords and polylines
I asked the same question some time ago (Mid July 2006). apparently the VE devlopment team are considering this feature for a future release - until then, it is not possible.
I notice that Yahoo.beta now allows up to 24 route waypoints and of course this is support in the mappoint.webservice.
I asked Alex Daley (http://blogs.msdn.com/virtualearth/default.aspx) from the Virtual Earth team and he said there are no plans to include support for routes with more than two points on the Virtual Earth Mapping Control at this point.
I too am looking into this functionatily for our fleet. But I would like to make user this is a viable solution before investing time and money into it. Do i need an account to test it
Thanks for the sample code, but I would like to know whether is it possible to mark multiple routes for more then 2 pts or not and whether this is really will be part of a coming release or not..
I had to build my own "route builder" functionality that allows me to click on my own path, drawing the lines/route between each click. Then I save all the points in an XML file as my path. Hokey, but it works
To obtain the coordinates (Lat, Lon) of each step of a route you can use the Segment property array that is part of the Itinerary property of the VERoute object returned by the GetRoute call. You need to define a callback function to be called when GetRoute finishes drawing the route. GetRoute will pass a VERoute object to the callback function that you can use for obtaining the Itinerary and from it the Segment array containing the latitude and longitude for each segment.
Here is a sample implementation that display an alert box with the sequence of coordinates:
var map = null; function GetMap() {
map =
new VEMap('myMap'); map.LoadMap(); map.GetRoute("Space Needle", "Microsoft", VEDistanceUnit.Miles, VERouteType.Shortest, myCallBack); }
function myCallBack(route) { var segments = route.Itinerary.Segments; s = "Coordinates: "; for(var i in segments) s += "(" + segments[ i ].LatLong.Latitude + "," + segments[ i ].LatLong.Longitude + ")"; alert (s) }
Sounds like a good way to achieve what you need. The problem with a muilt point route is it could still take the wrong path for what you want. Your technique offers more flexibility if you have the time to draw it. John.
Yes this would be a very useful function. Similar to "SetMapView" it would be great to pass an array of points to include in the route. It appears you can't even fake this by showing more then one route at a time Has anyone done this John.
No accounts needed - this is all free. If you want to do any reverse geo-coding then you might need to look at the MapPoint web services which are NOT free ....
Multi point route
Bhupathi Venkatesh
Heinz Krug
I asked the same question some time ago (Mid July 2006). apparently the VE devlopment team are considering this feature for a future release - until then, it is not possible.
I notice that Yahoo.beta now allows up to 24 route waypoints and of course this is support in the mappoint.webservice.
ElSalsero
I asked Alex Daley (http://blogs.msdn.com/virtualearth/default.aspx) from the Virtual Earth team and he said there are no plans to include support for routes with more than two points on the Virtual Earth Mapping Control at this point.
Ridhi Dua
Another question: Is possible to obtain the coordinates (Lat, Lon) of each step of a route A to B (Step 1, 2, 3...)
ahmedmalam
John.
clkdiv
Rob Ainscough
John230873
Hi,
Thanks for the sample code, but I would like to know whether is it possible to mark multiple routes for more then 2 pts or not
and whether this is really will be part of a coming release or not..
_brg_
keith1000
To obtain the coordinates (Lat, Lon) of each step of a route you can use the Segment property array that is part of the Itinerary property of the VERoute object returned by the GetRoute call. You need to define a callback function to be called when GetRoute finishes drawing the route. GetRoute will pass a VERoute object to the callback function that you can use for obtaining the Itinerary and from it the Segment array containing the latitude and longitude for each segment.
Here is a sample implementation that display an alert box with the sequence of coordinates:
var map = null;function GetMap()
{
map =
new VEMap('myMap');map.LoadMap();
map.GetRoute("Space Needle", "Microsoft", VEDistanceUnit.Miles, VERouteType.Shortest, myCallBack);
}
function myCallBack(route)
{
var segments = route.Itinerary.Segments;
s = "Coordinates: ";
for(var i in segments)
s += "(" + segments[ i ].LatLong.Latitude + "," + segments[ i ].LatLong.Longitude + ")";
alert (s)
}
Wilfried Mestdagh
The problem with a muilt point route is it could still take the wrong path for what you want.
Your technique offers more flexibility if you have the time to draw it.
John.
Ro0ke
Similar to "SetMapView" it would be great to pass an array of points to include in the route.
It appears you can't even fake this by showing more then one route at a time Has anyone done this
John.
wei917
DGindy:
What sample code are you using to test I'll try to find you an anwer, but I'm not clear on what is the problem you are having.
Sharma