OpenLayers OpenLayers

Ticket #1332: Point.js.patch

File Point.js.patch, 1.2 kB (added by sbenthall, 1 year ago)

Patch to Handler.Point

  • Point.js

    old new  
    151151     * Finish the geometry and call the "done" callback. 
    152152     */ 
    153153    finalize: function() { 
    154         this.layer.renderer.clear(); 
    155         this.drawing = false; 
    156         this.mouseDown = false; 
    157         this.lastDown = null; 
    158         this.lastUp = null; 
    159         this.callback("done", [this.geometryClone()]); 
    160         this.destroyFeature(); 
     154        this.cleanup("done"); 
    161155    }, 
    162156 
    163157    /** 
     
    165159     * Finish the geometry and call the "cancel" callback. 
    166160     */ 
    167161    cancel: function() { 
    168         this.layer.renderer.clear(); 
    169         this.drawing = false; 
     162        this.cleanup("cancel"); 
     163    }, 
     164     
     165    cleanup: function(callback) { 
     166        this.layer.eraseFeatures(this.point); 
    170167        this.mouseDown = false; 
    171168        this.lastDown = null; 
    172169        this.lastUp = null; 
    173         this.callback("cancel", [this.geometryClone()]); 
     170        this.callback(callback, [this.geometryClone()]); 
    174171        this.destroyFeature(); 
    175172    },