diff --git a/MapView/main.py b/MapView/main.py index 1445092..bf0f0b4 100644 --- a/MapView/main.py +++ b/MapView/main.py @@ -10,6 +10,7 @@ class MapViewApp(App): def __init__(self, **kwargs): super().__init__() # додати необхідні змінні + self.pothole_markers = [] def on_start(self): """ @@ -29,10 +30,23 @@ class MapViewApp(App): """ def set_pothole_marker(self, point): - """ - Встановлює маркер для ями - :param point: GPS координати - """ + if isinstance(point, dict): + lat = point.get("lat") + lon = point.get("lon") + else: + lat, lon = point + + if lat is None or lon is None: + return + + marker = MapMarker( + lat=lat, + lon=lon, + source="images/pothole.png" + ) + + self.mapview.add_marker(marker) + self.pothole_markers.append(marker) def set_bump_marker(self, point): """