Clicking or tapping on the map acquires longitude and latitude.
The application obtains and displays various weather data from the acquired longitude and latitude.
OpenStreetMap by OpenLayers is used to display a map that can be clicked or tapped to obtain longitude and latitude.
By including the longitude and latitude obtained from the map in the OpenWeather API call, various types of weather information for the selected location are dynamically obtained.
Below are the types of weather information that can be retrieved within this application.
https://weather-information-app-blond.vercel.app/
- node v16.14.0
- npm 8.3.1
- Clone the repository.
git clone https://github.com/kskwtnb93/weather-information-app.git
- Navigate into the cloned repository.
cd weather-information-app
- Install the required dependencies.
npm install
- Set up the .env.local file.
touch .env.local
- Update the .env.local file with your own settings.
VITE_OW_API_URL=https://api.openweathermap.org/data/2.5/
VITE_OW_API_KEY=your_api_key
- Start the application.
npm run dev
Both "npm run format" and "npm run lint" are executed.
npm run fix
To use the application, follow these steps:
- Open the application (DEMO) in your web browser.
- Find the location on the map where you want to know the weather, and click or tap on it. The map can be moved and zoomed in and out by mouse or tap.
- A marker indicating the selected location will appear where you click or tap.
- If the API response is returned normally, weather information for the selected location will be displayed.
- Developer: Keisuke Watanabe
"Weather information app with Vite and Vue3 and TypeScript" is under MIT license.