From 030c6e5fe9f5335eb27532f3fc8820883388c33a Mon Sep 17 00:00:00 2001 From: rhinemann Date: Wed, 25 Mar 2026 19:51:58 +0100 Subject: [PATCH] Add lat lon to pothole mapper --- MapView/main.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MapView/main.py b/MapView/main.py index 9dd9903..4e69f2e 100644 --- a/MapView/main.py +++ b/MapView/main.py @@ -104,6 +104,12 @@ class MapViewApp(App): if user_id == config.TRACK_ID: self.mapview.center_on(lat, lon) + def map_lat_lon_to_pothole(self, lat: float, lon: float) -> MapMarker | None: + click_tolerance = self.mapview.zoom * 10 + flt = filter(lambda marker: abs(lat - marker.lat) + abs(lon - marker.lon) < click_tolerance, + self.pothole_markers) + return next(flt) + def set_pothole_marker(self, point): if isinstance(point, dict): lat = point.get("lat")