From 7355d649718c0b5a0a91f9604db2a5a36e964ad5 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 e03bb6f..b48d8ba 100644 --- a/MapView/main.py +++ b/MapView/main.py @@ -103,6 +103,12 @@ class MapViewApp(App): if user_id == 1: 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")