diff --git a/src/FlightMap/FlightMap.qml b/src/FlightMap/FlightMap.qml index 3b72803c48b0b8e99be509d7873afdcdb175b845..340f2bf071358b90f2049f653d0a431e5025d542 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