I created a mobile web-app to rate places (such as restaurant, coffee etc) in my city.
So far I use navigator.geolocation.getCurrentPosition() of the geolocation API to get the place's coordinates in the form when users create the "place's post". I try to avoid a maximum in the process to force the user to write an address they most of time don't know by heart..
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition, showError);
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
}
}
function showError(error) {
switch(error.code) {
case error.PERMISSION_DENIED:
x.innerHTML = "User denied the request for Geolocation."
break;
case error.POSITION_UNAVAILABLE:
x.innerHTML = "Location information is unavailable."
break;
case error.TIMEOUT:
x.innerHTML = "The request to get user location timed out."
break;
case error.UNKNOWN_ERROR:
x.innerHTML = "An unknown error occurred."
break;
}
}
At that point my main issue is a lot of user have disabled the navigator's location and it's too complicated for them to go back to the settings to do the changes. In the same time they report me that if they would be invited to share a one-time location, they would accept it.
As far as I know it's impossible to do so because the navigator's settings take the lead on all web interactions. So once it's disabled, no turning back.
I was wondering what was the most seamless way for the user to share coordinates without touching to its navigator's settings?