EddyVerbruggen / nativescript-directions

:point_up_2: :point_right: :point_down: :point_left: Open the Maps app to show directions to anywhere you like
MIT License
83 stars 21 forks source link

Android: Google Maps open in my Nativescript App #15

Open lordrepha1980 opened 6 years ago

lordrepha1980 commented 6 years ago

Hi There

I have a problem. Android open the Native Goggle Maps App in my App. How can i fix this?. IOS works fine.

komal2694 commented 6 years ago

I am also facing the same issue. any updates on this??

lordrepha1980 commented 6 years ago

I have a solution. I used Nativescript openUrl from utils and create a googlemaps schema URL like this: utilsModule.openUrl("https://www.google.com/maps/dir/?api=1&destination=" + address)

this works fine with Android but in IOS this doesn't work.

the variable 'address' must be urlencoded

https://developers.google.com/maps/documentation/urls/guide

elalienx commented 6 years ago

Hi have you checked https://stackoverflow.com/questions/332872/encode-url-in-javascript to encode the variables?