Bing Maps API Avoid Ferry Programmatically

Hamza faridy 1 Reputation point
2021-12-16T07:05:52.21+00:00

directionsManager.setRequestOptions({
distanceUnit: Microsoft.Maps.Directions.DistanceUnit.miles,
routeMode: Microsoft.Maps.Directions.RouteMode.driving,
routeAvoidance: [Microsoft.Maps.Directions.RouteAvoidance.avoidFerry]
});

i'm trying to avoid ferry but it's not working

Windows for home | Windows 11 | Apps
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. IoTGirl 3,621 Reputation points Microsoft Employee Moderator
    2022-01-03T15:55:44.637+00:00

    Can you provide the full sample call without the key? Or can you try on Bing.com/maps and see if it also provides the same results? You can then "share" the Bing.com/maps link for us to see.

    Note: The documentation for Directions Manager does not offer "Ferry" https://learn.microsoft.com/en-us/bingmaps/v8-web-control/modules/directions-module/routeavoidance-enumeration so do you have some other information on your expectation that this should work? Also, as ferries are not usually free, I wonder if "AvoidTolls" might work? Without your exact sample I can't confirm.

    Work-around: Call https://learn.microsoft.com/en-us/bingmaps/rest-services/routes/calculate-a-route which does offer to avoid ferries.

    0 comments No comments

  2. IoTGirl 3,621 Reputation points Microsoft Employee Moderator
    2022-01-11T01:15:40.07+00:00

    UPDATE: The Bing Maps Team has reviewed this issue and has accepted a work item in their backlog to add "Avoid Ferries" into the Web control. As they work on an AGILE schedule, I cannot give you a timeline for this feature request, but I can confirm that it has been accepted.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.