Merge pull request #322 from ahocevar/322

WMS loadend event does not always fire
This commit is contained in:
ahocevar
2012-03-16 00:48:29 -07:00
2 changed files with 74 additions and 1 deletions

View File

@@ -1061,7 +1061,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
this.numLoadingTiles--;
this.events.triggerEvent("tileloaded", {tile: tile});
//if that was the last tile, then trigger a 'loadend' on the layer
if (this.tileQueue.length === 0 && this.numLoadingTiles === 0) {
if (this.numLoadingTiles === 0) {
this.events.triggerEvent("loadend");
if(this.backBuffer) {
// the removal of the back buffer is delayed to prevent flash