From e85d8fa749818bdee4707c054a5a7ff9a1c88c78 Mon Sep 17 00:00:00 2001 From: Mattias Josefsson Date: Mon, 25 Apr 2016 11:48:55 +0200 Subject: [PATCH 1/2] Fix for close draw polygon error --- src/ol/interaction/modifyinteraction.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ol/interaction/modifyinteraction.js b/src/ol/interaction/modifyinteraction.js index e42e778512..6c8be757f4 100644 --- a/src/ol/interaction/modifyinteraction.js +++ b/src/ol/interaction/modifyinteraction.js @@ -194,7 +194,7 @@ ol.interaction.Modify = function(options) { * @type {Array} * @private */ - this.dragSegments_ = null; + this.dragSegments_ = []; /** * Draw overlay where sketch features are drawn. From 8f96251618ce57250b9e64de140f1cd05228b1c9 Mon Sep 17 00:00:00 2001 From: Mattias Josefsson Date: Tue, 26 Apr 2016 10:34:55 +0200 Subject: [PATCH 2/2] Added wanted change for issue #5145 --- src/ol/interaction/modifyinteraction.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ol/interaction/modifyinteraction.js b/src/ol/interaction/modifyinteraction.js index 6c8be757f4..317ed58150 100644 --- a/src/ol/interaction/modifyinteraction.js +++ b/src/ol/interaction/modifyinteraction.js @@ -547,7 +547,7 @@ ol.interaction.Modify.compareIndexes_ = function(a, b) { */ ol.interaction.Modify.handleDownEvent_ = function(evt) { this.handlePointerAtPixel_(evt.pixel, evt.map); - this.dragSegments_ = []; + this.dragSegments_.length = 0; this.modified_ = false; var vertexFeature = this.vertexFeature_; if (vertexFeature) {