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