From eb1b5982def21f758710b133ceb283e197f5de49 Mon Sep 17 00:00:00 2001 From: Arseniy Movshev Date: Sat, 7 Jan 2023 15:58:55 +0000 Subject: Fix GPS positioning button --- src/MainMapView.qml | 2 +- src/SettingsPage.qml | 7 +++++++ src/main.qml | 7 ++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/MainMapView.qml b/src/MainMapView.qml index 3254611..2cefbeb 100644 --- a/src/MainMapView.qml +++ b/src/MainMapView.qml @@ -56,7 +56,7 @@ Item { Connections { target: positionProvider function onPositionChanged() { - center = positionProvider.position.coordinate + mapView.center = positionProvider.position.coordinate } } Connections { diff --git a/src/SettingsPage.qml b/src/SettingsPage.qml index 5c2e12f..c7f21cd 100644 --- a/src/SettingsPage.qml +++ b/src/SettingsPage.qml @@ -37,6 +37,13 @@ Item { Component.onCompleted: checked = enableCompass.value onCheckedChanged: enableCompass.value = checked } + LabeledSwitch { + width: parent.width + height: width*0.2 + text: "enable GPS" + Component.onCompleted: checked = prioritiseGPS.value + onCheckedChanged: prioritiseGPS.value = checked + } Row { width: parent.width height: width*0.2 diff --git a/src/main.qml b/src/main.qml index acca47a..22a7597 100644 --- a/src/main.qml +++ b/src/main.qml @@ -21,6 +21,7 @@ Application { } PositionSource { id: positionProvider + preferredPositioningMethods: prioritiseGPS.value ? PositionSource.SatellitePositioningMethods : PositionSource.AllPositioningMethods } Compass { id: compass @@ -36,7 +37,11 @@ Application { key: "/map/enableCompass" defaultValue: true } - + ConfigurationValue { + id: prioritiseGPS + key: "/map/prioritiseGPS" + defaultValue: true + } Component { id: mainMapView MainMapView { -- cgit v1.2.3-70-g09d2