I have some addresses and want to create links to the Google Maps route planner. You can link to it by simply visiting https://www.google.com/maps/dir/<address 1>/<address 2>/
, e.g. https://www.google.com/maps/dir/Thompson+St,+New+York,+NY,+USA/Wooster+St,+New+York,+NY,+USA/
My problem here is, that for short distances, Google returns walking as the preferred form of transport (as in my link above). Which is good in terms of environment protection and keeping yourself healthy, but I definitely need the route with a car. How can I modify the link to always use car?
When visiting the link above, Google redirects to another URI with a lot of parameters. When I manually select car as form of transportation, the URI gets altered slightly into a new one: !3e0
gets added. But adding !3e0
or data=!3e0
to my link from above (https://www.google.com/maps/dir/Thompson+St,+New+York,+NY,+USA/Wooster+St,+New+York,+NY,+USA/data=!3e0) doesn't change anything. I also tried adding some of the other added parameters, but either they don't change anything or they contain the info about Thompson St. and Wooster St., so changing the readable parameters (<address 1/2>
) doesn't work again.
There is an official documentation now: https://developers.google.com/maps/documentation/urls/guide#directions-action
In your case the link would be:
https://www.google.com/maps/dir/?api=1&destination=Thompson+St,+New+York,+NY,+USA&travelmode=driving
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With