none
Proper syntax for passing multiple route avoidances? RRS feed

  • Question

  • Is this the correct syntax for passing multiple route avoidances to the set Request Options method?

    directionsManager.setRequestOptions({ distanceUnit: Microsoft.Maps.Directions.DistanceUnit.miles, routeAvoidance: Microsoft.Maps.Directions.RouteAvoidance.avoidToll, routeAvoidance: Microsoft.Maps.Directions.RouteAvoidance.avoidLimitedAccessHighway });

    Tuesday, September 4, 2012 3:14 PM

Answers

  • No, the routeAvoidance property should be an array of RouteAvoidance objects like this:

    routeAvoidance : [Microsoft.Maps.Directions.RouteAvoidance.avoidToll, Microsoft.Maps.Directions.RouteAvoidance.avoidLimitedAccessHighway ]


    http://rbrundritt.wordpress.com

    • Proposed as answer by Ricky_Brundritt Tuesday, September 4, 2012 8:13 PM
    • Marked as answer by Don Kitchen Tuesday, September 4, 2012 8:47 PM
    Tuesday, September 4, 2012 8:13 PM

All replies

  • No, the routeAvoidance property should be an array of RouteAvoidance objects like this:

    routeAvoidance : [Microsoft.Maps.Directions.RouteAvoidance.avoidToll, Microsoft.Maps.Directions.RouteAvoidance.avoidLimitedAccessHighway ]


    http://rbrundritt.wordpress.com

    • Proposed as answer by Ricky_Brundritt Tuesday, September 4, 2012 8:13 PM
    • Marked as answer by Don Kitchen Tuesday, September 4, 2012 8:47 PM
    Tuesday, September 4, 2012 8:13 PM
  • Thanks!
    Tuesday, September 4, 2012 8:47 PM