View Full Version : Work with multiple routes on same map.

11-21-2006, 11:00 PM
Is there a way to dim routes like

dim objroute(80) as Mappoint.Route

then set objroute(1) as active route
create a route
set objroute(0) as active route
set actriveroute.clear
map.activeroute = obroute(1) and bring the old route back.

I am alternately displaying several vehicles, each with their own route. When I go to a new vehicle, I clear the position dataset and build a new one. I want to pull the route information from memory rather than a saved map file becuase of how long it takes to load.

Does anyone have any ideas?

11-22-2006, 09:20 AM
Quick answer: No!

The ability to plot multiple routes is a common request, and shouldn't be too difficult for Microsoft to implement if they wanted to, in a future version...

(multi-route optimization is a harder task and is probably best left to the higher priced tools and add-ins such as TourSolver).

You could try drawing the routes as polylines. A number of us have tried this and it is difficult - the Location objects that MapPoint provides are not necessarily on the route! Instead, they are intended for a "best view" of a route segment or direction.


11-22-2006, 12:32 PM
Richard there was someone who had build something with multiple routes / tours. Cannot find the url. He posted url to his web there where some screenshots. Also he was planning to bring this as open software later.

At some point my memory tell me it was around a year ago, but all the rest is a black hole :(

11-22-2006, 02:04 PM
For the most part the routes contain just 1 point, which is the current destination for a particular vehicle.

I think that instead of storing the route I will store each destination locations in an array indexed by the vehicle record number.

I will copy the destination location after drawing the map. Then I will clear the dataset and the route.

When I switch to a new vehicle, I create new dataset and a new route.

When I switch back to vehicle(1) I will add the location "destloc(1)" to the current active route, set the anchor at the vehicles current location, and calculate. That process is faster than loading a map from disk, setting the new anchor and calculating. I will just add a line to drop the location "destloc(1) when I delete the route from the map of vehicle(1).