From b25e32e3b95d42c91bbf61bfcc033b1116666cad Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Tue, 12 Jul 2016 12:33:19 -0700 Subject: [PATCH] Use new polygon drawing tool --- src/MissionEditor/SurveyItemEditor.qml | 38 ++++++++++++++------------ 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/src/MissionEditor/SurveyItemEditor.qml b/src/MissionEditor/SurveyItemEditor.qml index 61cd8d9a1..f3ee5c885 100644 --- a/src/MissionEditor/SurveyItemEditor.qml +++ b/src/MissionEditor/SurveyItemEditor.qml @@ -19,8 +19,7 @@ Rectangle { //property real availableWidth ///< Width for control //property var missionItem ///< Mission Item for editor - property bool _addPointsMode: false - property real _margin: ScreenTools.defaultFontPixelWidth / 2 + property real _margin: ScreenTools.defaultFontPixelWidth / 2 QGCPalette { id: qgcPal; colorGroupEnabled: true } @@ -32,16 +31,6 @@ Rectangle { anchors.right: parent.right spacing: _margin - Connections { - target: editorMap - - onMapClicked: { - if (_addPointsMode) { - missionItem.addPolygonCoordinate(coordinate) - } - } - } - QGCLabel { text: qsTr("Fly a grid pattern over a defined area.") wrapMode: Text.WordWrap @@ -108,14 +97,29 @@ Rectangle { } } + Connections { + target: editorMap.polygonDraw + + onPolygonStarted: { + missionItem.clearPolygon() + } + + onPolygonFinished: { + for (var i=0; i