Created
November 27, 2012 01:28
-
-
Save max-mapper/4151806 to your computer and use it in GitHub Desktop.
link to lat/lon in native maps app on ios and android from webview (phonegap)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mapLink = "http://maps.google.com/maps?z=12&t=m&q=loc:" + lat + "+" + lon | |
if ($.os.ios && navigator.userAgent.match(/iPhone OS 6_/)) mapLink = "Maps://?q=" + lat + "," + lon | |
if ($.os.android) mapLink = "geo:" + lat + "," + lon + "?z=12&q=" + lat + "," + lon | |
// assumes you have zepto and zepto.detect loaded | |
// also you should use target=_blank on your <a> tags |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment