Skip to content

Instantly share code, notes, and snippets.

@vbabiy
Last active December 11, 2015 00:49
Show Gist options
  • Save vbabiy/4519573 to your computer and use it in GitHub Desktop.
Save vbabiy/4519573 to your computer and use it in GitHub Desktop.
Get Location
navigator.geolocation.getCurrentPosition(function(args) {
console.log(args.coords.latitude,args.coords.longitude)
}, function(error) {
console.error(error);
});
Copy link

ghost commented Jan 12, 2013

I obtain that: (Chrome 24, Windows 7 x64)

navigator.geolocation.getCurrentPosition(function(args) {console.log(args.coords.latitude,args.coords.longitude) })
undefined

Copy link

ghost commented Jan 13, 2013

I've got that:

PositionError {message: "Network location provider at 'https://www.googleapis.com/' : Returned error code 404.", code: 2, PERMISSION_DENIED: 1, POSITION_UNAVAILABLE: 2, TIMEOUT: 3}
(anonymous function)

@DJA-JJ
Copy link

DJA-JJ commented Jan 18, 2013

undefined

and below it gives me the coordinates which match with my location after checking with Google maps.
Still I don't get any results and the loading indicator keeps spinning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment