user disallowed geolocation - notify user second time
Posted
by Dror
on Stack Overflow
See other posts from Stack Overflow
or by Dror
Published on 2010-03-18T16:30:20Z
Indexed on
2010/03/18
16:41 UTC
Read the original article
Hit count: 739
When trying to get geolocation on iPhone the first time - I declined. Every other time I want to get the location (before another reload of the page) I get no response (no error and no success):
navigator.geolocation.getCurrentPosition(
function (location) {
ig_location.lat = location.coords.latitude;
ig_location.lng = location.coords.longitude;
alert('got it!');
},
function(PositionError) {
alert('failed!' + PositionError.message);
}
);
Is there a way to notify the user every time I fail to get the location?
(I do not need to use watchPosition...)
© Stack Overflow or respective owner