1

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?

Martijn Pieters
  • 963,270
  • 265
  • 3,804
  • 3,187
Patrick Wer
  • 11
  • 1
  • 2
  • 1
    Possible duplicate of [html navigator "User denied Geolocation"](https://stackoverflow.com/questions/11725594/html-navigator-user-denied-geolocation) – Ken Y-N Sep 19 '17 at 23:52
  • Plus add some code and some more information about the error – pucky124 Sep 20 '17 at 02:40

2 Answers2

4

You're probably not using https. Most modern browsers require https to use geolocation. You can check it in Mozillas Browser Compatibility list.

Qback
  • 3,427
  • 2
  • 19
  • 35
  • 1
    That doesn't help much for local app development on FF v71 when the ionic server only issues a http server. Fortunately Vivaldi v2.10.1745.21 is working with this http method and geo is working. :) – vr_driver Dec 22 '19 at 13:28
0

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.

codingwithtashi
  • 1,431
  • 1
  • 16
  • 25