Rollback patch from #1332, which broke feature creation.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@6163 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2008-02-09 04:23:54 +00:00
parent eb5307608a
commit 9bfd829512

View File

@@ -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();
},