@@ -37,21 +37,13 @@ def __init__(
3737 """
3838
3939 convert_address_to_coordinates(address: :class:`str`) -> tuple[float, float]
40- description
41- convert_coordinates_to_text_view(coordinates: tuple[float, float]) -> :class:`str`
42- description
43- generate_url() -> None
44- description
45- generate_api_url(address: :class:`str`) -> :class:`str`
46- description
40+ The function converts the address to coordinates
41+ generate_map_url() -> None
42+ The function generates the main link
4743 add_point(coordinates: Union[str, tuple[float, float]]) -> None
48- description
49- generate_map_url() -> :class:`str`
50- description
51- generate_api_url(address: :class:`str`) -> :class:`str`
52- description
44+ Add a point to the map
5345 commit_points(map_url: :class:`str`) -> :class:`str`
54- description
46+ Confirm all points
5547 """
5648 self .__map_url = "http://static-maps.yandex.ru/1.x/?ll={ll}&z={z}&l={type}"
5749 self .__api_url_template = "http://api.positionstack.com/v1/forward?access_key={key}&query={query}"
@@ -70,23 +62,23 @@ def __init__(
7062 self .main_url = self .generate_map_url ()
7163
7264 def convert_address_to_coordinates (self , address : str ) -> Tuple [float , ...]:
73- request = requests .get (self .generate_api_url (address )).json ()
65+ request = requests .get (self .__generate_api_url (address )).json ()
7466 return request ["data" ][0 ]["latitude" ], request ["data" ][0 ]["longitude" ]
7567
7668 @staticmethod
77- def convert_coordinates_to_text_view (coordinates : Tuple [float , ...]) -> str :
69+ def __convert_coordinates_to_text_view (coordinates : Tuple [float , ...]) -> str :
7870 return str (coordinates [1 ]) + "," + str (coordinates [0 ])
7971
8072 def generate_map_url (self ) -> str :
8173 url = self .__map_url .format (
82- ll = self .convert_coordinates_to_text_view (self .coordinates ),
74+ ll = self .__convert_coordinates_to_text_view (self .coordinates ),
8375 z = self .zoom ,
8476 type = "map"
8577 )
8678 self .commit_points (url )
8779 return url
8880
89- def generate_api_url (self , address : str ) -> str :
81+ def __generate_api_url (self , address : str ) -> str :
9082 return self .__api_url_template .format (
9183 key = self .api_key ,
9284 query = f"{ self .city } { address } "
0 commit comments