mirror of
https://github.com/Rhinemann/IoT-Systems.git
synced 2026-03-14 20:50:39 +02:00
Merge branch 'dev' into lab5/gryshaiev-SCRUM-90-set-bump-marker
This commit is contained in:
commit
6b5831ff1b
@ -17,6 +17,7 @@ class MapViewApp(App):
|
||||
|
||||
# додати необхідні змінні
|
||||
self.bump_markers = []
|
||||
self.pothole_markers = []
|
||||
|
||||
def on_start(self):
|
||||
"""
|
||||
@ -78,10 +79,23 @@ class MapViewApp(App):
|
||||
self.mapview.center_on(lat, lon)
|
||||
|
||||
def set_pothole_marker(self, point):
|
||||
"""
|
||||
Встановлює маркер для ями
|
||||
:param point: GPS координати
|
||||
"""
|
||||
if isinstance(point, dict):
|
||||
lat = point.get("lat")
|
||||
lon = point.get("lon")
|
||||
else:
|
||||
lat, lon = point
|
||||
|
||||
if lat is None or lon is None:
|
||||
return
|
||||
|
||||
marker = MapMarker(
|
||||
lat=lat,
|
||||
lon=lon,
|
||||
source="images/pothole.png"
|
||||
)
|
||||
|
||||
self.mapview.add_marker(marker)
|
||||
self.pothole_markers.append(marker)
|
||||
|
||||
def set_bump_marker(self, point):
|
||||
if isinstance(point, dict):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user