Merge pull request #843 from ahocevar/early-loadend
Safeguard against listeners that recreate the grid. r=@bartvde
This commit is contained in:
@@ -1104,8 +1104,6 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
|
|||||||
}
|
}
|
||||||
//if that was the last tile, then trigger a 'loadend' on the layer
|
//if that was the last tile, then trigger a 'loadend' on the layer
|
||||||
if (this.numLoadingTiles === 0) {
|
if (this.numLoadingTiles === 0) {
|
||||||
this.loading = false;
|
|
||||||
this.events.triggerEvent("loadend");
|
|
||||||
if(this.backBuffer) {
|
if(this.backBuffer) {
|
||||||
this._transitionElement = tile.imgDiv;
|
this._transitionElement = tile.imgDiv;
|
||||||
for (var i=this.transitionendEvents.length-1; i>=0; --i) {
|
for (var i=this.transitionendEvents.length-1; i>=0; --i) {
|
||||||
@@ -1119,6 +1117,8 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
|
|||||||
this._removeBackBuffer, this.removeBackBufferDelay
|
this._removeBackBuffer, this.removeBackBufferDelay
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
this.loading = false;
|
||||||
|
this.events.triggerEvent("loadend");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user