From e28bfe02d2a6aa4b647d55d0e5df917a62b8c51d Mon Sep 17 00:00:00 2001 From: rhinemann Date: Thu, 26 Mar 2026 11:32:36 +0100 Subject: [PATCH] [P] Add touch handling (untested). --- MapView/main.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/MapView/main.py b/MapView/main.py index e9bd1b4..189d7ed 100644 --- a/MapView/main.py +++ b/MapView/main.py @@ -40,6 +40,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): """ Встановлює необхідні маркери, викликає функцію для оновлення мапи @@ -147,6 +149,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): """