Is there a way to make a multiple start/end point api request?

Sreyas Voruganti 6 Reputation points
2021-08-14T18:49:18.367+00:00

I have an application in which I have an array of objects each with start/end coordinates. I have to annotate each object in the array with the time/distance via walking between the start/end coordinates. This involves making an API call for every single object to this URL: http://dev.virtualearth.net/REST/v1/Routes/Walking?wayPoint.1={coordA}&wayPoint.2={coordB}&distanceUnit=mi&key=.... This is quite an expensive operation which has to be done quite a few times in my application. Is there a way I could make one API call with all the pairs of coordinates?

Windows Maps
Windows Maps
A Microsoft app that provides voice navigation and turn-by-turn driving, transit, and walking directions.
254 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. IoTGirl 2,976 Reputation points Microsoft Employee
    2021-08-16T20:42:11.6+00:00

    If you are looking at the best route through a set of points, Distance Matrix (https://www.microsoft.com/en-us/maps/distance-matrix) might be a good option. Please note that it is 1 transaction for every 4 cells (https://learn.microsoft.com/en-us/bingmaps/getting-started/bing-maps-dev-center-help/understanding-bing-maps-transactions).

    1 person found this answer helpful.
    0 comments No comments