QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
CorridorScanMapVisual.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Controls
3import QtLocation
4import QtPositioning
5
6import QGroundControl
7import QGroundControl.Controls
8import QGroundControl.FlightMap
9
10/// Corridor Scan Complex Mission Item visuals
11TransectStyleMapVisuals {
12 id: corridorVisuals
13 polygonInteractive: false
14 hideMapPolygon: mapPolylineVisuals.dragging
15 // The area polygon joins holes to its outer boundary with zero-width bridges, so its outline is drawn
16 // from the corridor boundaries instead to keep the bridges hidden.
17 polygonBorderWidth: 0
18
19 property bool _currentItem: object.isCurrentItem
20
21 function _updateBoundaryLines() {
22 boundaryLineObjects.destroyObjects()
23 const boundaries = object.corridorBoundaries
24 for (let i = 0; i < boundaries.length; i++) {
25 boundaryLineObjects.addObject(boundaryLineComponent.createObject(map, { path: boundaries[i] }), map)
26 }
27 }
28
29 Component.onCompleted: _updateBoundaryLines()
30
31 Connections {
32 target: object
33 function onCorridorBoundariesChanged() { corridorVisuals._updateBoundaryLines() }
34 }
35
36 QGCDynamicObjectManager {
37 id: boundaryLineObjects
38 }
39
40 Component {
41 id: boundaryLineComponent
42
43 MapPolyline {
44 line.color: "black"
45 line.width: 1
46 visible: !corridorVisuals.hideMapPolygon
47 opacity: corridorVisuals.opacity
48 }
49 }
50
51 QGCMapPolylineVisuals {
52 id: mapPolylineVisuals
53 mapControl: map
54 mapPolyline: object.corridorPolyline
55 interactive: _currentItem && parent.interactive
56 lineWidth: 3
57 lineColor: QGroundControl.globalPalette.mapMissionTrajectory
58 visible: _currentItem
59 opacity: parent.opacity
60 }
61}