OpenLayers OpenLayers

Changeset 2218

Show
Ignore:
Timestamp:
02/09/07 17:35:21 (2 years ago)
Author:
emanuel
Message:

zoomOutTile bug

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/emanuel/animatedZooming/lib/OpenLayers/Layer/Grid.js

    r2214 r2218  
    3939    zoomOutTile: null, 
    4040 
    41     layerClone: null, 
    4241     
    4342 
     
    5453                                                                arguments); 
    5554        this.grid = new Array(); 
    56         this.layerClone = new Array(); 
    5755    }, 
    5856 
     
    209207                var layerGrid = this.map.layers[i].grid; 
    210208                 
    211                 this.layerClone[i] = this.map.layers[i].clone(); 
    212209                // go through the whole grid of every layer 
    213210                for (var iRow=0; iRow < layerGrid.length; iRow++) { 
     
    217214                            // if tile outside the viewport, set it 
    218215                            // invisible  
    219                             if (extent.containsBounds(tile.bounds,true, false)) { 
    220                                 tile.imgDiv.style.display = "block"; 
     216                            if (!extent.containsBounds(tile.bounds,true, false)) { 
     217                                tile.imgDiv.style.display = "none"; 
    221218                            } 
    222219                        } 
     
    270267                        var tile = layerGrid[iRow][iCol]; 
    271268                        if (tile.imgDiv) { 
    272                             if (tile.imgDiv.style.display == "block") { 
     269                            if (tile.imgDiv.style.display != "none") { 
    273270                                //define the factors for rows and columns 
    274271                                //(relates to the center tile) 
     
    389386            this.zoomOutTile.imgDiv.style.left = centerPx.x + offsetx;   
    390387            this.zoomOutTile.imgDiv.style.top = centerPx.y + offsety; 
     388             
     389            // set zoomOutTile visible if viewport < map bounds 
     390            if ( (bounds.left < extent.left) || (bounds.right > extent.right) )             
     391                this.map.baseLayer.zoomOutTile.imgDiv.style.display = "block"; 
     392            else 
     393                this.map.baseLayer.zoomOutTile.imgDiv.style.display = "none"; 
    391394        } 
    392395    },