When moving by long distances (whole screenfuls) via API setCenter calls, reinitialize the grid. This solves an 'infinite loop' like problem where if you jumped by a long way, where addColumn/addRow were simply looping for so long that the browser went unresponsive/broken. Fixes issue reported by NickH on users list as well.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@593 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2006-06-15 16:37:15 +00:00
parent 25ecdae9c2
commit 747573cfad

View File

@@ -65,7 +65,13 @@ OpenLayers.Layer.Grid.prototype = Object.extend( new OpenLayers.Layer(), {
}
if (!this.grid || zoomChanged) {
this._initTiles();
} else {
} else if ( bounds.top > this.getGridBounds().bottom ||
bounds.left > this.getGridBounds().right ||
bounds.right < this.getGridBounds().left ||
bounds.bottom < this.getGridBounds().top ) {
this._initTiles();
} else {
var i = 0;
while (this.getGridBounds().bottom > bounds.bottom) {
this.insertRow(false);