diff --git a/lib/OpenLayers/Layer/Grid.js b/lib/OpenLayers/Layer/Grid.js index f72251a933..2221362be9 100644 --- a/lib/OpenLayers/Layer/Grid.js +++ b/lib/OpenLayers/Layer/Grid.js @@ -132,16 +132,16 @@ OpenLayers.Layer.Grid.prototype = */ getGridBounds:function() { - var topLeftTile = this.grid[0][0]; - var bottom = this.grid.length - 1; - var right = this.grid[0].length - 1; - var bottomRightTile = this.grid[bottom][right]; + var bottomLeftTile = this.grid[bottom][0]; - return new OpenLayers.Bounds(topLeftTile.bounds.left, - bottomRightTile.bounds.bottom, - bottomRightTile.bounds.right, - topLeftTile.bounds.top); + var right = this.grid[0].length - 1; + var topRightTile = this.grid[0][right]; + + return new OpenLayers.Bounds(bottomLeftTile.bounds.left, + bottomLeftTile.bounds.bottom, + topRightTile.bounds.right, + topRightTile.bounds.top); }, /**