diff options
author | Arseniy Movshev <dodoradio@outlook.com> | 2022-11-12 23:10:12 +0000 |
---|---|---|
committer | Arseniy Movshev <dodoradio@outlook.com> | 2023-01-07 14:51:55 +0000 |
commit | d6bd9347a59df2808676a549ba81df12ecfc2d3d (patch) | |
tree | 9dc492b917a3e7ff47e97d24b43bff698816f6c8 /src/MainMapView.qml | |
parent | 6161b765b5a2b64717de06b6f26bb7c2cf76d3d8 (diff) |
Work on adding gui for dropping pins
Continue work on waypoint dialog
Add experimental method of saving map positions
Diffstat (limited to 'src/MainMapView.qml')
-rw-r--r-- | src/MainMapView.qml | 69 |
1 files changed, 34 insertions, 35 deletions
diff --git a/src/MainMapView.qml b/src/MainMapView.qml index 7b81b45..39a4b8e 100644 --- a/src/MainMapView.qml +++ b/src/MainMapView.qml @@ -1,9 +1,25 @@ import QtQuick 2.0 import org.asteroid.controls 1.0 +import Nemo.Configuration 1.0 import QtPositioning 5.15 import QtLocation 5.15 Item { + ConfigurationValue { + id: mapZoom + key: "/map/zoomlevel" + defaultValue: 3.4 + } + ConfigurationValue { + id: mapCenterLat + key: "/map/location/lat" + defaultValue: 0 + } + ConfigurationValue { + id: mapCenterLong + key: "/map/location/long" + defaultValue: 0 + } Label { text: "Map Data from OpenStreetMap" font.pixelSize: parent.width*0.02 @@ -17,44 +33,27 @@ Item { copyrightsVisible: false //this is compensated by showing the copyright when application is loading color: "#00000000" z: 1 + Component.onCompleted: { zoomLevel = mapZoom.value; center.latitude = mapCenterLat.value; center.longitude = mapCenterLong.value; console.log(mapCenterLat.value,mapCenterLong.value)} + onZoomLevelChanged: mapZoom.value = zoomLevel + onCenterChanged: {mapCenterLat.value = center.latitude; mapCenterLong.value = center.longitude; console.log(center)} } - IconButton { - iconName: "ios-add-circle-outline" - anchors.right: parent.right - anchors.bottom: parent.verticalCenter - height: parent.height*0.2 - width: height - iconColor: "blue" - z: 2 - onClicked: mapView.zoomLevel = mapView.zoomLevel + 0.3 - } - IconButton { - iconName: "ios-remove-circle-outline" - anchors.right: parent.right - anchors.top: parent.verticalCenter - height: parent.height*0.2 - width: height - iconColor: "blue" - z: 2 - onClicked: mapView.zoomLevel = mapView.zoomLevel - 0.3 - } - IconButton { - iconName: "ios-locate-outline" - anchors.left: parent.left - anchors.verticalCenter: parent.verticalCenter - height: parent.height*0.2 - width: height - iconColor: "blue" + DefaultMapControls { + id: mapControls + anchors.fill: parent z: 2 } - IconButton { - iconName: "ios-menu-outline" - anchors.bottom: parent.bottom - anchors.horizontalCenter: parent.horizontalCenter - height: parent.height*0.2 - width: height - iconColor: "blue" + SetPointMapControls { + id: setPointControls + anchors.fill: parent + visible: false z: 2 - onClicked: pageStack.push(settingsPage,{}) + function primaryButtonAction() { + pageStack.push(setPointPage,{coord: mapView.center}) + } + } + Component { + id: setPointPage + SetPointPage { + } } } |