QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
CenterMapDropPanel.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Controls
3import QtQuick.Layouts
4import QtPositioning
5
6import QGroundControl
7import QGroundControl.Controls
8
9ColumnLayout {
10 id: root
11 spacing: ScreenTools.defaultFontPixelWidth * 0.5
12
13 property var map
14 property var fitFunctions
15 property bool showMission: true
16 property bool showAllItems: true
17
18 QGCLabel { text: qsTr("Center map on:") }
19
20 QGCButton {
21 text: qsTr("Mission")
22 Layout.fillWidth: true
23 visible: showMission
24
25 onClicked: {
26 dropPanel.hide()
27 fitFunctions.fitMapViewportToMissionItems()
28 }
29 }
30
31 QGCButton {
32 text: qsTr("All items")
33 Layout.fillWidth: true
34 visible: showAllItems
35
36 onClicked: {
37 dropPanel.hide()
38 fitFunctions.fitMapViewportToAllItems()
39 }
40 }
41
42 QGCButton {
43 text: qsTr("Launch")
44 Layout.fillWidth: true
45
46 onClicked: {
47 dropPanel.hide()
48 map.center = fitFunctions.fitHomePosition()
49 }
50 }
51
52 QGCButton {
53 text: qsTr("Vehicle")
54 Layout.fillWidth: true
55 enabled: globals.activeVehicle && globals.activeVehicle.coordinate.isValid
56
57 onClicked: {
58 dropPanel.hide()
59 map.center = globals.activeVehicle.coordinate
60 }
61 }
62
63 QGCButton {
64 text: qsTr("Current Location")
65 Layout.fillWidth: true
66 enabled: map.gcsPosition.isValid
67
68 onClicked: {
69 dropPanel.hide()
70 map.center = map.gcsPosition
71 }
72 }
73
74 QGCButton {
75 text: qsTr("Specified Location")
76 Layout.fillWidth: true
77
78 onClicked: {
79 dropPanel.hide()
80 map.centerToSpecifiedLocation()
81 }
82 }
83} // Column