Revert "Merge pull request #304 from mpriour/singleTile"
This reverts commit84fb15e1d2, reversing changes made tod0d116efdf.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user