Web applications and mappoint

dantheman
01-16-2005, 03:59 PM
I currently have an application which keeps track and schedules sales staff visits to customers.

I need a way of calculating distances between 2 postcodes (uk) and to intergrate this into my application. Can this be done through mappoint? I don't want to use a subscription based product - can I just purchase the Mapoint 2004 European Edition to do this?

Thanks in advance :)

Wilfried
01-17-2005, 08:34 AM
Hi,

yes calculating distances, routedescription etc is programaticly easy to do with mappoint. There is however 1 restriction if you use web for it, that is if you want to display the maps itself over a HTTP server, then I think every user has to have a licence of mappoint.

Please someone correct me if I'm wrong about the licence?

harpanet
01-17-2005, 11:58 AM
If you want the straight line distance then you can create two Location objects, each representing one of your post codes, then you can do it like this (C#)

object iIndex = 1;
Location loc1 = (Location)map.FindPlaceResults("postcode 1").get_Item(ref iIndex);
Location loc2 = (Location)map.FindPlaceResults("postcode 2").get_Item(ref iIndex);

double dblDist = loc1.DistanceTo(loc2);


You can also use MapPoint's ability to calculate driving distance. The following code snippet (C#) shows this.

object iIndex = 1;
map.ActiveRoute.Waypoints.Add(map.FindPlaceResults ("postcode 1").get_Item(ref iIndex), "");
map.ActiveRoute.Waypoints.Add(map.FindPlaceResults ("postcode 2").get_Item(ref iIndex), "");
map.ActiveRoute.Calculate();
double dblDist = map.ActiveRoute.Distance

 
Web mp2kmag.com
mapforums.com