summaryrefslogtreecommitdiffstats
path: root/app/api
diff options
context:
space:
mode:
Diffstat (limited to 'app/api')
-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
}