From 616039a2a2d99186d17b78b6e03eca87f7aa0469 Mon Sep 17 00:00:00 2001 From: VitorVieiraZ Date: Mon, 26 Aug 2024 12:37:44 -0300 Subject: [PATCH] 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 bea295e228..e1ee58c1e0 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 ) {