adaharshsingh / Propacity

https://propacity-alpha.vercel.app
5 stars 36 forks source link

Adding Feature of Current Location for accessing Weather forecast. #25

Closed RishabhSri17 closed 1 month ago

RishabhSri17 commented 1 month ago

Problem: Currently, there is no option for accessing the weather forecast of the user's current location. The application only allows access to the weather data for locations listed in the /assets/cities.json file.

Screenshots: Current Website having Cities option or Search city Option. Screenshot 2024-10-06 173218 Only Weather Forecast data for Cities present in cities.json is accessed . Screenshot 2024-10-06 174054

Proposed Solution: I propose adding a new feature that allows users to fetch the weather forecast for their current location by utilizing the browser's Geolocation API. This will enable users to retrieve the weather forecast based on their latitude and longitude. The feature will include a new card in the city selection area labeled "Your Location," which, when clicked, will request the user's location and display the relevant weather data.

I have already implemented the LocationCard component, which integrates the Geolocation API to fetch the user's current coordinates and retrieve weather data using these coordinates through the Visual Crossing Weather API.

Changes Implemented:

Please assign this issue to me, and kindly add the Hacktoberfest tag for tracking.

adaharshsingh commented 1 month ago

Go Ahead!!!

RishabhSri17 commented 1 month ago

I had added the feature of Current Location and it is working fine . Added screenshot for same .

Screenshot 2024-10-07 021544 (2)

I am also working on displaying place names instead of latitude and longitude for a better user interface, and I would like to add this feature in my next PR under same issue if given the chance.

Edit - I had also change displaying of Latitude/longitude to Placename Now. Screenshot 2024-10-07 021711

Please accept my pull request #26 and review the changes and let me know if any adjustments are needed. Thank you!