Making loaded tile available to tileloaded listeners.
This commit is contained in:
@@ -199,7 +199,9 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
|
||||
* tileloaded - Triggered when each new tile is
|
||||
* loaded, as a means of progress update to listeners.
|
||||
* listeners can access 'numLoadingTiles' if they wish to keep
|
||||
* track of the loading progress.
|
||||
* track of the loading progress. Listeners are called with an object
|
||||
* with a tile property as first argument, making the loded tile
|
||||
* available to the listener.
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -971,7 +973,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
|
||||
|
||||
tile.onLoadEnd = function() {
|
||||
this.numLoadingTiles--;
|
||||
this.events.triggerEvent("tileloaded");
|
||||
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) {
|
||||
this.events.triggerEvent("loadend");
|
||||
|
||||
Reference in New Issue
Block a user