решение задания 5 + 6

This commit is contained in:
2023-01-30 21:46:21 +07:00
parent 94480dcd0c
commit 11fd0dbce9
5 changed files with 135 additions and 4 deletions
+4 -2
View File
@@ -3,10 +3,11 @@ import requests
from PIL import Image
def get_img_map(delta: float, cords: tuple, variant_map: str) -> None:
def get_img_map(delta: float, cords: tuple, variant_map: str, org_point: str) -> None:
"""
Функция обращается к api yandex и создаёт картинку карты по переданным данным
:param org_point: str - координаты организации, куда надо точку поставить
:param delta: float - разрешение карты
:param cords: tuple - 2 координаты точки
:param variant_map: str - вариант карты
@@ -15,7 +16,8 @@ def get_img_map(delta: float, cords: tuple, variant_map: str) -> None:
params = {
"ll": ",".join([str(cords[0]), str(cords[1])]),
"spn": ",".join([str(delta), str(delta)]),
"l": variant_map
"l": variant_map,
"pt": "{0},pm2dgl".format(org_point)
}
response = requests.get("http://static-maps.yandex.ru/1.x/", params=params)
# print(response.text)