I am developing a very small HTML5/javascript website to be openned by mobile browsers from devices like android / iphone. I am using geo location of HTML5 to get the current l
Since this question was first posted and answered, as of Oct. 2017, Google has developed an API called Maps URL.
It is a universal, cross-platform URL for launching google maps.
https://www.google.com/maps/dir/?api=1
is the endpoint for maps that could include navigation.
You add the following parameters:
&origin=new+york
&destination=san+fransisco
&dir_action=navigate
If you leave out the origin, it will detect the location of the device, which is probably better for navigation anyway:
https://www.google.com/maps/dir/?api=1&destination=san+fransisco&dir_action=navigate
This will not immediately open navigation, but will take you to a google map, which will have the navigation icon on the page, and will give the user the option to use the app (or download it if they don't have it). This seems like a good solution. I just tested it in my browser, my Google Pixel, and my iPhone and it works the same on each mobile device.
Check out the rest of the documentation for more useful features: https://developers.google.com/maps/documentation/urls/guide