From 4575c4ab6fb3e5a4814dd29bbb710ddc898379c8 Mon Sep 17 00:00:00 2001 From: Thomas Chandelle Date: Tue, 14 Feb 2017 09:22:07 +0100 Subject: [PATCH 1/2] Do not draw circle when pointer not moved AND freehand is on --- src/ol/interaction/draw.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ol/interaction/draw.js b/src/ol/interaction/draw.js index 86763dd3ed..cf9f93fc94 100644 --- a/src/ol/interaction/draw.js +++ b/src/ol/interaction/draw.js @@ -374,7 +374,7 @@ ol.interaction.Draw.handleUpEvent_ = function(event) { this.addToDrawing_(event); } pass = false; - } else if (circleMode) { + } else if (circleMode && this.freehand_) { this.finishCoordinate_ = null; } return pass; From 73ef345a2db85a30ab83ee4194ca06c4942ec0fb Mon Sep 17 00:00:00 2001 From: Thomas Chandelle Date: Tue, 14 Feb 2017 09:26:35 +0100 Subject: [PATCH 2/2] Abort drawing to clear the sketch feature --- src/ol/interaction/draw.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ol/interaction/draw.js b/src/ol/interaction/draw.js index cf9f93fc94..2b40080802 100644 --- a/src/ol/interaction/draw.js +++ b/src/ol/interaction/draw.js @@ -376,6 +376,7 @@ ol.interaction.Draw.handleUpEvent_ = function(event) { pass = false; } else if (circleMode && this.freehand_) { this.finishCoordinate_ = null; + this.abortDrawing_(); } return pass; };