BaseMax / TehranMetroMap
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.
README
Tehran Metro Map
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.
๐ฆ Project Files
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
๐ Features
- โ 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
๐ฅ๏ธ Usage
-
Download or clone this repository:
git clone https://github.com/BaseMax/TehranMetroMap.git cd TehranMetroMap -
Open
index.htmlin your browser:start index.htmlOr double-click it from your file explorer.
No server or build tools are required.
๐ How It Works
-
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
๐ท Preview
๐ Technologies Used
- Leaflet.js โ Open-source mapping library
- OpenStreetMap โ Free global map tiles
- Nominatim โ Public geocoding API (used respectfully with caching)
โ ๏ธ Notes
-
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
๐ License
This project is licensed under the MIT License.
ยฉ 2025, Seyyed Ali Mohammadiyeh (Max Base)
KiloClaw - Managed OpenClaw hosting
