Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Loaders to Highlights in Recording Tools #3562

Merged
merged 5 commits into from
Aug 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 75 additions & 43 deletions app/qml/map/MMRecordingTools.qml
Original file line number Diff line number Diff line change
Expand Up @@ -110,56 +110,25 @@ Item {
lineBorderWidth: 0
}

MMHighlight {
id: handlesHighlight
Loader {
active: __inputUtils.isLineLayer( __activeLayer.vectorLayer ) ||
__inputUtils.isPolygonLayer( __activeLayer.vectorLayer )

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
sourceComponent: handlesHighlightComponent
}

MMHighlight {
id: guideline
Loader {
active: __inputUtils.isLineLayer( __activeLayer.vectorLayer ) ||
__inputUtils.isPolygonLayer( __activeLayer.vectorLayer )

height: root.map.height
width: root.map.width

lineWidth: MMHighlight.LineWidths.Narrow
lineStrokeStyle: ShapePath.DashLine

mapSettings: root.map.mapSettings
geometry: guidelineController.guidelineGeometry
sourceComponent: guidelineHighlightComponent
}

MMHighlight {
id: midSegmentsHighlight

height: root.map.height
width: root.map.width
Loader {
active: __inputUtils.isLineLayer( __activeLayer.vectorLayer ) ||
__inputUtils.isPolygonLayer( __activeLayer.vectorLayer )

mapSettings: root.map.mapSettings
geometry: __inputUtils.transformGeometryToMapWithLayer( mapTool.midPoints, __activeLayer.vectorLayer, root.map.mapSettings )

markerType: MMHighlight.MarkerTypes.Circle
markerBorderColor: __style.grapeColor
}

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
sourceComponent: midSegmentsHighlightComponent
}

// Duplicate position marker to be painted on the top of highlights
Expand Down Expand Up @@ -187,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

Expand Down Expand Up @@ -305,6 +287,56 @@ 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
}
}

Connections {
target: map
function onClicked( point ) {
Expand Down
Loading