From 79a58f1737ea73d1f7651b8f4a9425461b95a901 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 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): """