mirror of
https://github.com/Rhinemann/IoT-Systems.git
synced 2026-03-14 20:50:39 +02:00
Compare commits
No commits in common. "17738d07fefa05adf076772c096b39b9e381c9f1" and "87facff6685bb09b0f2b1efeed081743d3652bf6" have entirely different histories.
17738d07fe
...
87facff668
@ -15,15 +15,11 @@ class MapViewApp(App):
|
|||||||
self.line_layer = None
|
self.line_layer = None
|
||||||
self.car_marker = None
|
self.car_marker = None
|
||||||
|
|
||||||
# додати необхідні змінні
|
|
||||||
self.bump_markers = []
|
|
||||||
self.pothole_markers = []
|
|
||||||
|
|
||||||
def on_start(self):
|
def on_start(self):
|
||||||
"""
|
"""
|
||||||
Встановлює необхідні маркери, викликає функцію для оновлення мапи
|
Встановлює необхідні маркери, викликає функцію для оновлення мапи
|
||||||
"""
|
"""
|
||||||
Clock.schedule_once(lambda dt: self.set_bump_marker((50.4501, 30.5234)), 0)
|
Clock.schedule_interval(self.update, 0.3)
|
||||||
|
|
||||||
def update(self, *args):
|
def update(self, *args):
|
||||||
"""
|
"""
|
||||||
@ -79,43 +75,16 @@ class MapViewApp(App):
|
|||||||
self.mapview.center_on(lat, lon)
|
self.mapview.center_on(lat, lon)
|
||||||
|
|
||||||
def set_pothole_marker(self, point):
|
def set_pothole_marker(self, point):
|
||||||
if isinstance(point, dict):
|
"""
|
||||||
lat = point.get("lat")
|
Встановлює маркер для ями
|
||||||
lon = point.get("lon")
|
:param point: GPS координати
|
||||||
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):
|
def set_bump_marker(self, point):
|
||||||
if isinstance(point, dict):
|
"""
|
||||||
lat = point.get("lat")
|
Встановлює маркер для лежачого поліцейського
|
||||||
lon = point.get("lon")
|
:param point: GPS координати
|
||||||
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