This application provides a user with a world map that the user can click on in order to obtain weather information about the clicked on location. The code was written in the VSCode IDE. I chose the third party library "react-map-gl" so that I could more easily render the map in a react component.
-
Install dependencies
#!sh yarn
-
Add a file to the root directory named '.env', add to it the following enviroment varibles.
REACT_APP_MAPBOX_ACCESS_TOKEN = '' REACT_APP_OPEN_WEATHER_APIKEY = ''
API Keys can be obtained from Mapbox and Openweather API.
-
Run application
#!sh yarn start
- The application is deployed to https://warm-scrubland-44009.herokuapp.com/
- One edge case I encountered was the bad request that occurs when a user clicks on an area of the map with an invalid longitide. Rather than make the map non repeating, I chose to force the longitude within valid boundaries if an invalid input is detected.