diff options
author | Arseniy Movshev <dodoradio@outlook.com> | 2023-01-07 15:58:55 +0000 |
---|---|---|
committer | Arseniy Movshev <dodoradio@outlook.com> | 2023-01-07 16:30:02 +0000 |
commit | eb1b5982def21f758710b133ceb283e197f5de49 (patch) | |
tree | d67cbc5a480f8bfcf4b373e2062e5c03bee709c5 /src | |
parent | ddff93dee672a3e78259a96f086017ff7b4fea75 (diff) |
Fix GPS positioning button
Diffstat (limited to '')
-rw-r--r-- | src/MainMapView.qml | 2 | ||||
-rw-r--r-- | src/SettingsPage.qml | 7 | ||||
-rw-r--r-- | 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 { |