OpenLayers OpenLayers

Ticket #578: toolbar.patch

File toolbar.patch, 0.8 kB (added by euzuro, 2 years ago)

add a destroy() function that cycles through the kept references to the buttons and kills their circular refs

  • lib/OpenLayers/Control/MouseToolbar.js

    old new  
    5757 
    5858        return this.div; 
    5959    }, 
     60 
     61    /** 
     62     *  
     63     */ 
     64    destroy: function() { 
     65        for( var btnId in this.buttons) { 
     66            var btn = this.buttons[btnId]; 
     67            btn.map = null; 
     68            btn.events.destroy(); 
     69        } 
     70        OpenLayers.Control.MouseDefaults.prototype.destroy.apply(this,  
     71                                                                 arguments); 
     72    }, 
    6073     
    6174    _addButton:function(id, img, activeImg, xy, sz, title) { 
    6275        var imgLocation = OpenLayers.Util.getImagesLocation() + img;