Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Commit

Permalink
Fix tilt when navigating setting
Browse files Browse the repository at this point in the history
  • Loading branch information
otsaloma committed Jul 16, 2018
1 parent e397f98 commit be35626
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion qml/Map.qml
Expand Up @@ -30,7 +30,7 @@ MapboxMap {
cacheDatabaseDefaultPath: true
cacheDatabaseStoreSettings: false
center: QtPositioning.coordinate(49, 13)
pitch: app.navigationActive && format !== "raster" ? 60 : 0
pitch: app.navigationActive && format !== "raster" && tiltEnabled ? 60 : 0
pixelRatio: Theme.pixelRatio * 1.5
zoomLevel: 4.0

Expand All @@ -49,6 +49,7 @@ MapboxMap {
property var position: gps.position
property bool ready: false
property var route: {}
property bool tiltEnabled: false

readonly property var images: QtObject {
readonly property string pixel: "whogo-image-pixel"
Expand Down Expand Up @@ -218,6 +219,7 @@ MapboxMap {
map.centerOnPosition();
map.autoCenter = true;
map.autoRotate = true;
map.tiltEnabled = app.conf.get("tilt_when_navigating");
map.initVoiceNavigation();
app.navigationActive = true;
app.navigationPageSeen = true;
Expand Down Expand Up @@ -300,6 +302,7 @@ MapboxMap {
// Restore UI from navigation mode.
map.autoCenter = false;
map.autoRotate = false;
map.tiltEnabled = app.conf.get("tilt_when_navigating");
map.zoomLevel > 14 && map.setZoomLevel(14);
app.navigationActive = false;
}
Expand Down
1 change: 1 addition & 0 deletions qml/PreferencesPage.qml
Expand Up @@ -43,6 +43,7 @@ Page {
text: app.tr("Tilt map when navigating")
onCheckedChanged: {
app.conf.set("tilt_when_navigating", tiltSwitch.checked);
map.tiltEnabled = tiltSwitch.checked;
}
}

Expand Down

0 comments on commit be35626

Please sign in to comment.