[P] Add touch handling (untested).
This commit is contained in:
@@ -40,6 +40,8 @@ class MapViewApp(App):
|
|||||||
self.bump_markers: list[MapMarker] = []
|
self.bump_markers: list[MapMarker] = []
|
||||||
self.pothole_markers: list[MapMarker] = []
|
self.pothole_markers: list[MapMarker] = []
|
||||||
|
|
||||||
|
self.root_window.bind(on_touch_up = self.on_touch_up)
|
||||||
|
|
||||||
def on_start(self):
|
def on_start(self):
|
||||||
"""
|
"""
|
||||||
Встановлює необхідні маркери, викликає функцію для оновлення мапи
|
Встановлює необхідні маркери, викликає функцію для оновлення мапи
|
||||||
@@ -147,6 +149,12 @@ class MapViewApp(App):
|
|||||||
self.mapview.remove_marker(pothole)
|
self.mapview.remove_marker(pothole)
|
||||||
self.pothole_markers.pop(self.pothole_markers.index(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):
|
def build(self):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user