Skip to content

Instantly share code, notes, and snippets.

@iArnaud
Forked from max-mapper/index.js
Created January 28, 2013 14:07
Show Gist options
  • Select an option

  • Save iArnaud/4655763 to your computer and use it in GitHub Desktop.

Select an option

Save iArnaud/4655763 to your computer and use it in GitHub Desktop.
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