Load Google Maps With Directions From Chrome Mobile for Android

I am working on a program that lists directions for errand runners so they know where to drive. It delivers the results on their phone. Every errand runner will be using a Galaxy Samsung Tab 3 with Google Chrome browser. So it is using the mobile version of Google Chrome.

Is it possible to launch Google Maps from a link on a webpage with directions to a clients address and get it started navigating to them?

I did some research into this https://developers.google.com/chrome/mobile/docs/intents and it looks like it might be possible but I'm not sure how to do it or if it will work like I intend?

I also found this (http://developer.android.com/guide/appendix/g-app-intents.html), might help give clues to the answer.

Answers


I recently found a solution. Apparently just linking to google maps on the device will prompt if you want to open with the maps program, which will work for my purposes.

To make it work properly you will want to link to Google Maps using Coordinates.

In javascript my function looks like below

JS:

function getPosition(position){
    latitude    = position.coords.latitude;
    longitude   = position.coords.longitude;

    var url = 'http://maps.google.com/maps?saddr='+latitude+','+longitude+'&daddr='+navAddress;
    window.location.href = url;
}

$("body").on("click",".routemap",function(){
    navAddress = $(this).attr("address");
    navigator.geolocation.getCurrentPosition(getPosition);//get the current position for google maps linking purposes.
});

Need Your Help

Unable to use HTML Tags inside HtmlHelper::link()

cakephp cakephp-2.0

I have the following link to generate the following link with helpers:

C# - declare method in argument (delegate)

c# delegates action

In the code below I pass method B as an action to be perfomed on on the objects in the IterateObjects method.