A good friend asked me if it was possible to create a link on a web page that would open directly waze with directions to get to the place. I think this pretty much resemples the task, and explains it clearly.
So, the idea is to create a link to a point (address or latLong) that will open in the mobile’s Google maps app and provide directions right away:
This is the spot: Target center in Minneapolis
And these are the directions to the spot: Directions to Target Center in Minneapolis
To test in Bogota (so the directions do not involve international travel)
This is the spot: Estadio el Campin
And these are the directions :Directions to Estadio el campin
The URL is constructed with these basic data points:
- base url: It must be
https://www.google.com/maps/dir/?(params)
- params (concatenated with &):
api=1
: This is required for the call to work.source=[place]
: the source where the directions will be taken from. This parameter is optional, and if omitted the app will take the current location.place
must be url encoded.destination=[place]
: the destination place you want to reach.place
must be url encoded.
So, our 2 examples from above are
- https://www.google.com/maps/dir/?api=1&destination=target%20center and
- https://www.google.com/maps/dir/?api=1&destination=estadio+el+campin
This simple url has its own set of problems, related to ubiquity of the application. In today’s market the link should be universal, and open in the app thatthe user decides is its default for directions; but there is no standard for this, and if the user prefers to use apple’s iMaps or waze, I am not sure this approach would work.
I hope this explans how easy is to get this task done in simple HTML.