Open navigation app to navigate to adress


#1

Hi,

How can I say that the app has to open a navigation app and find a adress?

I did found this github repo
https://github.com/dpa99c/phonegap-launch-navigator

but I dont know how to use this in my ionic 2 application

Martijn Bakker


#2

Super simple way to do it:

let destination = latitude + ',' + longitude;

if(this.platform.is('ios')){
	window.open('maps://?q=' + destination, '_system');
} else {
	let label = encodeURI('My Label');
	window.open('geo:0,0?q=' + destination + '(' + label + ')', '_system');
}

Will open Google Maps on Android, Apple Maps on iOS. Make sure In App Browser plugin is installed.


#3

I’ve 3 navigation apps installed on my Iphone:

  • Google Maps
  • Apple Maps
  • Waze

I want when I click on the button that he gives me the option wich application do you want to bring you to (for example amsterdam Central Station)?


#4


#5

This is exactly what v3 of phonegap-launch-navigator allows you to do.

And the usage is simple: install it

ionic plugin add uk.co.workingedge.phonegap.plugin.launchnavigator

Use it:

launchnavigator.navigate("London, UK");

By default it will give you the selection behaviour you are looking for.


#6

Question: I’ve been trying for a while now to get this launchnavigator plugin to work in Ionic 2.0.0.rc.0 but to no avail.

I’ve tried using it via the Ionic native plugin and the plugin straight up by it’s self but nothing works…

Any tips?
Much appreciated!


#7

I’ve added a new Ionic 2 project to the example repo which uses Ionic Native to invoke the plugin: https://github.com/dpa99c/phonegap-launch-navigator-example/tree/master/Ionic2Example


#8

Dude you’re awesome! Thank you very much. I’m sure a lot of people will really appreciate this!


#9

Works Perfectly!!! :slight_smile:


#10

Hi, I want to open my navigator in my app but it says:
index.html error launching navigator:plugin_not_installed

I installed the plugin from ionic docs and I showed in my mobile Iphone 6 whith Ionic View.
Thanks


#11

@dpa99c1:

Is it possible for you to make a ionic 3 updated example?


#12

It’s here: https://github.com/dpa99c/phonegap-launch-navigator-example/tree/master/Ionic3Example


#13

Thank you so much for the fast response! I’ll check it out!


#14

May this video help you


#15

I’ve tried this in my app. Works fine thank you :slight_smile: