Local Weather API Glitchy?


#1

Ive been having issues with the local weather app, I have finished it and half the time it works, and half the time it doesnt.

  • On Chrome, Opera it works sometimes instantly sometimes it takes a while to start working.

  • On safari Mac and Brave it never works even though I have allowed location services.

  • On firefox it loads slowly but eventually loads.

On all of them it sometimes immediately loads the Shuzenji location and doesn’t correct itself unless you refresh.

It doesnt work on my iPhone either, not on any of the browsers?

Is there something wrong with the API is it glitchy?

Console on the ones that don’t work doesnt mention any errors?

Heres the link: https://gorannovakovic.com/fcc/ShowLocalWeather/index.html

and on Codepen: https://codepen.io/gnovakov/pen/pLejxR


#2

Yes its glitchy, apparantly the Shuzenji location is the default setting on the API and remains cached. Not an actual error and thats why you dont get error on logs.
Here is a better explanation, follow the link.


#3

Also keep in mind that navigator.geolocation can take an insane amount of time. Usually the first call is fast, but if you make repeated calls, it may slow down, sometimes taking several minutes. There are APIs that can also get location.