Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to have Heading considered for Google Directions API?

I have been looking at the documentation for Google Directions because while using this API I am noticing that my turn by turn directions are not always accurate. For example, I will receive instructions to "turn Right" on a street, when I need to first make a U-Turn. Instead of inserting the U-Turn manually, I was wondering if there is a way to use heading for Google Directions? From their documentation, the answer seems to be no.

https://developers.google.com/maps/documentation/directions/

I thought about possibly including waypoints, but still heading is not used. So instructions are not accurate.

https://maps.googleapis.com/maps/api/directions/json?origin=45.509166,-73.497897&destination=50.5027,-73.503455&waypoints=optimize:true|45.509196,-73.495494|45.511166,-73.493584|45.515887,-73.500751|45.516835,-73.507189|45.51497,-73.514892|45.507828,-73.515879|45.504038,-73.516008|45.508971,-73.505665|&sensor=false&API_KEY

This makes me ponder the question, how does Google determine turn by turn instructions without taking heading into consideration?

like image 645
portfoliobuilder Avatar asked Dec 20 '25 16:12

portfoliobuilder


1 Answers

You are right currently this is not possible with Directions API. There is a feature request in the public issue tracker:

https://issuetracker.google.com/issues/35824456

Feel free to star the issue to add your vote and subscribe to further updates from Google.

like image 91
xomena Avatar answered Dec 22 '25 07:12

xomena



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!