QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
HomePositionMapVisual.qml
Go to the documentation of this file.
1import QtQuick
2import QtLocation
3import QtPositioning
4
5import QGroundControl
6import QGroundControl.Controls
7
8/// Home position map visual for MissionSettingsItem
9MissionItemMapVisualBase {
10 id: control
11
12 indicatorComponent: homeIndicatorComponent
13
14 Component {
15 id: homeIndicatorComponent
16
17 MapQuickItem {
18 coordinate: control._missionItem.coordinate
19 visible: control._missionItem.specifiesCoordinate
20 z: QGroundControl.zOrderMapItems
21 opacity: control.opacity
22 anchorPoint.x: _homeImage.width / 2
23 anchorPoint.y: _homeImage.height / 2
24
25 sourceItem: Image {
26 id: _homeImage
27 source: "qrc:///qmlimages/MapHome.svg"
28
29 property real _smallRadiusRaw: Math.ceil((ScreenTools.defaultFontPixelHeight * ScreenTools.smallFontPointRatio) / 2)
30 property real _smallRadius: _smallRadiusRaw + ((_smallRadiusRaw % 2 == 0) ? 1 : 0)
31
32 width: _smallRadius * 2
33 height: width
34 sourceSize.width: width
35 sourceSize.height: height
36 fillMode: Image.PreserveAspectFit
37
38 MouseArea {
39 anchors.fill: parent
40 onClicked: if (control.interactive) control.clicked(control._missionItem.sequenceNumber)
41 }
42 }
43 }
44 }
45}