From 9bfd829512c292fb3d99b2d9f5d40fc9916207d3 Mon Sep 17 00:00:00 2001 From: crschmidt Date: Sat, 9 Feb 2008 04:23:54 +0000 Subject: [PATCH] Rollback patch from #1332, which broke feature creation. git-svn-id: http://svn.openlayers.org/trunk/openlayers@6163 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Handler/Point.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/OpenLayers/Handler/Point.js b/lib/OpenLayers/Handler/Point.js index c04ebcb4d0..79e67b28b8 100644 --- a/lib/OpenLayers/Handler/Point.js +++ b/lib/OpenLayers/Handler/Point.js @@ -151,7 +151,13 @@ OpenLayers.Handler.Point = OpenLayers.Class(OpenLayers.Handler, { * Finish the geometry and call the "done" callback. */ finalize: function() { - this.cleanup("done"); + this.layer.renderer.clear(); + this.drawing = false; + this.mouseDown = false; + this.lastDown = null; + this.lastUp = null; + this.callback("done", [this.geometryClone()]); + this.destroyFeature(); }, /** @@ -159,15 +165,12 @@ OpenLayers.Handler.Point = OpenLayers.Class(OpenLayers.Handler, { * Finish the geometry and call the "cancel" callback. */ cancel: function() { - this.cleanup("cancel"); - }, - - cleanup: function(callback) { - this.layer.eraseFeatures(this.point); + this.layer.renderer.clear(); + this.drawing = false; this.mouseDown = false; this.lastDown = null; this.lastUp = null; - this.callback(callback, [this.geometryClone()]); + this.callback("cancel", [this.geometryClone()]); this.destroyFeature(); },