A lightweight desktop map viewer built with Python and Pygame, powered by the Yandex Static Maps API.
Navigate the world, switch between map layers, and zoom in/out — all from your keyboard.
- Pan the map in all four directions using arrow keys
- Zoom in/out with Page Up / Page Down
- Switch between 3 map layers: Map → Satellite → Hybrid (Satellite + Roads)
- ️ GUI button in the corner to toggle layers with a click
- Auto-cleanup of temporary image files on exit
| Tool | Purpose |
|---|---|
Python 3 |
Core language |
pygame |
Window rendering & event handling |
requests |
HTTP requests to Yandex Maps API |
| Yandex Static Maps API | Map tile provider |
git clone https://github.com/your-username/StaticMapAPI.git
cd StaticMapAPIpip install pygame requestsMake sure you have img/exchange.png in the project root — this is used for the layer-switch button icon.
python main.pyYou'll be prompted to enter:
Введите координаты в формате (x,y): 37.6173,55.7558
Введите коэффициент масштабирования: 0.5
Coordinates are in longitude, latitude format (e.g.
37.6173,55.7558for Moscow).
Scale coefficient controls the visible area — smaller = more zoomed in.
| Key | Action |
|---|---|
↑ ↓ ← → |
Pan the map |
Page Up |
Zoom out |
Page Down |
Zoom in |
| Button (top-right) | Switch map layer |
StaticMapAPI/
├── main.py # Entry point, map logic, event loop
├── gui.py # Reusable Button class
├── img/
│ └── exchange.png # Layer-switch icon
└── README.md
- The Yandex Static Maps API may require an API key depending on usage limits. Check the official docs if you run into request errors.
- The app creates a temporary
map.pngfile during runtime and deletes it on exit.
This project is open source and available under the MIT License.