6import QGroundControl.Controls
8/// Marker for displaying an ADS-B vehicle location on the map
13 property double altitude: Number.NaN ///< NAN to not show
14 property string callsign: "" ///< Vehicle callsign
15 property double heading: Number.NaN ///< Vehicle heading, NAN for none
16 property real size: ScreenTools.defaultFontPixelHeight * 3
17 property bool alert: false ///< Collision alert
19 anchorPoint.x: vehicleItem.width / 2
20 anchorPoint.y: vehicleItem.height / 2
21 visible: coordinate.isValid
23 function _labelText() {
24 return isNaN(altitude) ? "" : QGroundControl.unitsConversion.metersToAppSettingsVerticalDistanceUnitsString(altitude, 0) + "\n" + callsign
29 width: vehicleIcon.width
30 height: vehicleIcon.height
34 source: alert ? "/qmlimages/AlertAircraft.svg" : "/qmlimages/AwarenessAircraft.svg"
37 sourceSize.width: _root.size
38 fillMode: Image.PreserveAspectFit
40 origin.x: vehicleIcon.width / 2
41 origin.y: vehicleIcon.height / 2
42 angle: isNaN(heading) ? 0 : heading
48 objectName: "adsbAltitudeLabel"
49 anchors.top: parent.bottom
50 anchors.horizontalCenter: parent.horizontalCenter
52 font.pointSize: ScreenTools.defaultFontPointSize
53 visible: !isNaN(altitude)
59 target: QGroundControl.unitsConversion
61 function onUnitsChanged() {
62 altitudeLabel.text = Qt.binding(_labelText)