From 153b7a2a786016563a2d64418ccac0b1e48f21d4 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Tue, 28 Aug 2007 16:34:53 +0000 Subject: [PATCH] Properly destroy features in the polygon handler. Many thanks to fredj who has caubht these issues, provided clear patches, and written solid tests. More please. (Closes #934) git-svn-id: http://svn.openlayers.org/trunk/openlayers@4076 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Handler/Polygon.js | 3 ++- tests/list-tests.html | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/OpenLayers/Handler/Polygon.js b/lib/OpenLayers/Handler/Polygon.js index e59c16b884..a3374af8f4 100644 --- a/lib/OpenLayers/Handler/Polygon.js +++ b/lib/OpenLayers/Handler/Polygon.js @@ -64,8 +64,9 @@ OpenLayers.Handler.Polygon = OpenLayers.Class(OpenLayers.Handler.Path, { * Destroy temporary geometries */ destroyFeature: function() { + OpenLayers.Handler.Path.prototype.destroyFeature.apply(this); this.polygon.destroy(); - this.point.destroy(); + this.polygon = null; }, /** diff --git a/tests/list-tests.html b/tests/list-tests.html index 66271b60eb..4f436c99bd 100644 --- a/tests/list-tests.html +++ b/tests/list-tests.html @@ -75,5 +75,6 @@
  • Handler/test_Drag.html
  • Handler/test_Point.html
  • Handler/test_Path.html
  • +
  • Handler/test_Polygon.html
  • test_Map.html