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

git-svn-id: http://svn.openlayers.org/trunk/openlayers@1705 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-10-18 19:12:31 +00:00
parent cb3af3eaba
commit 7eb3f4bb9a

View File

@@ -23,6 +23,10 @@ OpenLayers.Layer.WMS.Untiled.prototype =
},
reproject: true,
/** the ratio of image/tile size to map size (this is the untiled buffer)
* @type int */
ratio: 2,
/** @type OpenLayers.Tile.Image */
tile: null,
@@ -125,16 +129,18 @@ OpenLayers.Layer.WMS.Untiled.prototype =
//determine new tile bounds
var center = bounds.getCenterLonLat();
var tileWidth = bounds.getWidth() * this.ratio;
var tileHeight = bounds.getHeight() * this.ratio;
var tileBounds =
new OpenLayers.Bounds(center.lon - bounds.getWidth(),
center.lat - bounds.getHeight(),
center.lon + bounds.getWidth(),
center.lat + bounds.getHeight());
new OpenLayers.Bounds(center.lon - (tileWidth / 2),
center.lat - (tileHeight / 2),
center.lon + (tileWidth / 2),
center.lat + (tileHeight / 2));
//determine new tile size
var tileSize = this.map.getSize();
tileSize.w = tileSize.w * 2;
tileSize.h = tileSize.h * 2;
tileSize.w = tileSize.w * this.ratio;
tileSize.h = tileSize.h * this.ratio;
//formulate request url string
var url = this.getURL(tileBounds);
@@ -156,8 +162,8 @@ OpenLayers.Layer.WMS.Untiled.prototype =
getURL: function(bounds) {
var tileSize = this.map.getSize();
tileSize.w = tileSize.w * 2;
tileSize.h = tileSize.h * 2;
tileSize.w = tileSize.w * this.ratio;
tileSize.h = tileSize.h * this.ratio;
return this.getFullRequestString( {'BBOX': bounds.toBBOX(),
'WIDTH': tileSize.w,
'HEIGHT': tileSize.h} );