OpenLayers OpenLayers

Ticket #591: panzoomMemory.patch

File panzoomMemory.patch, 1.1 kB (added by euzuro, 2 years ago)

as we cycle through, call stopObservingElement() as well as setting map to null. moved destroy() from bottom of file (?) to right below initialize

  • lib/OpenLayers/Control/PanZoom.js

    old new  
    3333    }, 
    3434 
    3535    /** 
     36     *  
     37     */ 
     38    destroy: function() { 
     39        OpenLayers.Control.prototype.destroy.apply(this, arguments); 
     40        while(this.buttons.length) { 
     41            var btn = this.buttons.shift(); 
     42            btn.map = null; 
     43            OpenLayers.Event.stopObservingElement(btn); 
     44        } 
     45        this.buttons = null; 
     46        this.position = null; 
     47    }, 
     48 
     49    /** 
    3650    * @param {OpenLayers.Pixel} px 
    3751    *  
    3852    * @returns A reference to the container div for the PanZoom control 
     
    142156        OpenLayers.Event.stop(evt); 
    143157    }, 
    144158 
    145     /** 
    146      *  
    147      */ 
    148     destroy: function() { 
    149         OpenLayers.Control.prototype.destroy.apply(this, arguments); 
    150         for(i=0; i<this.buttons.length; i++) { 
    151             this.buttons[i].map = null; 
    152         } 
    153     }, 
    154      
    155159    /** @final @type String */ 
    156160    CLASS_NAME: "OpenLayers.Control.PanZoom" 
    157161});