Fix conditional.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@594 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2006-06-15 17:02:27 +00:00
parent 747573cfad
commit 082133730e

View File

@@ -63,31 +63,34 @@ OpenLayers.Layer.Grid.prototype = Object.extend( new OpenLayers.Layer(), {
}
return;
}
var gridBounds = this.getGridBounds();
if (!this.grid || zoomChanged) {
this._initTiles();
} else if ( bounds.top > this.getGridBounds().bottom ||
bounds.left > this.getGridBounds().right ||
bounds.right < this.getGridBounds().left ||
bounds.bottom < this.getGridBounds().top ) {
} else if ( bounds.top < gridBounds.bottom ||
bounds.left > gridBounds.right ||
bounds.right < gridBounds.left ||
bounds.bottom > gridBounds.top ) {
console.log("else if");
this._initTiles();
} else {
var i = 0;
while (this.getGridBounds().bottom > bounds.bottom) {
while (gridBounds.bottom > bounds.bottom) {
this.insertRow(false);
}
while (this.getGridBounds().left > bounds.left) {
while (gridBounds.left > bounds.left) {
this.insertColumn(true);
}
while (this.getGridBounds().top < bounds.top) {
while (gridBounds.top < bounds.top) {
this.insertRow(true);
}
while (this.getGridBounds().right < bounds.right) {
while (gridBounds.right < bounds.right) {
this.insertColumn(false);
}
}
},
getGridBounds:function() {
if (!this.grid) return null;
var topLeftTile = this.grid[0][0];
var bottomRightTile = this.grid[this.grid.length-1][this.grid[0].length-1];
return new OpenLayers.Bounds(topLeftTile.bounds.left,