cambecc / earth

a project to visualize global weather conditions
http://earth.nullschool.net
MIT License
5.99k stars 1.17k forks source link

Geolocation broken on both platforms. #111

Closed Erquint closed 4 years ago

Erquint commented 4 years ago

Both the web version and the Android app won't actually request geolocation permission upon user interaction. In the app there's also a permission error given without ever asking for one, even if the permission is given manually in system app settings.

Without any labels on the map, one can only resort to guesswork or manually inputting coordinates into the URL — not something you should expect of users in general.

cambecc commented 4 years ago

Which app are you referring to? There is no Android app for "earth".

Erquint commented 4 years ago

I guess someone made a wrapper.

I just noticed something in it...

Screenshot_20200422

I guess they added that as a workaround.

P.S. Just tried a mobile browser and geolocation works fine there. It's only my main desktop browser where the page won't ask for geolocation permission. I use an unpopular browser so you can probably just consider this issue irrelevant.

cambecc commented 4 years ago

Generally, I've seen browsers remember the user's preference to deny location permission to a website upon the first use of the geolocation feature. Have you tried this from a private/incognito tab?

Erquint commented 4 years ago

I have "Always ask" set as the default and I checked that it is not blocked. Now I just enabled it manually for the website: Screenshot And it still won't do anything when I click on the button. By the way, it never threw any errors in desktop browser: not in UI, not in JS console.

And, answering your question: nothing different in a private window.

cambecc commented 4 years ago

Hmm. Interesting. Perhaps the API is working fine but the browser doesn't provide a valid lat,lon?

What if you try running this in the js console:

navigator.geolocation.getCurrentPosition(pos => console.log(pos.coords), e => console.error("error", e));
Erquint commented 4 years ago

Weird. Have I broken the geolocation feature of my browser somehow..? I usually set every privacy option to public. P. S. Oh, wow, it was indeed disabled for some reason. No idea how it got disabled. I'm sorry. This is entirely on my side.