count tiledImage._tilesLoading

This commit is contained in:
thejohnhoffer 2016-11-04 17:37:48 -04:00
parent e910e93dbf
commit 3eee34a0f2

View File

@ -146,6 +146,7 @@ $.TiledImage = function( options ) {
_midDraw: false, // Is the tiledImage currently updating the viewport?
_needsDraw: true, // Does the tiledImage need to update the viewport again?
_hasOpaqueTile: false, // Do we have even one fully opaque tile?
_tilesLoading: 0, // The number of pending tile requests.
//configurable settings
springStiffness: $.DEFAULT_SETTINGS.springStiffness,
animationTime: $.DEFAULT_SETTINGS.animationTime,
@ -898,6 +899,7 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag
// private
_updateViewport: function() {
this._needsDraw = false;
this._tilesLoading = 0;
// Reset tile's internal drawn state
while (this.lastDrawn.length > 0) {
@ -994,7 +996,7 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag
this._needsDraw = true;
this._setFullyLoaded(false);
} else {
this._setFullyLoaded(true);
this._setFullyLoaded(this._tilesLoading === 0);
}
}
});
@ -1178,7 +1180,7 @@ function updateTile( tiledImage, drawLevel, haveDrawn, x, y, level, levelOpacity
}
} else if ( tile.loading ) {
// the tile is already in the download queue
// thanks josh1093 for finally translating this typo
tiledImage._tilesLoading++;
} else {
best = compareTiles( best, tile );
}