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
ceffcfeac2
commit
fba2fdd241
@ -10,11 +10,12 @@ class MapViewApp(App):
|
|||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
# додати необхідні змінні
|
# додати необхідні змінні
|
||||||
|
self.bump_markers = []
|
||||||
def on_start(self):
|
def on_start(self):
|
||||||
"""
|
"""
|
||||||
Встановлює необхідні маркери, викликає функцію для оновлення мапи
|
Встановлює необхідні маркери, викликає функцію для оновлення мапи
|
||||||
"""
|
"""
|
||||||
|
Clock.schedule_once(lambda dt: self.set_bump_marker((50.4501, 30.5234)), 0)
|
||||||
|
|
||||||
def update(self, *args):
|
def update(self, *args):
|
||||||
"""
|
"""
|
||||||
@ -35,10 +36,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