How to ONLY Display Shortest Time or Shortest Distance Route in Bing Maps?

Yongxin 21 Reputation points
2021-02-01T00:11:22.31+00:00

Hi there,

I'm trying to display the shortest time or shortest distance route on my map and only the unique route, no other options at all. I've tried the following code, it shows me always 2 or 3 options. confused!

directionsManager.setRequestOptions({
routeMode: Microsoft.Maps.Directions.RouteMode.driving,
routeOptimization: Microsoft.Maps.Directions.RouteOptimization.shortestTime
});

any idea?

best thanks!

Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
736 questions
Windows Maps
Windows Maps
A Microsoft app that provides voice navigation and turn-by-turn driving, transit, and walking directions.
257 questions
{count} votes

Accepted answer
  1. rbrundritt 18,686 Reputation points Microsoft Employee
    2021-02-02T17:56:30.733+00:00

    Add maxRoutes: 1 to your options, by default this is set to 3.

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful

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.