project/shved-SCRUM-110-hole-deleting #36
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user