I loaded my Leaflet Map on a Server. I have a GPS Function on my Map. But every time I get the error alert "Geolocation error: User denied geolocation prompt."
What is the problem?
I loaded my Leaflet Map on a Server. I have a GPS Function on my Map. But every time I get the error alert "Geolocation error: User denied geolocation prompt."
What is the problem?
You're probably not using https. Most modern browsers require https to use geolocation. You can check it in Mozillas Browser Compatibility list.
You can try this on Mac.
brew install nss
then
mkcert -install
then you need to allow location in your security settings.
You might need to check api if you are using any webview. In my case I am trying to load map in webview using flutter in mobile device and I ran into same problem.
I was using InAppWebView to load map.
There I had the same issue which is "Geolocation error: User denied geolocation prompt".
So later I noticed I had to use androidOnGeolocationPermissionsShowPrompt
parameter in InAppWebView
.
I am sure other package has same method.