mirror of
https://github.com/Rhinemann/IoT-Systems.git
synced 2026-03-14 20:50:39 +02:00
SCRUM-90: implement set_bump_marker
This commit is contained in:
parent
87facff668
commit
6f4b3b0ea6
@ -15,11 +15,14 @@ class MapViewApp(App):
|
|||||||
self.line_layer = None
|
self.line_layer = None
|
||||||
self.car_marker = None
|
self.car_marker = None
|
||||||
|
|
||||||
|
# додати необхідні змінні
|
||||||
|
self.bump_markers = []
|
||||||
|
|
||||||
def on_start(self):
|
def on_start(self):
|
||||||
"""
|
"""
|
||||||
Встановлює необхідні маркери, викликає функцію для оновлення мапи
|
Встановлює необхідні маркери, викликає функцію для оновлення мапи
|
||||||
"""
|
"""
|
||||||
Clock.schedule_interval(self.update, 0.3)
|
Clock.schedule_once(lambda dt: self.set_bump_marker((50.4501, 30.5234)), 0)
|
||||||
|
|
||||||
def update(self, *args):
|
def update(self, *args):
|
||||||
"""
|
"""
|
||||||
@ -81,10 +84,24 @@ class MapViewApp(App):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def set_bump_marker(self, point):
|
def set_bump_marker(self, point):
|
||||||
"""
|
if isinstance(point, dict):
|
||||||
Встановлює маркер для лежачого поліцейського
|
lat = point.get("lat")
|
||||||
:param point: GPS координати
|
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/bump.png"
|
||||||
|
)
|
||||||
|
|
||||||
|
self.mapview.add_marker(marker)
|
||||||
|
self.bump_markers.append(marker)
|
||||||
|
|
||||||
|
|
||||||
def build(self):
|
def build(self):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user