From 2e6c9bfdc290724c1a6f09025c4b3ab15214bc05 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Thu, 29 Sep 2011 13:53:32 -0600 Subject: [PATCH] Remove action that is now covered by wrapDateLine. With the changes in wrapDateLine, we don't have to shift the bounds here any more. --- lib/OpenLayers/Layer/Grid.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/OpenLayers/Layer/Grid.js b/lib/OpenLayers/Layer/Grid.js index 696d6e92cf..56d5cfb8e4 100644 --- a/lib/OpenLayers/Layer/Grid.js +++ b/lib/OpenLayers/Layer/Grid.js @@ -404,15 +404,9 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { */ calculateGridLayout: function(bounds, origin, resolution) { bounds = bounds.clone(); - if (this.map.baseLayer.wrapDateLine) { - var maxExtent = this.map.getMaxExtent(), - width = maxExtent.getWidth(); - // move the bounds one world width to the right until the origin is - // within the world extent - while (bounds.left < maxExtent.left) { - bounds.left += width; - bounds.right += width; - } + var map = this.map; + if (map.wrapDateLine) { + bounds = bounds.wrapDateLine(map.getMaxExtent()); } var tilelon = resolution * this.tileSize.w;