From d6bd9347a59df2808676a549ba81df12ecfc2d3d Mon Sep 17 00:00:00 2001 From: Arseniy Movshev Date: Sat, 12 Nov 2022 23:10:12 +0000 Subject: Work on adding gui for dropping pins Continue work on waypoint dialog Add experimental method of saving map positions --- src/MainMapView.qml | 69 ++++++++++++++++++++++++++--------------------------- 1 file changed, 34 insertions(+), 35 deletions(-) (limited to 'src/MainMapView.qml') 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 { + } } } -- cgit v1.2.3-54-g00ecf