A modern, interactive web application for visualizing spatial data with point markers and polygon layers. Built with React, Tailwind CSS, and Leaflet.js.
- Point Data Layer - Interactive markers with location details (Washington DC dataset)
- Polygon Layer - Color-coded US states by population density
- Dual Display - On-map popups + detailed sidebar cards
- Smooth Animations - Fly-to transitions between layers
- Responsive Design - Works on all screen sizes
- Interactive Legend - Dynamic density color scale
# Clone repository
git clone https://github.com/yourusername/spatial-map-viewer.git
cd spatial-map-viewer
# Install dependencies
npm install
# Start development server
npm startOpen http://localhost:3000 to view the app.
# Core dependencies
npm install react react-dom leaflet lucide-react
# Dev dependencies
npm install -D tailwindcss postcss autoprefixer @types/leaflet
# Initialize Tailwind
npx tailwindcss init -p- Points Layer - Click blue markers to view location details
- Polygon Layer - Click states to see population density
- Navigation - Pan, zoom, and explore the map freely
Point Data:
{ id, name, type, lat, lng, details }Polygon Data:
{ id, name, type, density, coordinates: [[lat, lng], ...] }npm run build- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open a Pull Request
⭐ Star this repo if you find it helpful!