Revert "Merge pull request #304 from mpriour/singleTile"

This reverts commit 84fb15e1d2, reversing
changes made to d0d116efdf.
This commit is contained in:
ahocevar
2012-03-21 10:05:22 +01:00
parent 0feefaa4bc
commit 5e9104a2a2
2 changed files with 9 additions and 81 deletions
+2 -23
View File
@@ -792,36 +792,15 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
//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 - (tileWidth/2),
center.lat - (tileHeight/2),
center.lon + (tileWidth/2),
center.lat + (tileHeight/2));
// adjust tile bounds so they do not exceed maxExtent, except when the
// layer's maxExtent equals the world bounds or displayOutsideMaxExtent
// is set to true
var ignoreMaxExtent =
(this.map.baseLayer.wrapDateLine &&
this.maxExtent.equals(this.map.getMaxExtent())) ||
this.displayOutsideMaxExtent;
if(!ignoreMaxExtent) {
tileBounds.bottom = Math.max(this.maxExtent.bottom, tileBounds.bottom);
tileBounds.top = Math.min(this.maxExtent.top, tileBounds.top);
tileBounds.left = Math.max(this.maxExtent.left, tileBounds.left);
tileBounds.right = Math.min(this.maxExtent.right, tileBounds.right);
tileWidth = tileBounds.getWidth();
tileHeight = tileBounds.getHeight();
}
var resolution = this.map.getResolution(),
size = this.tileSize;
size.w = (tileWidth / resolution) | 0;
size.h = (tileHeight / resolution) | 0;
var px = this.map.getLayerPxFromLonLat({
lon: tileBounds.left,
lat: tileBounds.top