Skip to content

deka4core/StaticMapApi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

️ StaticMapAPI Viewer

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.


Features

  • 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

️ Tech Stack

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

Getting Started

1. Clone the repo

git clone https://github.com/your-username/StaticMapAPI.git
cd StaticMapAPI

2. Install dependencies

pip install pygame requests

3. Add the icon asset

Make sure you have img/exchange.png in the project root — this is used for the layer-switch button icon.

4. Run

python main.py

You'll be prompted to enter:

Введите координаты в формате (x,y): 37.6173,55.7558
Введите коэффициент масштабирования: 0.5

Coordinates are in longitude, latitude format (e.g. 37.6173,55.7558 for Moscow).
Scale coefficient controls the visible area — smaller = more zoomed in.


Controls

Key Action
↑ ↓ ← → Pan the map
Page Up Zoom out
Page Down Zoom in
Button (top-right) Switch map layer

Project Structure

StaticMapAPI/
├── main.py          # Entry point, map logic, event loop
├── gui.py           # Reusable Button class
├── img/
│   └── exchange.png # Layer-switch icon
└── README.md

️ Notes

  • 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.png file during runtime and deletes it on exit.

License

This project is open source and available under the MIT License.

About

A lightweight desktop map viewer built with Python and Pygame, powered by the Yandex Static Maps API.

Resources

Stars

Watchers

Forks

Contributors

Languages