0

I am developing a phonegap app to find store location. I want to open native Google Map app with following direction interface - enter image description here

I have the destination latitude and longitude and google map know my location. So I want to open google map app with direction. I have tried following -

var addressLongLat = $(this).data('lat')+','+$(this).data('long');
window.open('google.navigation:q='+addressLongLat);

Also try

var addressLongLat = $(this).data('lat')+','+$(this).data('long');
window.open('geo:q='+addressLongLat);

2nd one open Google Map but no direction and 1st one do nothing. I also try with anchor tag href but no luck. Webintent plugin also failed.Please anyone help me I am stuck for one week.

Kaviranga
  • 576
  • 2
  • 10
  • 24
Md Riad Hossain
  • 291
  • 4
  • 21

1 Answers1

0

Turn by Turn Directions on Google Maps via PhoneGap

I tried this on my Chrome web browser on Android 4.4. And it worked perfectly. My code was:

window.open("google.navigation:q=29.589241,79.646666");

You could also add the mode of navigation by adding the "mode" parameter to the query.

I would also recommend reading up the following:

Google Maps Intents

StackOverflow Question: Android Phonegap - How to Open Native Google Maps Application

If you are still having errors, you could share more of the code or the repository on Github.

Community
  • 1
  • 1
incorelabs
  • 566
  • 5
  • 13