CodeExplainedRepo / Weather-App-JavaScript

Create a Weather App With JavaScript
221 stars 167 forks source link

Wrong geolocation #4

Open amolgorithm opened 1 year ago

amolgorithm commented 1 year ago

The webpage requested my geolocation (I'm assuming it receives the latitude and longitude), but it was greatly off from my actual location. It showed the weather forecast of an area that is 50 km away from where I was, unfortunately showing the wrong temperature (off by 2 Celsius). HTML5 Geolocation is supposed to be accurate to within a kilometre, which means that the Weather API that is used in the project may not have my suburban neighborhood listed in its database. So, it could have gone to the location in its database that was closest to my location, which happened to be 50 km away. Everything other than this issue was fantastic and well done though.

ery-day-bradly commented 1 year ago

This is interesting... I will see what happens to me...

ayushgupta-06 commented 5 months ago

Hey there! I also created a Weather App using Vanilla JS using the same API provider. For the geolocation of a place. I simply asked the user to select city and using the Geocoding API provided by openweathermap I got the latitude and longitude of the city very easily then using that I fetched the accurate weather data.

It would be good to implement this method to get accurated weather details!

I would really appreciate if you check my weather app too, your one view means alot! My Weather App