Shemeer M Ali
Shemeer M Ali

Reputation: 1041

How can open google map in iOS using Meteor

I need to open google/apple map app on iOS using Meteor js. I could do it in Andriod using window.open("geo:" + addressLongLat, "_system");, but the same code not working iOS.

Upvotes: 7

Views: 977

Answers (4)

Shemeer M Ali
Shemeer M Ali

Reputation: 1041

Final Answer

meteor add cordova:[email protected]

var addressLongLat = latitude + ',' + longitude;

window.open('maps://?q=' + addressLongLat, '_system'); //apple map

or

window.open('comgooglemaps://?q=' + addressLongLat, '_system'); //google map

Upvotes: 1

jcesarmobile
jcesarmobile

Reputation: 53341

On iOS geo: url scheme doesn't open Google maps, it can open Google Earth

Google maps app allows this three url schemes, comgooglemaps://, comgooglemaps-x-callback:// and comgooglemapsurl://

More information about google maps url schemes

You can also use the http url, that will open the app if it's installed or a website if it isn't

More information about http urls

Also, for making window.open work you'll have to install cordova-plugin-inappbrowser first. Otherwise, you'll have to use a links.

Also for Apple map you can use

window.open('maps://?q=' + addressLongLat, '_system');

Upvotes: 6

Andrew Hill
Andrew Hill

Reputation: 2253

Using a geo appended link will prompt the user to open the location in the maps application of their choice (assuming the user has more than one maps application on their device).

<a href="geo:-32.845027,23.006867">OPEN</a>

Upvotes: 2

Vishal Rajole
Vishal Rajole

Reputation: 1544

Try window.open('maps://?q=' + addressLongLat, '_system'); for iOS.

Reference: https://gist.github.com/danharper/844382901f7a7b73b90a

Upvotes: 2

Related Questions