summaryrefslogtreecommitdiffstats
path: root/app/map
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2017-11-14 20:53:42 -0800
committerMatt Ranostay <matt.ranostay@konsulko.com>2017-11-21 23:11:20 -0800
commit31a4cd81829e4a95b76d6cbebd9e069ae16943f8 (patch)
tree711b9f6155ff8b8b99dac341be8e31d6ada05ae8 /app/map
parent1e45e4460228a34ca2ecbae103d5d6a6e15e077b (diff)
navigation: gps: add gps geolocation support
Use GPS binding to get current location for navigation Bug-AGL: SPEC-1068 Change-Id: Ie708117499b342f86c60674c83f0222857a67bee Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'app/map')
-rw-r--r--app/map/MapComponent.qml28
1 files changed, 14 insertions, 14 deletions
diff --git a/app/map/MapComponent.qml b/app/map/MapComponent.qml
index b4bb330..ce669ff 100644
--- a/app/map/MapComponent.qml
+++ b/app/map/MapComponent.qml
@@ -38,7 +38,9 @@
**
****************************************************************************/
import QtQuick 2.5
+import QtQuick.Layouts 1.3
import QtQuick.Controls 1.4
+import QtQuick.Extras 1.4
import QtLocation 5.6
import QtPositioning 5.5
import "../helper.js" as Helper
@@ -267,20 +269,17 @@ Map {
// Enable pan, flick, and pinch gestures to zoom in and out
gesture.acceptedGestures: MapGestureArea.PanGesture | MapGestureArea.FlickGesture | MapGestureArea.PinchGesture
gesture.flickDeceleration: 3000
- gesture.enabled: true
+ gesture.enabled: !map.followme
//! [mapnavigation]
focus: true
onCopyrightLinkActivated: Qt.openUrlExternally(link)
onCenterChanged:{
scaleTimer.restart()
- if (map.followme)
- if (map.center != positionSource.position.coordinate) map.followme = false
}
onZoomLevelChanged:{
scaleTimer.restart()
- if (map.followme) map.center = positionSource.position.coordinate
}
onWidthChanged:{
@@ -324,19 +323,9 @@ Map {
Binding {
target: map
property: 'center'
- value: positionSource.position.coordinate
when: followme
}*/
- PositionSource{
- id: positionSource
- active: followme
-
- onPositionChanged: {
- map.center = positionSource.position.coordinate
- }
- }
-
MapQuickItem {
id: locationPoint
sourceItem: Rectangle { width: 14; height: 14; color: "#e41e25"; border.width: 2; border.color: "white"; smooth: true; radius: 7 }
@@ -368,6 +357,17 @@ Map {
width: 300
height: 300
+ ToggleButton {
+ id: followme
+ text: "GeoLocation Pan"
+ checked: map.followme
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ onClicked: {
+ map.followme = !map.followme
+ }
+ }
+
Button {
text: "Lookup Route"
Layout.fillWidth: true