Add Location & User Interactions
WeatherNow should not require users to type a city every time. In this module, you will expand the app’s interactions so users can either search manually or ask the browser for their current location.
You will first make the search form behave like a real user interaction, including validation for an empty search. Then you will connect the Use My Location action to the browser Geolocation API and feed the returned coordinates into the same weather-loading flow used by city search. You will also handle situations such as denied permissions, unsupported geolocation, and unavailable location data.
The goal is consistency: regardless of how the user chooses a location, WeatherNow should end up using the same weather-loading process and displaying the same dashboard experience.
What to expect:
- Make the search form submit correctly.
- Validate empty searches.
- Request the user’s browser location.
- Load weather from latitude and longitude.
- Handle location permission and browser errors.
- Keep search and location results consistent.