diff options
author | Arseniy Movshev <dodoradio@outlook.com> | 2023-01-08 00:13:02 +0000 |
---|---|---|
committer | Arseniy Movshev <dodoradio@outlook.com> | 2023-01-15 16:58:12 +0000 |
commit | 1f81686f00869dce6cc33e1bc92bf24370ef3e12 (patch) | |
tree | aae5631666d35e87ba707219faba512f31b3934a /src/MainMapView.qml | |
parent | 7dfd22e942567bf151a8d373a64e6aed2e662b89 (diff) |
switch to using json as the carrier format for waypoints
Diffstat (limited to 'src/MainMapView.qml')
-rw-r--r-- | src/MainMapView.qml | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/MainMapView.qml b/src/MainMapView.qml index 40c42c8..584fcfd 100644 --- a/src/MainMapView.qml +++ b/src/MainMapView.qml @@ -69,18 +69,21 @@ Item { } property MapQuickItem mapItem function updateWaypoints() { - console.log("waypoints updated") - var waypointsList = waypointSource.value.split(">") - for(var i = 0, size = waypointsList.length-1; i < size ; i++){ - var currWaypointData = waypointsList[i].split(";") - var currWaypointCoord = currWaypointData[1].split(",") + clearMapItems() + var waypointsList = JSON.parse(waypointSource.value) + console.log(waypointsList) + for(var i = 0, size = waypointsList.length; i < size ; i++){ + var currWaypointData = waypointsList[i] mapItem = waypoint.createObject(mapView) - mapItem.coordinate = QtPositioning.coordinate(currWaypointCoord[0],currWaypointCoord[1]) + mapItem.coordinate = QtPositioning.coordinate(currWaypointData[1][0],currWaypointData[1][1]) + console.log(mapItem.coordinate) mapItem.iconName = currWaypointData[0] + console.log(currWaypointData[2]) mapItem.iconColor = currWaypointData[2] mapItem.index = i mapView.addMapItem(mapItem) } + console.log("waypoints updated") } } DefaultMapControls { @@ -97,8 +100,8 @@ Item { pageStack.push(setPointPage,{coord: mapView.center}) } } - function editWaypoint(number) { - console.log("invoking the edit page for waypoint number ", number) + function editWaypoint(index) { + pageStack.push(setPointPage,{editMode: true, editIndex: index}) } Component { id: waypoint |