only change bounds when wrapDateLine is true; remove unused variable

This commit is contained in:
ahocevar
2011-09-27 07:37:08 -06:00
parent 6925ac0ab1
commit 61a3c2a072
4 changed files with 117 additions and 7 deletions

View File

@@ -403,6 +403,16 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
* tileoffsetlat, tileoffsetx, tileoffsety
*/
calculateGridLayout: function(bounds, origin, resolution) {
bounds = bounds.clone();
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 tilelon = resolution * this.tileSize.w;
var tilelat = resolution * this.tileSize.h;