Question: I need to open google maps when i click a button and show directions from a source location and destination location. By searching a lot i figured out a way with InAppBrowser, but it doesnt work.

Here is the code i found:

```
  this.geolocation.getCurrentPosition().then((data) => {
      let lat = data.coords.latitude;
      let lng = data.coords.longitude;
      let bro = new InAppBrowser;

      if (this.platform.is('ios')) {
        bro.create('geo://?q=&saddr=' + data.coords.latitude + ',' + data.coords.longitude + '&daddr=' + this.dataitem['lat'] + ',' + this.dataitem['lng'], '_system');
      };
      if (this.platform.is('android')) {
        bro.create('geo://?q=' + data.coords.latitude + ',' + data.coords.longitude + '&daddr=' + this.dataitem['lat'] + ',' + this.dataitem['lng'] + '', '_system');
      };
  }).catch((err) => {
      console.log(JSON.stringify(err));
  });

```

Can someone help?

Answer: 
Install **[Launch Navigator](https://ionicframework.com/docs/native/launch-navigator/)** plugins:

1. Install the Cordova and Ionic Native plugins:

> 
> ionic cordova plugin add
> uk.co.workingedge.phonegap.plugin.launchnavigator
> 
> 
> npm install --save @ionic-native/launch-navigator
> 
> 
> 

2. add LaunchNavigator into **app.module.ts**
3. Add this code into your ts file :

```
source: any = [22.303894, 70.802160] // source lat,long
destination: any =  [23.022505, 72.571362] // dest lat,long

navigate(){

let options: LaunchNavigatorOptions = {
   start: this.source
};

 this.launchnavigator.navigate(this.destination, options)
   .then(
    success => alert('Launched navigator'),
    error => alert('Error launching navigator: ' + error)
 );
}

```

Done!
Use this to open maps, make sure In App Browser plugin is installed.

```
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');
}

```

[Reference](https://forum.ionicframework.com/t/open-navigation-app-to-navigate-to-adress/47178)