[P] Add touch handling (untested).

This commit is contained in:
2026-03-26 11:32:36 +01:00
parent 39fca87025
commit 79a58f1737

View File

@@ -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):
"""