Forum Discussion

HSBHSB's avatar
HSBHSB
Copper Contributor
Oct 22, 2024

Migrate Bing Maps Distance Matrix to Azure Maps Route Matrix

We currently use Bing Maps API to get distances between points using the distance matrix.  We use the following URL:

https://dev.virtualearth.net/REST/v1/Routes/DistanceMatrix?origins={lat0,long0;lat1,lon1;latM,lonM}&destinations={lat0,lon0;lat1,lon1;latN,longN}&travelMode={travelMode}&startTime={startTime}&timeUnit={timeUnit}&key={BingMapsKey}

 

I've reviewed the migration document and it says to use the Route Matrix in Azure Maps, specifically the following URL:

https://atlas.microsoft.com/route/matrix/sync/json?api-version=1.0&subscription-key={subscription-key}

 

When I try to use this URL, I get a 405 error every time.  I'm not sure of the format to add the origins and destinations like the Bing Maps example has. I'd really prefer to use this API over the SDK as I like to be in control of how I retrieve and pull data out of the results.

 

Is there an example of using the Route Matrix API?

Resources