Skip to content

Instantly share code, notes, and snippets.

@alizhdanov
Created September 1, 2018 12:49
Show Gist options
  • Save alizhdanov/35e66aaa1c6c4b274f7bcf4ee1cb0ba3 to your computer and use it in GitHub Desktop.
Save alizhdanov/35e66aaa1c6c4b274f7bcf4ee1cb0ba3 to your computer and use it in GitHub Desktop.
Simple geolocation API example
const success = position => {
const { latitude, longitude } = position.coords;
console.log(`Your coordinates - ${latitude}lat and ${longitude}lng`);
};
const error = err => {
console.log(err);
};
getCurrentPosition(success, error);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment