QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
MissionItemMapVisual.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/// Mission item map visual
11Item {
12 id: _root
13
14 property var map ///< Map control to place item in
15 property var vehicle ///< Vehicle associated with this item
16 property bool interactive: true ///< Vehicle associated with this item
17 property MissionItemIndicatorGroup indicatorGroup
18
19 signal clicked(int sequenceNumber)
20
21 Loader {
22 id: mapVisualLoader
23
24 asynchronous: true
25
26 Component.onCompleted: {
27 const properties = {
28 map: _root.map,
29 vehicle: _root.vehicle,
30 opacity: Qt.binding(() => _root.opacity),
31 interactive: Qt.binding(() => _root.interactive)
32 }
33 if (object.isSimpleItem) {
34 properties.indicatorGroup = _root.indicatorGroup
35 }
36 mapVisualLoader.setSource(object.mapVisualQML, properties)
37 }
38
39 onLoaded: {
40 if (!item) {
41 return
42 }
43
44 item.parent = map
45
46 if (item.clicked) {
47 item.clicked.connect(_root.clicked)
48 }
49 }
50 }
51}