View Single Post

  #8 (permalink)  
Old 04-21-2008
andrea andrea is offline
Junior Member
Yellow Belt
 
Join Date: Mar 2008
Posts: 19
Re: Optimize performance

ok, i've installed mappoint and my application on a regular machine.
but it required about 1.30 minute for to get the point.
this is my code:


ApplicationClass wApplication = new ApplicationClass();
wApplication.Units = GeoUnits.geoKm;

Map wMap = wApplication.ActiveMap;
Route wRoute = wMap.ActiveRoute;


wMap.Parent.PaneState = GeoPaneState.geoPaneRoutePlanner;
object item = 1;



wRoute.Waypoints.Add( wMap.FindResults("Milano").get_Item(ref item) , "Milano");
wRoute.Waypoints.Add(wMap.FindResults("Mantova").g et_Item(ref item), "Mantova");
wRoute.Waypoints.Add(wMap.FindResults("Lecco").get _Item(ref item), "Lecco");
wRoute.Waypoints.Add( wMap.FindAddressResults("via centrale 8", "Abbadia Lariana", string.Empty,
"Lombardia", "23821", GeoCountry.geoCountryItaly).get_Item(ref item), "Casa Mia" );

wRoute.Waypoints.Add(wMap.FindAddressResults("via belfiore 41", "Lecco", string.Empty,
"Lombardia", "23900", GeoCountry.geoCountryItaly).get_Item(ref item), "Lecco");

wRoute.Waypoints.Add(wMap.FindResults("Piacenza"). get_Item(ref item), "Piacenza");



wRoute.DriverProfile.StartTime = System.DateTime.Now ;

// optimize
wRoute.Waypoints.Optimize();
wRoute.Calculate();
Reply With Quote