question

Yongxin-5692 avatar image
0 Votes"
Yongxin-5692 asked ·

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

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-mapswindows-maps
· 1
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@Yongxin-5692 can you be more specific and let us know if you are following a documentation and where is your Map being implemented (Web app, Android, iOS, Windows UWP)?

https://docs.microsoft.com/en-us/bingmaps/#pivot=main&panel=BingMapsAPI

Thanks!

0 Votes 0 ·

1 Answer

rbrundritt avatar image
1 Vote"
rbrundritt answered ·

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

· 1 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks, bro, u r my hero!

0 Votes 0 ·