# 🇳🇵 Nepal Interactive Administrative Boundary Map (चुच्चे नक्सा र वडा नक्सा)

> **A production-ready, ultra-fast client-side administrative boundary map application for Nepal featuring Post-2020 Chuche Map boundaries, dual Federal/Legacy administrative hierarchies, zero-freeze single-palika ward lazy chunking, configurable geographic & travel overlays, and a complete visited location tracking & backup system.**

Made with ❤️ in 🇳🇵 by Alok - hello@aloks.com.np

---

## 🌟 Key Features & Capabilities

1. **Dual Administrative System Modes**:
   - **Federal Mode (नयाँ प्रणाली)**: Country → 7 Provinces → 77 Districts → 753 Local Levels (Palikas) → 6,743 Wards.
   - **Legacy Mode (पुरानाे प्रणाली)**: Country → 5 Development Regions → 14 Zones → 75 Districts → 3,915 VDCs → Wards.
   - Immediate toggle switch with live breadcrumbs and dynamic layer repainting.

2. **Official Post-2020 Chuche Map (चुच्चे नक्सा)**:
   - Official post-May-2020 boundaries for Darchula district (Limpiyadhura, Lipulekh, and Kalapani extending up to ~30.45° N / 80.07° E).
   - Primary GeoJSON source: `nepali-geo-pro-max` CDN with automated self-healing fallbacks.

3. **Regional & Global Context**:
   - **Surrounding Neighbor Countries**: Subtle grey outlines & labels for India, China (Tibet), Bhutan, and Bangladesh in Country View.
   - **Mini-Globe Inset**: Real-time orthographic planet Earth representation highlighting Nepal.

4. **Configurable Geographic & Travel Overlays**:
   - 🛣️ **Major Highways (राजमार्गहरू)**: Mahendra (H01), Prithvi (H04), Tribhuvan (H02), BP (H06), Araniko (H03), Karnali (H13), Siddhartha (H10), Mid-Hill (Pushpalal Lokmarga), Postal (Hulaki Marga).
   - 🌊 **Major Rivers (प्रमुख नदीहरू)**: Koshi, Gandaki, Karnali, Mahakali, Mechi, Bagmati, Rapti river networks.
   - 🏙️ **Major Cities (प्रमुख सहरहरू)**: Kathmandu, Pokhara, Lalitpur, Bharatpur, Biratnagar, Birgunj, Nepalgunj, Dharan, Butwal, Hetauda, Dhangadhi, Janakpur, Itahari, Birendranagar, etc., with elevations and bilingual labels.
   - 🏔️ **Iconic Trekking Routes & Sacred High-Altitude Lakes**:
     - Everest Base Camp (EBC) & Kala Patthar, Annapurna Circuit & ABC, Langtang Valley & Kyanjin, Panch Pokhari, Bhairav Kunda, Gosaikunda, Tilicho Lake, Gokyo Lakes, Shey Phoksundo, Rara Lake, Tsho Rolpa, Kapuche Lake, Manaslu Circuit, Upper Mustang (Lo Manthang), Mardi Himal, Lumbini Sacred Garden, Chitwan Safari, Khaptad National Park.

5. **Visited Travel Tracker & Rollup System**:
   - Right-click / click on any Province, District, Palika, Ward, City, or Trek to mark it as visited with custom travel remarks.
   - **Hierarchical Rollup Rule**: Ward visited → Palika visited → District visited → Province visited.
   - Visited polygons rendered in vibrant emerald green (`#10b981`) with glowing highlighted borders.
   - LocalStorage persistence + JSON backup Import & Export for cross-device synchronization.

6. **3-Icon Theme Switcher & Responsive Display**:
   - ☀️ Light / 💻 System / 🌙 Dark 3-button segmented switch.
   - **Show Labels** & **Border-Only Wireframe Mode** toggles.
   - Mobile auto-adaptation on orientation change (Portrait to Landscape) with `100dvh` non-scrolling UI.

7. **Bilingual (NP / EN) & Dual Search**:
   - Real-time auto-complete for English and Devanagari searches across administrative units, cities, highways, and treks.

8. **Zero-Freeze High-Performance Architecture**:
   - Rendered using Leaflet Canvas (`L.canvas()`) for silky 60 FPS performance.
   - Turf.js on-demand single-palika ward subdivision (~15 KB payload) preventing DOM freeze.

---

## 📁 File Structure

```
aalooksth.github.io/nepal-map/
├── index.html                # Semantic HTML layout, top toolbar, entity card, modals
├── favicon.ico               # Site favicon
├── README.md                 # Documentation manual
├── css/
│   └── style.css             # Design tokens, Light/Dark themes, responsive rules
└── js/
    ├── translations.js       # Complete bilingual NP/EN dictionaries & Devanagari normalizer
    ├── overlay-data.js       # Highways, rivers, cities, trek routes & landmark coordinates
    ├── geo-data.js           # GeoJSON fetchers, Chuche CDN, neighbor geometries, ward chunking
    ├── visited-manager.js    # Visited state store, hierarchical rollups, remarks, LocalStorage, JSON import/export
    ├── map-renderer.js       # Leaflet Canvas engine, overlays management, drill-down/up, visited styling
    └── app.js                # App init, search autocomplete, orientation listeners, image export
```

---

## 🚀 Deployment

This application is 100% client-side and requires no backend server. It is hosted directly on GitHub Pages at:
`https://aalooksth.github.io/nepal-map/`

---

## 📜 Attribution & License

Made with ❤️ in 🇳🇵 by **Alok** ([hello@aloks.com.np](mailto:hello@aloks.com.np)).
All GeoJSON datasets derived from official public survey and open GIS repositories of Nepal.
