OpenLayers OpenLayers

Changeset 1705

Show
Ignore:
Timestamp:
10/18/06 15:12:31 (2 years ago)
Author:
euzuro
Message:

allow specification of untiled tile ratio. patch for #355 from crschmidt

Files:

Legend:

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

    r1695 r1705  
    2323                     }, 
    2424    reproject: true, 
     25 
     26    /** the ratio of image/tile size to map size (this is the untiled buffer) 
     27     * @type int */ 
     28    ratio: 2, 
    2529 
    2630    /** @type OpenLayers.Tile.Image */ 
     
    126130            //determine new tile bounds 
    127131            var center = bounds.getCenterLonLat(); 
     132            var tileWidth = bounds.getWidth() * this.ratio; 
     133            var tileHeight = bounds.getHeight() * this.ratio; 
    128134            var tileBounds =  
    129                 new OpenLayers.Bounds(center.lon - bounds.getWidth(), 
    130                                       center.lat - bounds.getHeight(), 
    131                                       center.lon + bounds.getWidth(), 
    132                                       center.lat + bounds.getHeight()); 
     135                new OpenLayers.Bounds(center.lon - (tileWidth / 2), 
     136                                      center.lat - (tileHeight / 2), 
     137                                      center.lon + (tileWidth / 2), 
     138                                      center.lat + (tileHeight / 2)); 
    133139 
    134140            //determine new tile size 
    135141            var tileSize = this.map.getSize(); 
    136             tileSize.w = tileSize.w * 2
    137             tileSize.h = tileSize.h * 2
     142            tileSize.w = tileSize.w * this.ratio
     143            tileSize.h = tileSize.h * this.ratio
    138144 
    139145            //formulate request url string 
     
    157163    getURL: function(bounds) { 
    158164        var tileSize = this.map.getSize(); 
    159         tileSize.w = tileSize.w * 2
    160         tileSize.h = tileSize.h * 2
     165        tileSize.w = tileSize.w * this.ratio
     166        tileSize.h = tileSize.h * this.ratio
    161167        return this.getFullRequestString( {'BBOX': bounds.toBBOX(), 
    162168                                                  'WIDTH': tileSize.w,