From f17543c7007ff89da5ea42fc5b4dd03856932032 Mon Sep 17 00:00:00 2001 From: dogmaphobic Date: Mon, 4 May 2015 07:54:45 -0400 Subject: [PATCH] Adding the ability to add a waypoint. --- src/ui/qmlcommon/QGCMapBackground.qml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/ui/qmlcommon/QGCMapBackground.qml b/src/ui/qmlcommon/QGCMapBackground.qml index 98b5a9242..bb731fb4e 100644 --- a/src/ui/qmlcommon/QGCMapBackground.qml +++ b/src/ui/qmlcommon/QGCMapBackground.qml @@ -192,7 +192,7 @@ Item { /* // There is a bug currently in Qt where it fails to render a map taller than 6 tiles high. Until - // that's fixed, we can't rotate the map as it would require a larger map, which can easely grow + // that's fixed, we can't rotate the map as it would require a larger map, which can easily grow // larger than 6 tiles high. // https://bugreports.qt.io/browse/QTBUG-45508 transform: Rotation { @@ -214,6 +214,16 @@ Item { scaleTimer.restart() } + MouseArea { + anchors.fill: parent + onDoubleClicked: { + var coord = map.toCoordinate(Qt.point(mouse.x, mouse.y)); + map.addMarker(coord, polyLine.path.length); + polyLine.addCoordinate(coord); + map.changed = true; + } + } + function updateMarker(coord, wpid) { if(wpid < polyLine.path.length) { -- 2.22.0