Multi point route  
Author Message
shax





PostPosted: Virtual Earth: Map Control Development, Multi point route Top

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

Hope someone knows

Cheers


Windows Live Developer Forums12  
 
 
XinuXano





PostPosted: Virtual Earth: Map Control Development, Multi point route Top

I'm also interested in this function. I want to draw multiple routes: A to B, B to C, C to D, etc.

Another question: Is possible to obtain the coordinates (Lat, Lon) of each step of a route A to B (Step 1, 2, 3...)


 
 
Stuart Robinson





PostPosted: Virtual Earth: Map Control Development, Multi point route Top

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.


 
 
Federico Raggi





PostPosted: Virtual Earth: Map Control Development, Multi point route Top

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)
}



 
 
SoulSolutions





PostPosted: Virtual Earth: Map Control Development, Multi point route Top

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.


 
 
SqlUser1711





PostPosted: Virtual Earth: Map Control Development, Multi point route Top

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


 
 
Dave Britton





PostPosted: Virtual Earth: Map Control Development, Multi point route Top

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

 
 
DGindy





PostPosted: Virtual Earth: Map Control Development, Multi point route Top

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
 
 
Dave Britton





PostPosted: Virtual Earth: Map Control Development, Multi point route Top

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

 
 
DGindy





PostPosted: Virtual Earth: Map Control Development, Multi point route Top

Every time i try to test is i get an "unauthorized" error.I'm using the sample code as a reference.
 
 
SoulSolutions





PostPosted: Virtual Earth: Map Control Development, Multi point route Top

The problem with that dave is the lines don't follow the streets. I guess Polylines are the only way to go until we can pass an array of points.
John.


 
 
Dave Britton





PostPosted: Virtual Earth: Map Control Development, Multi point route Top

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

 
 
SoulSolutions





PostPosted: Virtual Earth: Map Control Development, Multi point route Top

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.



 
 
Federico Raggi - MSFT





PostPosted: Virtual Earth: Map Control Development, Multi point route Top

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.



 
 
Federico Raggi - MSFT





PostPosted: Virtual Earth: Map Control Development, Multi point route Top

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.