locked
Avoid Toll Routes not working in MapPoint 2013 RRS feed

  • Question

  • Trying to avoid toll routes is not working at all, here is my code, it's in C#.
    I set the preferred roads both before and after routing, and stil nothing.

    object item = 1;
    
    map.ActiveRoute.Clear();
    
    map.ActiveRoute.Waypoints.Add(map.FindResults(address).get_Item(
    ref item), "End");
    
    map.ActiveRoute.DriverProfile.set_PreferredRoads(
    GeoRoadType.geoRoadToll, 0.0);
    
    map.ActiveRoute.DriverProfile.set_PreferredRoads(
    GeoRoadType.geoRoadFerry, 0.0);
    
    SetForegroundWindow(maphandle);
    
    System.Threading.Thread.Sleep(250);
    SendKeys.SendWait("{F3}");
    
    map.ActiveRoute.DriverProfile.set_PreferredRoads(
    GeoRoadType.geoRoadToll, 0.0);
    
    map.ActiveRoute.DriverProfile.set_PreferredRoads(
    GeoRoadType.geoRoadFerry, 0.0);   
    
    

     
    Friday, July 13, 2012 3:49 PM

Answers

All replies