Commit 460810a4 authored by Dennis Nienhüser's avatar Dennis Nienhüser

Show the GPS position also if navigation mode is disabled

parent d03d2483
......@@ -90,7 +90,7 @@ ApplicationWindow {
showOtherPlaces: false
showScaleBar: false
showBackground: false
positionProvider: suspended ? "" : "QtPositioning"
positionProvider: suspended ? "" : "RouteSimulationPositionProviderPlugin"
showPositionMarker: false
onPositionAvailableChanged: {
......@@ -296,10 +296,10 @@ ApplicationWindow {
PositionMarker {
id: positionMarker
posX: navigationManager.visible ? navigationManager.snappedPositionMarkerScreenPosition.x : 0
posY: navigationManager.visible ? navigationManager.snappedPositionMarkerScreenPosition.y : 0
posX: navigationManager.snappedPositionMarkerScreenPosition.x
posY: navigationManager.snappedPositionMarkerScreenPosition.y
angle: marbleMaps.angle
visible: navigationManager.visible
visible: true
radius: navigationManager.screenAccuracy
color: navigationManager.deviated ? "#40ff0000" : "transparent"
border.color: navigationManager.deviated ? "red" : "transparent"
......
......@@ -20,18 +20,15 @@ Item {
id: root
property var marbleItem: null
property var tts: null
property var snappedPositionMarkerScreenPosition: null
property var snappedPositionMarkerScreenPosition: Qt.point(0, 0)
property bool guidanceMode: false
property double screenAccuracy: 0
property alias deviated: navigation.deviated
onGuidanceModeChanged: {
if (guidanceMode && marbleItem) {
navigation.marbleQuickItem = marbleItem;
if (guidanceMode) {
marbleItem.setZoomToMaximumLevel();
marbleItem.centerOnCurrentPosition();
} else {
navigation.marbleQuickItem = null
}
navigation.guidanceModeEnabled = guidanceMode;
......@@ -72,7 +69,7 @@ Item {
id: speed
color: palette.window
textColor: palette.text
text: qsTr("%1 km/h".arg((navigation.marbleQuickItem ? navigation.marbleQuickItem.speed * 3.6 : 0).toFixed(0)))
text: qsTr("%1 km/h".arg((navigation.marbleQuickItem.speed * 3.6).toFixed(0)))
anchors {
bottom: totalDistance.top
......@@ -83,6 +80,7 @@ Item {
Navigation {
id: navigation
marbleQuickItem: marbleItem
soundEnabled: false
onVoiceNavigationAnnouncementChanged: {
......@@ -150,17 +148,11 @@ Item {
function updateItem()
{
if (navigation.marbleQuickItem) {
if (navigation.deviated){
root.snappedPositionMarkerScreenPosition = navigation.currentPosition();
} else {
root.snappedPositionMarkerScreenPosition = navigation.positionOnRoute();
}
root.screenAccuracy = navigation.screenAccuracy();
}
else
{
root.snappedPositionMarkerScreenPosition = null;
if (navigation.deviated){
root.snappedPositionMarkerScreenPosition = navigation.currentPosition();
} else {
root.snappedPositionMarkerScreenPosition = navigation.positionOnRoute();
}
root.screenAccuracy = navigation.screenAccuracy();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment