Skip to content

Instantly share code, notes, and snippets.

@redraw
Last active April 10, 2018 18:37
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 redraw/66d575ecc9a45c8154ab43e79ca63294 to your computer and use it in GitHub Desktop.
Save redraw/66d575ecc9a45c8154ab43e79ca63294 to your computer and use it in GitHub Desktop.
getCurrentPosition(opts) {
return new Promise(function (resolve, reject) {
if ("geolocation" in navigator) {
navigator.geolocation.getCurrentPosition(resolve, reject, opts);
} else {
reject("Browser not supported")
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment