This project is a weather application built with Next.js, Leaflet, and the OpenWeather API. It allows users to click on the map to get real-time weather data for the selected location.
- Interactive Map: Powered by Leaflet with geolocation search.
- Weather Data: Displays weather information such as temperature, humidity, wind speed, etc., for the selected location.
- Responsive Design: Optimized for both desktop and mobile views.
- Next.js: React framework for building server-side rendered applications.
- Leaflet: JavaScript library for interactive maps.
- OpenWeather API: Provides real-time weather data.
- TypeScript: Static type checking.
-
Clone the repository:
git clone https://github.com/pnvdev/nextjs-weather-leaflet.git cd nextjs-weather-leaflet
-
Install dependencies:
npm install
-
Add your OpenWeather API key in a
.env.local
file:NEXT_PUBLIC_OPEN_WEATHER_API_KEY=your_api_key
-
Run the development server:
npm run dev
-
Open http://localhost:3000 to view it in your browser.
This project is deployed on Vercel. You can also deploy it on any platform that supports Next.js.
This project is open source and available under the MIT License.