OpenLayers OpenLayers

Changeset 7300

Show
Ignore:
Timestamp:
05/31/08 13:19:48 (3 months ago)
Author:
crschmidt
Message:

Fix for GMaps layers to display in correct position when they were originally
loaded as the not default layer, or the map is resized while the gmaps layer is
hidden. Patch put together by Edgemaster (thanks), (Closes #830)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Layer/Google.js

    r6492 r7300  
    190190     */ 
    191191    onMapResize: function() { 
    192         this.mapObject.checkResize();   
     192        if(this.visibility) { 
     193            this.mapObject.checkResize();   
     194        } else { 
     195            this.windowResized = true; 
     196        } 
     197    }, 
     198     
     199    /** 
     200     * Method: display 
     201     * Hide or show the layer 
     202     * 
     203     * Parameters: 
     204     * display - {Boolean} 
     205     */ 
     206    display: function(display) { 
     207        OpenLayers.Layer.EventPane.prototype.display.apply(this, arguments); 
     208        if(this.div.style.display == "block" && this.windowResized) { 
     209            this.mapObject.checkResize(); 
     210            this.windowResized = false; 
     211        } 
    193212    }, 
    194213