Skip to content

Instantly share code, notes, and snippets.

@jcready
Last active December 9, 2015 22:48
Show Gist options
  • Save jcready/4340157 to your computer and use it in GitHub Desktop.
Save jcready/4340157 to your computer and use it in GitHub Desktop.
(function (navigator) {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(location) {
var lat = location.coords.latitude,
lon = location.coords.longitude,
url = 'https://maps.google.com/maps?q='+lat+','+lon;
console.log('Latitude: %s | Longitude: %s \n%o', lat, lon, url);
var map = window.open(url, "GAMap", "width=1200,height=800");
});
}
})(window.navigator);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment