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