aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/MainMapView.qml2
-rw-r--r--src/SettingsPage.qml7
-rw-r--r--src/main.qml7
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 {