diff --git a/MapView/main.py b/MapView/main.py index 443d27a..53d7945 100644 --- a/MapView/main.py +++ b/MapView/main.py @@ -41,6 +41,8 @@ class MapViewApp(App): self.bump_markers: list[MapMarker] = [] self.pothole_markers: list[MapMarker] = [] + self.root_window.bind(on_touch_up = self.on_touch_up) + def on_start(self): """ Встановлює необхідні маркери, викликає функцію для оновлення мапи @@ -148,6 +150,12 @@ class MapViewApp(App): self.mapview.remove_marker(pothole) self.pothole_markers.pop(self.pothole_markers.index(pothole)) + def on_touch_up(self, touch): + self.mapview.on_touch_up(touch) + if touch.button == "right": + coordinate = self.mapview.get_latlon_at(touch.x, touch.y, self.mapview.zoom) + self.delete_pothole_marker(coordinate) + def build(self): """