1/****************************************************************************
3 * (c) 2009-2024 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
5 * QGroundControl is licensed according to the terms in the file
6 * COPYING.md in the root of the source code directory.
8 ****************************************************************************/
13import QGroundControl.GeoMap
15/// Direction-indicator chevron positioned along a single fromCoord->toCoord
16/// segment, at fraction of the way between them (screen-space, see
17/// GeoMapMissionArrow). Self-contained (owns its own GeoMapProjectedPath)
18/// for one-off segments.
23 property var surfaceModel
24 property var fromCoord: QtPositioning.coordinate()
25 property var toCoord: QtPositioning.coordinate()
26 property real fraction: 0.75 ///< 0..1 along fromCoord -> toCoord
31 surfaceModel: root.surfaceModel
32 altitudeMode: GeoMapItem.Absolute
33 coordinates: [root.fromCoord, root.toCoord]
36 readonly property bool _ready: segmentPath.projected && segmentPath.screenPoints.length > 1
40 screenPoint: root._ready
41 ? Qt.point(segmentPath.screenPoints[0].x + (segmentPath.screenPoints[1].x - segmentPath.screenPoints[0].x) * root.fraction,
42 segmentPath.screenPoints[0].y + (segmentPath.screenPoints[1].y - segmentPath.screenPoints[0].y) * root.fraction)
45 ? Math.atan2(segmentPath.screenPoints[1].x - segmentPath.screenPoints[0].x,
46 -(segmentPath.screenPoints[1].y - segmentPath.screenPoints[0].y)) * 180 / Math.PI