summaryrefslogtreecommitdiffstats
path: root/app/api/GPS.qml
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2017-11-22 22:18:42 -0800
committerMatt Ranostay <matt.ranostay@konsulko.com>2017-11-23 18:15:18 -0800
commit73a26b17797cad0285f1f1559610fcbdf7a43bdb (patch)
tree2d34db664e07f5d88181e26db35af89abe0ab1d5 /app/api/GPS.qml
parent84ffd7b720c4b103befd6fc7682618201f07bb65 (diff)
navigation: qml: add car image and direction based on headingeel_4.99.3eel/4.99.34.99.3
Add car image and show GPS heading of vehicle based on movement. Change-Id: I57c056b5cdd40cf27b32a1155b7366230f49dbb4 Bug-AGL: SPEC-1068 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'app/api/GPS.qml')
-rw-r--r--app/api/GPS.qml8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/api/GPS.qml b/app/api/GPS.qml
index 8a2ebb9..679c66e 100644
--- a/app/api/GPS.qml
+++ b/app/api/GPS.qml
@@ -56,13 +56,17 @@ WebSocket {
var payload = JSON.parse(JSON.stringify(json[2]))
var event = payload.event
if (event == "gps/location") {
- var latitude = json[2].data.latitude
- var longitude = json[2].data.longitude
+ var data = json[2].data
+ var latitude = data.latitude
+ var longitude = data.longitude
var location = QtPositioning.coordinate(latitude, longitude)
if (map.followme || !map.location) {
map.center = location
}
map.location = location
+ if (data.speed > 1) {
+ map.updateCompass(data.track)
+ }
}
break
}