Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic2/3: Is it possible to open google map APP by passing custom lat- long?

Currently i am working with ionic 3 project.

I have latitude and longitudes of particular location and want to get root of that location using google map Mobile Application, Just want to open that location by navigating to google map app. do anyone here with any suggestions or idea ?

Thanks

like image 244
Devang Mistry Avatar asked Jan 03 '23 06:01

Devang Mistry


2 Answers

As of 2017 the recommended by Google method is the Google Maps URLs:

https://developers.google.com/maps/documentation/urls/guide#directions-action

You can create a cross-platform universal URL for Google directions following the documentation and use the URL in your intents. For example the URL might be something like

https://www.google.com/maps/dir/?api=1&destination=60.626200,16.776800&travelmode=driving

like image 185
KARUPPU M Avatar answered Jan 13 '23 10:01

KARUPPU M


You can use Ionic Native Launch Navigator now to load the native maps app to a destination. You can specify the app launchnavigator.APP.GOOGLE_MAPS or the user can specify.

Pass the lat long as first argument as shown here

this.launchNavigator.navigate([50.279306, -5.163158], options)
  .then(
    success => console.log('Launched navigator'),
    error => console.log('Error launching navigator', error)
  );
like image 28
Philip Brack Avatar answered Jan 13 '23 09:01

Philip Brack