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.
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.
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).
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.
So yes, getting a user's lat/lon is 'free'--no need to pay for that feature by itself.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With