Azure Maps Route API - How to set DrivingSide a Left or Right

Mathew James 421 Reputation points
2024-05-03T06:51:13.7933333+00:00

I am using Azure maps Route API - sample indicated below

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

The question is it looks like, the route information returned is always based on LEFT HAND Driving.

How to set this to return for Right hand Driving. I can see some property called drivingSide, but please guide me on how to set this in the API as a Query parameter so that I get the response route for Right hand driving.

https://learn.microsoft.com/en-us/rest/api/maps/route/get-route-directions?view=rest-maps-2024-04-01-preview&tabs=HTTP#examples

One more question - If we set the country code say India, will it automatically take Driving Side as as Right hand side and calculate routes based on this ? If so, how to set the Country code while calling route API ?

Appreciate your response.

Thanks
-Mathew

Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
756 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. rbrundritt 18,791 Reputation points Microsoft Employee
    2024-05-06T14:56:40.1166667+00:00

    The DrivingSide property in the route service generally is the side of the road you would typically drive on (e.g. right side in the USA, left side in the UK) and not the side of the road you are on when starting your route. The vehicleHeading is an option of the request that you can pass in the direction the vehicle is pointing in degrees. This will then snap to the appropriate side of the road.


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.