Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5 Geolocation ask again after refusal/denial

If a user denies the HTML5 Geolocation request for their location, is there a way to ask them again/trigger the permission request again?

I thought it might have simply been a case of clearing a specific cookie, but it looks like it is a setting that you have to specifically go in and remove from your browser preferences.

like image 650
Joe Cale Avatar asked Oct 26 '12 17:10

Joe Cale


People also ask

How accurate is HTML5 geolocation?

Depending on the availability of GPS on the device and the quality of the mobile/WIFI signals, HTML5 geolocation can be very accurate i.e. to a street level. Hence it can be used to pin point a device's location making it a very useful technology for websites or apps that require the exact user's location to work.

How do I ask for permission for geolocation?

The Geolocation. getCurrentPosition() function is then run, which prompts the user for permission; it runs the revealPosition() function if permission is granted (which shows the map), or the positionDenied() function if permission is denied (which makes the "Enable Geolocation" button appear).

How can I get location without permission?

3 ways to do this in this answer: Get a GPS precise location asking the user to allow access to its browser's API. Get an approximate location (country, city, area) using an external GeoIP service. Get an approximate location (country, city, area) using CDN service.

Is HTML geolocation API free?

So yes, getting a user's lat/lon is 'free'--no need to pay for that feature by itself.


1 Answers

You have to either request location from another domain, or provide instructions on how to go into their browser and change their settings. Just like on iPhone how you have to go into settings if you accidentally deny a permission.

It's because the permission-asking is actually something implemented on a per-browser basis. You can imagine if geolocation was around in IE6 days, IE6 would automatically always accept. Your solution would have to execute based on the browser someone is using.

like image 132
Aaron_H Avatar answered Oct 20 '22 22:10

Aaron_H