diff --git a/lib/OpenLayers/Layer/Grid.js b/lib/OpenLayers/Layer/Grid.js index adf516364f..4af8ec8423 100644 --- a/lib/OpenLayers/Layer/Grid.js +++ b/lib/OpenLayers/Layer/Grid.js @@ -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 diff --git a/tests/manual/loadend.html b/tests/manual/loadend.html new file mode 100644 index 0000000000..0536b75d3e --- /dev/null +++ b/tests/manual/loadend.html @@ -0,0 +1,73 @@ + + +
+ + + + + + + + + ++ Shows the loadstart and loadend events of a WMS layer +
+ + + ++ This example is helpful in testing whether all loadstart events are followed + by a loadend event. + Test by using scroll-wheel up and down. +
+