Add lat lon to pothole mapper

This commit is contained in:
2026-03-25 19:51:58 +01:00
parent fe4ec12428
commit 7355d64971

View File

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