Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  1. Download or clone this repository:

    git clone https://github.com/BaseMax/TehranMetroMap.git
    cd TehranMetroMap
  2. Open index.html in your browser:

    start index.html

    Or 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

Map Preview


📚 Technologies Used


⚠️ 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)

https://github.com/BaseMax

About

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.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages