au bina
au bina

Reputation: 73

Open map to show direction from current location from application in Nativescript

I have only coordinates for one marker.

I want to open google maps when I have Link to Directions.

So, I have this code in html:

<Button (tap)="raggiungi()">RAGGIUNGI</Button >

In ts I have this function:

   raggiungi() {
        let lat = 53.9187068;
        let lng = 27.5862874;
        let url = 'https://maps.google.com/' + '?' + 'daddr' + '=' + lat +','+ lng
        console.log(url)
    }

In console show this url: https://maps.google.com/?daddr=53.9187068,27.5862874

Now, when I have this link, how to open maps app with this coordinates?

Upvotes: 0

Views: 843

Answers (1)

Manoj
Manoj

Reputation: 21908

Use openUrl method

utilsModule.openUrl(YourUrl)

Upvotes: 1

Related Questions