Skip to content

Instantly share code, notes, and snippets.

@codyromano
Created December 23, 2013 02:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codyromano/8091016 to your computer and use it in GitHub Desktop.
Save codyromano/8091016 to your computer and use it in GitHub Desktop.
Basic example of JS geolocation
var handleLocation = function(pos) {
console.log(pos.coords); // User's approximate latitude and longitude
console.log(pos.coords.accuracy); // Approximate accuracy in meters
};
navigator.geolocation.getCurrentPosition(handleLocation, locError, {maximumAge:10, enableHighAccuracy: true});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment