diff --git a/src/FlightMap/FlightMap.qml b/src/FlightMap/FlightMap.qml index 3b72803..340f2bf 100644 --- a/src/FlightMap/FlightMap.qml +++ b/src/FlightMap/FlightMap.qml @@ -221,8 +221,7 @@ Map { var polygonPath = polygonDrawerPolygon.path polygonPath.pop() // get rid of drag coordinate - polygonDrawer._clearPolygon() - polygonDrawer.drawingPolygon = false + _cancelCapturePolygon() polygonDrawer._callbackObject.polygonCaptureFinished(polygonPath) return true } @@ -292,12 +291,27 @@ Map { } function finishAdjustPolygon() { + _cancelAdjustPolygon() + polygonDrawer._callbackObject.polygonAdjustFinished() + } + + /// Cancels an in progress draw or adjust + function cancelPolygonEdit() { + _cancelAdjustPolygon() + _cancelCapturePolygon() + } + + function _cancelAdjustPolygon() { polygonDrawer.adjustingPolygon = false for (var i=0; i