From 25627855b438121b9b9653a5ca0ee96ee91e506e Mon Sep 17 00:00:00 2001 From: VitorVieiraZ Date: Thu, 8 Aug 2024 22:11:47 -0300 Subject: [PATCH 1/5] first approach to enhance highlights --- app/qml/map/MMRecordingTools.qml | 99 +++++++++++++++++++++----------- 1 file changed, 67 insertions(+), 32 deletions(-) diff --git a/app/qml/map/MMRecordingTools.qml b/app/qml/map/MMRecordingTools.qml index 041bdc7d2..dd93829fe 100644 --- a/app/qml/map/MMRecordingTools.qml +++ b/app/qml/map/MMRecordingTools.qml @@ -110,56 +110,91 @@ Item { lineBorderWidth: 0 } - MMHighlight { - id: handlesHighlight + Loader { + active: __inputUtils.geometryFromLayer( __activeLayer.vectorLayer ) === "linestring" || __inputUtils.geometryFromLayer( __activeLayer.vectorLayer ) === "polygon" + sourceComponent: handlesHighlightComponent + } - height: root.map.height - width: root.map.width + Loader { + active: __inputUtils.geometryFromLayer( __activeLayer.vectorLayer ) === "linestring" || __inputUtils.geometryFromLayer( __activeLayer.vectorLayer ) === "polygon" + sourceComponent: guidelineHighlightComponent + } - mapSettings: root.map.mapSettings - geometry: __inputUtils.transformGeometryToMapWithLayer( mapTool.handles, __activeLayer.vectorLayer, root.map.mapSettings ) + Loader { + active: __inputUtils.geometryFromLayer( __activeLayer.vectorLayer ) === "linestring" || __inputUtils.geometryFromLayer( __activeLayer.vectorLayer ) === "polygon" + sourceComponent: midSegmentsHighlightComponent + } - lineStrokeStyle: ShapePath.DashLine - lineWidth: MMHighlight.LineWidths.Narrow + Loader { + active: __inputUtils.geometryFromLayer( __activeLayer.vectorLayer ) === "point" + sourceComponent: existingVerticesHighlightComponent } - MMHighlight { - id: guideline + Component { + id: handlesHighlightComponent - height: root.map.height - width: root.map.width + MMHighlight { + id: handlesHighlight - lineWidth: MMHighlight.LineWidths.Narrow - lineStrokeStyle: ShapePath.DashLine + height: root.map.height + width: root.map.width - mapSettings: root.map.mapSettings - geometry: guidelineController.guidelineGeometry + mapSettings: root.map.mapSettings + geometry: __inputUtils.transformGeometryToMapWithLayer( mapTool.handles, __activeLayer.vectorLayer, root.map.mapSettings ) + lineStrokeStyle: ShapePath.DashLine + lineWidth: MMHighlight.LineWidths.Narrow + } } - MMHighlight { - id: midSegmentsHighlight + Component { + id: guidelineHighlightComponent - height: root.map.height - width: root.map.width + MMHighlight { + id: guideline - mapSettings: root.map.mapSettings - geometry: __inputUtils.transformGeometryToMapWithLayer( mapTool.midPoints, __activeLayer.vectorLayer, root.map.mapSettings ) + height: root.map.height + width: root.map.width - markerType: MMHighlight.MarkerTypes.Circle - markerBorderColor: __style.grapeColor + lineWidth: MMHighlight.LineWidths.Narrow + lineStrokeStyle: ShapePath.DashLine + + mapSettings: root.map.mapSettings + geometry: guidelineController.guidelineGeometry + } } - MMHighlight { - id: existingVerticesHighlight + Component { + id: midSegmentsHighlightComponent - height: root.map.height - width: root.map.width + MMHighlight { + id: midSegmentsHighlight - mapSettings: root.map.mapSettings - geometry: __inputUtils.transformGeometryToMapWithLayer( mapTool.existingVertices, __activeLayer.vectorLayer, root.map.mapSettings ) + height: root.map.height + width: root.map.width - markerType: MMHighlight.MarkerTypes.Circle - markerSize: MMHighlight.MarkerSizes.Bigger + mapSettings: root.map.mapSettings + geometry: __inputUtils.transformGeometryToMapWithLayer( mapTool.midPoints, __activeLayer.vectorLayer, root.map.mapSettings ) + + markerType: MMHighlight.MarkerTypes.Circle + markerBorderColor: __style.grapeColor + } + } + + Component { + id: existingVerticesHighlightComponent + + MMHighlight { + id: existingVerticesHighlight + + height: root.map.height + width: root.map.width + + mapSettings: root.map.mapSettings + geometry: __inputUtils.transformGeometryToMapWithLayer( mapTool.existingVertices, __activeLayer.vectorLayer, root.map.mapSettings ) + + markerType: MMHighlight.MarkerTypes.Circle + markerSize: MMHighlight.MarkerSizes.Bigger + } } // Duplicate position marker to be painted on the top of highlights From ad4b93ccd9e0a5c2a4da1aae7ae69731c6d5aece Mon Sep 17 00:00:00 2001 From: VitorVieiraZ Date: Fri, 16 Aug 2024 18:37:32 -0300 Subject: [PATCH 2/5] final adjustment --- app/qml/map/MMRecordingTools.qml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/qml/map/MMRecordingTools.qml b/app/qml/map/MMRecordingTools.qml index dd93829fe..9d51238ad 100644 --- a/app/qml/map/MMRecordingTools.qml +++ b/app/qml/map/MMRecordingTools.qml @@ -111,17 +111,23 @@ Item { } Loader { - active: __inputUtils.geometryFromLayer( __activeLayer.vectorLayer ) === "linestring" || __inputUtils.geometryFromLayer( __activeLayer.vectorLayer ) === "polygon" + active: __inputUtils.geometryFromLayer( __activeLayer.vectorLayer ) === "linestring" || + __inputUtils.geometryFromLayer( __activeLayer.vectorLayer ) === "polygon" + sourceComponent: handlesHighlightComponent } Loader { - active: __inputUtils.geometryFromLayer( __activeLayer.vectorLayer ) === "linestring" || __inputUtils.geometryFromLayer( __activeLayer.vectorLayer ) === "polygon" + active: __inputUtils.geometryFromLayer( __activeLayer.vectorLayer ) === "linestring" || + __inputUtils.geometryFromLayer( __activeLayer.vectorLayer ) === "polygon" + sourceComponent: guidelineHighlightComponent } Loader { - active: __inputUtils.geometryFromLayer( __activeLayer.vectorLayer ) === "linestring" || __inputUtils.geometryFromLayer( __activeLayer.vectorLayer ) === "polygon" + active: __inputUtils.geometryFromLayer( __activeLayer.vectorLayer ) === "linestring" || + __inputUtils.geometryFromLayer( __activeLayer.vectorLayer ) === "polygon" + sourceComponent: midSegmentsHighlightComponent } From 300a3266e197da8a3170005d8ec2b3e346862a1a Mon Sep 17 00:00:00 2001 From: VitorVieiraZ Date: Mon, 26 Aug 2024 12:25:47 -0300 Subject: [PATCH 3/5] last adjustment --- app/qml/map/MMRecordingTools.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/qml/map/MMRecordingTools.qml b/app/qml/map/MMRecordingTools.qml index 9d51238ad..bea295e22 100644 --- a/app/qml/map/MMRecordingTools.qml +++ b/app/qml/map/MMRecordingTools.qml @@ -132,7 +132,7 @@ Item { } Loader { - active: __inputUtils.geometryFromLayer( __activeLayer.vectorLayer ) === "point" + active: __inputUtils.geometryFromLayer( __activeLayer.vectorLayer ) !== "point" sourceComponent: existingVerticesHighlightComponent } From 59c9688acb39487b4b8f1c1287bc4d3d887f852b Mon Sep 17 00:00:00 2001 From: VitorVieiraZ Date: Mon, 26 Aug 2024 12:37:44 -0300 Subject: [PATCH 4/5] code adjustments --- app/qml/map/MMRecordingTools.qml | 148 +++++++++++++++---------------- 1 file changed, 74 insertions(+), 74 deletions(-) diff --git a/app/qml/map/MMRecordingTools.qml b/app/qml/map/MMRecordingTools.qml index bea295e22..e1ee58c1e 100644 --- a/app/qml/map/MMRecordingTools.qml +++ b/app/qml/map/MMRecordingTools.qml @@ -111,98 +111,31 @@ Item { } Loader { - active: __inputUtils.geometryFromLayer( __activeLayer.vectorLayer ) === "linestring" || - __inputUtils.geometryFromLayer( __activeLayer.vectorLayer ) === "polygon" + active: __inputUtils.isLineLayer( __activeLayer.vectorLayer ) || + __inputUtils.isPolygonLayer( __activeLayer.vectorLayer ) sourceComponent: handlesHighlightComponent } Loader { - active: __inputUtils.geometryFromLayer( __activeLayer.vectorLayer ) === "linestring" || - __inputUtils.geometryFromLayer( __activeLayer.vectorLayer ) === "polygon" + active: __inputUtils.isLineLayer( __activeLayer.vectorLayer ) || + __inputUtils.isPolygonLayer( __activeLayer.vectorLayer ) sourceComponent: guidelineHighlightComponent } Loader { - active: __inputUtils.geometryFromLayer( __activeLayer.vectorLayer ) === "linestring" || - __inputUtils.geometryFromLayer( __activeLayer.vectorLayer ) === "polygon" + active: __inputUtils.isLineLayer( __activeLayer.vectorLayer ) || + __inputUtils.isPolygonLayer( __activeLayer.vectorLayer ) sourceComponent: midSegmentsHighlightComponent } Loader { - active: __inputUtils.geometryFromLayer( __activeLayer.vectorLayer ) !== "point" + active: true sourceComponent: existingVerticesHighlightComponent } - Component { - id: handlesHighlightComponent - - MMHighlight { - id: handlesHighlight - - height: root.map.height - width: root.map.width - - mapSettings: root.map.mapSettings - geometry: __inputUtils.transformGeometryToMapWithLayer( mapTool.handles, __activeLayer.vectorLayer, root.map.mapSettings ) - lineStrokeStyle: ShapePath.DashLine - lineWidth: MMHighlight.LineWidths.Narrow - } - } - - Component { - id: guidelineHighlightComponent - - MMHighlight { - id: guideline - - height: root.map.height - width: root.map.width - - lineWidth: MMHighlight.LineWidths.Narrow - lineStrokeStyle: ShapePath.DashLine - - mapSettings: root.map.mapSettings - geometry: guidelineController.guidelineGeometry - } - } - - Component { - id: midSegmentsHighlightComponent - - MMHighlight { - id: midSegmentsHighlight - - height: root.map.height - width: root.map.width - - mapSettings: root.map.mapSettings - geometry: __inputUtils.transformGeometryToMapWithLayer( mapTool.midPoints, __activeLayer.vectorLayer, root.map.mapSettings ) - - markerType: MMHighlight.MarkerTypes.Circle - markerBorderColor: __style.grapeColor - } - } - - Component { - id: existingVerticesHighlightComponent - - MMHighlight { - id: existingVerticesHighlight - - height: root.map.height - width: root.map.width - - mapSettings: root.map.mapSettings - geometry: __inputUtils.transformGeometryToMapWithLayer( mapTool.existingVertices, __activeLayer.vectorLayer, root.map.mapSettings ) - - markerType: MMHighlight.MarkerTypes.Circle - markerSize: MMHighlight.MarkerSizes.Bigger - } - } - // Duplicate position marker to be painted on the top of highlights MMPositionMarker { xPos: positionMarkerComponent.xPos @@ -346,6 +279,73 @@ Item { } } + Component { + id: handlesHighlightComponent + + MMHighlight { + id: handlesHighlight + + height: root.map.height + width: root.map.width + + mapSettings: root.map.mapSettings + geometry: __inputUtils.transformGeometryToMapWithLayer( mapTool.handles, __activeLayer.vectorLayer, root.map.mapSettings ) + lineStrokeStyle: ShapePath.DashLine + lineWidth: MMHighlight.LineWidths.Narrow + } + } + + Component { + id: guidelineHighlightComponent + + MMHighlight { + id: guideline + + height: root.map.height + width: root.map.width + + lineWidth: MMHighlight.LineWidths.Narrow + lineStrokeStyle: ShapePath.DashLine + + mapSettings: root.map.mapSettings + geometry: guidelineController.guidelineGeometry + } + } + + Component { + id: midSegmentsHighlightComponent + + MMHighlight { + id: midSegmentsHighlight + + height: root.map.height + width: root.map.width + + mapSettings: root.map.mapSettings + geometry: __inputUtils.transformGeometryToMapWithLayer( mapTool.midPoints, __activeLayer.vectorLayer, root.map.mapSettings ) + + markerType: MMHighlight.MarkerTypes.Circle + markerBorderColor: __style.grapeColor + } + } + + Component { + id: existingVerticesHighlightComponent + + MMHighlight { + id: existingVerticesHighlight + + height: root.map.height + width: root.map.width + + mapSettings: root.map.mapSettings + geometry: __inputUtils.transformGeometryToMapWithLayer( mapTool.existingVertices, __activeLayer.vectorLayer, root.map.mapSettings ) + + markerType: MMHighlight.MarkerTypes.Circle + markerSize: MMHighlight.MarkerSizes.Bigger + } + } + Connections { target: map function onClicked( point ) { From 482faa40da4602b8888f91e3c72cf8603f83e66a Mon Sep 17 00:00:00 2001 From: VitorVieiraZ Date: Tue, 27 Aug 2024 14:39:07 -0300 Subject: [PATCH 5/5] existing highlights always enabled --- app/qml/map/MMRecordingTools.qml | 35 ++++++++++++-------------------- 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/app/qml/map/MMRecordingTools.qml b/app/qml/map/MMRecordingTools.qml index e1ee58c1e..babe68419 100644 --- a/app/qml/map/MMRecordingTools.qml +++ b/app/qml/map/MMRecordingTools.qml @@ -131,11 +131,6 @@ Item { sourceComponent: midSegmentsHighlightComponent } - Loader { - active: true - sourceComponent: existingVerticesHighlightComponent - } - // Duplicate position marker to be painted on the top of highlights MMPositionMarker { xPos: positionMarkerComponent.xPos @@ -161,6 +156,19 @@ Item { shouldUseSnapping: !mapTool.isUsingPosition } + MMHighlight { + id: existingVerticesHighlight + + height: root.map.height + width: root.map.width + + mapSettings: root.map.mapSettings + geometry: __inputUtils.transformGeometryToMapWithLayer( mapTool.existingVertices, __activeLayer.vectorLayer, root.map.mapSettings ) + + markerType: MMHighlight.MarkerTypes.Circle + markerSize: MMHighlight.MarkerSizes.Bigger + } + MMToolbar { y: parent.height @@ -329,23 +337,6 @@ Item { } } - Component { - id: existingVerticesHighlightComponent - - MMHighlight { - id: existingVerticesHighlight - - height: root.map.height - width: root.map.width - - mapSettings: root.map.mapSettings - geometry: __inputUtils.transformGeometryToMapWithLayer( mapTool.existingVertices, __activeLayer.vectorLayer, root.map.mapSettings ) - - markerType: MMHighlight.MarkerTypes.Circle - markerSize: MMHighlight.MarkerSizes.Bigger - } - } - Connections { target: map function onClicked( point ) {