From 73a26b17797cad0285f1f1559610fcbdf7a43bdb Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Wed, 22 Nov 2017 22:18:42 -0800 Subject: navigation: qml: add car image and direction based on heading Add car image and show GPS heading of vehicle based on movement. Change-Id: I57c056b5cdd40cf27b32a1155b7366230f49dbb4 Bug-AGL: SPEC-1068 Signed-off-by: Matt Ranostay --- app/map/MapComponent.qml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'app/map') diff --git a/app/map/MapComponent.qml b/app/map/MapComponent.qml index 84ee7fe..161038c 100644 --- a/app/map/MapComponent.qml +++ b/app/map/MapComponent.qml @@ -267,6 +267,10 @@ Map { //! [geocode1] } + function updateCompass(heading) + { + compass.rotation = heading - 90 + } //! [coord] zoomLevel: (maximumZoomLevel - minimumZoomLevel)/2 @@ -335,7 +339,12 @@ Map { MapQuickItem { id: locationPoint - sourceItem: Rectangle { width: 14; height: 14; color: "#e41e25"; border.width: 2; border.color: "white"; smooth: true; radius: 7 } + sourceItem: Image { + id: compass + width: 100 * (map.zoomLevel / map.maximumZoomLevel) + height: 50 * (map.zoomLevel / map.maximumZoomLevel) + source: "../resources/car.png" + } coordinate: location opacity: 1.0 anchorPoint: Qt.point(sourceItem.width/2, sourceItem.height/2) -- cgit 1.2.3-korg