OpenLayers OpenLayers

Changeset 2915

Show
Ignore:
Timestamp:
03/28/07 18:26:03 (2 years ago)
Author:
sderle
Message:

Reset element.offsets in Map and Control.PanZoomBar every time movement is
initiated. Also, reset element.offsets every time map.updateSize() is called.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Control/PanZoomBar.js

    r1721 r2915  
    168168        this.zoomStart = evt.xy.clone(); 
    169169        this.div.style.cursor = "move"; 
     170        // reset the div offsets just in case the div moved 
     171        this.zoomBarDiv.offsets = null;  
    170172        OpenLayers.Event.stop(evt); 
    171173    }, 
  • trunk/openlayers/lib/OpenLayers/Map.js

    r2875 r2915  
    180180 
    181181        this.events = new OpenLayers.Events(this, div, this.EVENT_TYPES, this.fallThrough); 
    182  
    183182        this.updateSize(); 
    184183  
    185     // Because Mozilla does not support the "resize" event for elements other 
    186     //  than "window", we need to put a hack here.  
    187     //  
     184        // update the map size and location before the map moves 
     185        this.events.register("movestart", this, this.updateSize); 
     186 
     187        // Because Mozilla does not support the "resize" event for elements other 
     188        // than "window", we need to put a hack here.  
    188189        if (navigator.appName.contains("Microsoft")) { 
    189190            // If IE, register the resize on the div 
     
    634635    */ 
    635636    updateSize: function() { 
     637        // the div might have moved on the page, also 
     638        this.events.element.offsets = null; 
    636639        var newSize = this.getCurrentSize(); 
    637640        var oldSize = this.getSize(); 
     
    647650                this.layers[i].onMapResize();                 
    648651            } 
    649              
    650             // the div might have moved on the page, also 
    651             this.events.element.offsets = null; 
    652652 
    653653            if (this.baseLayer != null) {