Files
test-yandex-map-api/functions/get_img_map.py
T

22 lines
407 B
Python

from io import BytesIO
import requests
from PIL import Image
api_server = "http://static-maps.yandex.ru/1.x/"
lon = "37.530887"
lat = "55.703118"
delta = "0.002"
params = {
"ll": ",".join([lon, lat]),
"spn": ",".join([delta, delta]),
"l": "map"
}
def get_img_map():
response = requests.get(api_server, params=params)
Image.open(BytesIO(
response.content)).save("image.png")