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:
@@ -65,6 +65,12 @@ OpenLayers.Layer.Grid.prototype = Object.extend( new OpenLayers.Layer(), {
|
|||||||
}
|
}
|
||||||
if (!this.grid || zoomChanged) {
|
if (!this.grid || zoomChanged) {
|
||||||
this._initTiles();
|
this._initTiles();
|
||||||
|
} 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 {
|
} else {
|
||||||
var i = 0;
|
var i = 0;
|
||||||
while (this.getGridBounds().bottom > bounds.bottom) {
|
while (this.getGridBounds().bottom > bounds.bottom) {
|
||||||
|
|||||||
Reference in New Issue
Block a user