Skip to content

Commit

Permalink
code adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
VitorVieiraZ committed Aug 26, 2024
1 parent fb177bc commit 616039a
Showing 1 changed file with 74 additions and 74 deletions.
148 changes: 74 additions & 74 deletions app/qml/map/MMRecordingTools.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 ) {
Expand Down

0 comments on commit 616039a

Please sign in to comment.