OpenLayers OpenLayers

Changeset 2865

Show
Ignore:
Timestamp:
03/23/07 03:26:42 (2 years ago)
Author:
emanuel
Message:

zoomIn tile size max 32768px; 16bit problem with win and macos

Files:

Legend:

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

    r2846 r2865  
    718718        //reposition and resize the tile  
    719719        if (tile) { 
    720             // set real start position of centerTile 
    721             var startPosX = (tile.position.x + 
    722               parseInt(this.map.layerContainerDiv.style.left)); 
    723             // set new left position 
    724             var leftOffset = newTileSize.w / tile.size.w 
    725               * (centerPx.x - startPosX); 
    726             leftOffset = Math.round(leftOffset); 
    727             var newLeftPos = centerPx.x - leftOffset 
    728               - parseInt(this.map.layerContainerDiv.style.left); 
    729             tile.imgDiv.style.left = Math.round(newLeftPos) + "px"; 
    730  
    731             // set real start position of centerTile 
    732             var startPosY = (tile.position.y + 
    733               parseInt(this.map.layerContainerDiv.style.top)); 
    734             //set new top position 
    735             var topOffset = newTileSize.h / tile.size.h 
    736               * (centerPx.y - startPosY); 
    737             topOffset = Math.round(topOffset); 
    738             var newTopPos = centerPx.y - topOffset  
    739               - parseInt(this.map.layerContainerDiv.style.top); 
    740             tile.imgDiv.style.top = Math.round(newTopPos) + "px"; 
    741  
    742              //set new width and height 
    743             tile.imgDiv.style.width = Math.round(newTileSize.w) + "px"; 
    744             tile.imgDiv.style.height = Math.round(newTileSize.h) + "px"; 
    745              
     720            if ((newTileSize.w < Math.pow(2,15)) && 
     721                (newTileSize.h < Math.pow(2,15)) ){ 
     722 
     723                // set real start position of centerTile 
     724                var startPosX = (tile.position.x + 
     725                  parseInt(this.map.layerContainerDiv.style.left)); 
     726                // set new left position 
     727                var leftOffset = newTileSize.w / tile.size.w 
     728                  * (centerPx.x - startPosX); 
     729                leftOffset = Math.round(leftOffset); 
     730                var newLeftPos = centerPx.x - leftOffset 
     731                  - parseInt(this.map.layerContainerDiv.style.left); 
     732                tile.imgDiv.style.left = Math.round(newLeftPos) + "px"; 
     733 
     734                // set real start position of centerTile 
     735                var startPosY = (tile.position.y + 
     736                  parseInt(this.map.layerContainerDiv.style.top)); 
     737                //set new top position 
     738                var topOffset = newTileSize.h / tile.size.h 
     739                  * (centerPx.y - startPosY); 
     740                topOffset = Math.round(topOffset); 
     741                var newTopPos = centerPx.y - topOffset  
     742                  - parseInt(this.map.layerContainerDiv.style.top); 
     743                tile.imgDiv.style.top = Math.round(newTopPos) + "px"; 
     744 
     745                //set new width and height 
     746                tile.imgDiv.style.width = Math.round(newTileSize.w) + "px"; 
     747                tile.imgDiv.style.height = Math.round(newTileSize.h) + "px"; 
     748            } 
    746749            return true; 
    747750        } 
  • sandbox/emanuel/animatedZooming/lib/OpenLayers/Layer/Grid.js

    r2827 r2865  
    618618                var tile = layerGrid[iRow][iCol]; 
    619619                if (tile.imgDiv) { 
    620                     // scale all (visible) tiles within the viewport 
    621                     if (extent.containsBounds(tile.bounds,true, false)) { 
    622                         //define the factors for rows and columns 
    623                         //(relates to the center tile) 
    624                         var deltaRow = iRow - this.centerRow; 
    625                         var deltaCol = iCol - this.centerCol; 
    626                          
    627                         //set new left position 
    628                         var newLeftPos = parseInt(centerTile.imgDiv.style.left) 
    629                           + deltaCol * newTileSize.w ; 
    630                         tile.imgDiv.style.left = Math.round(newLeftPos) + "px"; 
    631  
    632                         //set new top position 
    633                         var newTopPos = parseInt(centerTile.imgDiv.style.top) 
    634                           + deltaRow * newTileSize.h ; 
    635                         tile.imgDiv.style.top = Math.round(newTopPos) + "px"; 
    636  
    637                         //set new width and height 
    638                         tile.imgDiv.style.width = Math.round(newTileSize.w) + "px"; 
    639                         tile.imgDiv.style.height = Math.round(newTileSize.h) + "px"; 
     620                    if ((newTileSize.w < Math.pow(2,15)) && 
     621                        (newTileSize.h < Math.pow(2,15)) ){ 
     622 
     623                        // scale all (visible) tiles within the viewport 
     624                        if (extent.containsBounds(tile.bounds,true, false)) { 
     625                            //define the factors for rows and columns 
     626                            //(relates to the center tile) 
     627                            var deltaRow = iRow - this.centerRow; 
     628                            var deltaCol = iCol - this.centerCol; 
     629                             
     630                            //set new left position 
     631                            var newLeftPos = parseInt(centerTile.imgDiv.style.left) 
     632                              + deltaCol * newTileSize.w ; 
     633                            tile.imgDiv.style.left = Math.round(newLeftPos) + "px"; 
     634 
     635                            //set new top position 
     636                            var newTopPos = parseInt(centerTile.imgDiv.style.top) 
     637                              + deltaRow * newTileSize.h ; 
     638                            tile.imgDiv.style.top = Math.round(newTopPos) + "px"; 
     639 
     640                            //set new width and height 
     641                            tile.imgDiv.style.width = Math.round(newTileSize.w) + "px"; 
     642                            tile.imgDiv.style.height = Math.round(newTileSize.h) + "px"; 
     643                        } 
    640644                    } 
    641645                }