This project is an interactive, bilingual map of the Tehran Metro system using OpenStreetMap (OSM) tiles and Leaflet.js.
It includes a searchable list of all stations in both Persian and English, auto-centers the map when a station is clicked, and uses geolocation caching to improve performance.
TehranMetroMap/
├── index.html # Main HTML entry point
├── style.css # Custom RTL-compatible styling
├── script.js # Metro logic and map interactivity
├── preview.jpg # Screenshot preview of the app
├── LICENSE # MIT License
└── README.md # This file
- ✅ OpenStreetMap-based map using Leaflet.js
- ✅ Supports Persian and English station names
- ✅ Smart search with fuzzy Persian/Latin matching
- ✅ Clickable station list auto-centers the map
- ✅ LocalStorage-based geocode caching (using Nominatim)
- ✅ Responsive and mobile-friendly design
- ✅ No API keys or accounts required
- ✅ Fully open-source, MIT-licensed
-
Download or clone this repository:
git clone https://github.com/BaseMax/TehranMetroMap.git cd TehranMetroMap -
Open
index.htmlin your browser:start index.html
Or double-click it from your file explorer.
No server or build tools are required.
-
The station list (
script.js) contains over 120 metro stations, each with a Persian and English name. -
When you search for a station, it searches both fields smartly.
-
Clicking a station will:
- Geocode it using the free OSM Nominatim API (if not cached)
- Place a marker on the map
- Auto-center and zoom on the location
- Leaflet.js – Open-source mapping library
- OpenStreetMap – Free global map tiles
- Nominatim – Public geocoding API (used respectfully with caching)
-
This project uses public Nominatim for geocoding. It is rate-limited and should not be abused.
-
For production use or heavy traffic, you should:
- Self-host your geocoder
- Or replace coordinates with pre-geocoded lat/lon data
This project is licensed under the MIT License.
© 2025, Seyyed Ali Mohammadiyeh (Max Base)
