Fork of Derive India map - Open street
This interactive map of India combines Leaflet.js with a D3.js SVG overlay to display state boundaries and street-level fallback data. Users can hover over states to reveal population, area, capital, and description details in a side panel, or click to zoom into regions. The application supports multiple tile styles including OpenStreetMap, terrain, and satellite views. D3’s geoTransform projection and geoPath render GeoJSON state data from the geohacker/india repository, while the Leaflet map API handles panning, zooming, and view resets.
AI-generated descriptionInteractive Map of India
A modern, responsive web application featuring an interactive map of India with detailed state information and multiple viewing options.
Features
- Interactive State Map: Hover over states to see detailed information
- Multiple Map Styles: Switch between OpenStreetMap, Terrain, and Satellite views
- Responsive Design: Works seamlessly on desktop, tablet, and mobile devices
- State Information Panel: Displays population, area, capital, and description for each state
- Fallback System: Automatically switches to Mumbai street data if main data fails to load
- Modern UI: Clean, professional interface with smooth animations
Technologies Used
- Leaflet.js: Interactive map rendering and controls
- D3.js: Data visualization and SVG manipulation
- Vanilla JavaScript: ES6+ modules for clean, maintainable code
- CSS3: Modern styling with flexbox and animations
- GeoJSON: Geographic data format for map features
Getting Started
- Clone or download this repository
- Open
index.htmlin a modern web browser - The application will automatically load India state data and render the interactive map
No build process or package installation required - everything runs directly in the browser!
Usage
- Hover over states to see detailed information in the side panel
- Click on states to zoom in and focus on that region
- Use the Reset View button to return to the full India view
- Change map styles using the dropdown in the header
- Responsive design automatically adapts to your screen size
Browser Support
- Chrome/Chromium 80+
- Firefox 75+
- Safari 13+
- Edge 80+
Data Sources
- India state boundaries from geohacker/india
- Map tiles from OpenStreetMap, OpenTopoMap, and Esri
- State information compiled from various public sources
Architecture
The application follows a modular architecture:
app.js- Main application controller and initializationmap-renderer.js- Leaflet map management and D3 overlay renderingui-controller.js- User interface state managementdata-service.js- Data fetching and cachingstyles.css- Complete styling and responsive design
License
This project is open source and available under the MIT License.