status message updates for new loading code
This commit is contained in:
parent
96d3e1ded7
commit
8918b9da6f
@ -167,7 +167,7 @@ window.MapDataRequest.prototype.refresh = function() {
|
|||||||
// data is fresh in the cache - just render it
|
// data is fresh in the cache - just render it
|
||||||
this.debugTiles.setState(tile_id, 'cache-fresh');
|
this.debugTiles.setState(tile_id, 'cache-fresh');
|
||||||
this.render.processTileData (this.cache.get(tile_id));
|
this.render.processTileData (this.cache.get(tile_id));
|
||||||
this.cachedTileCOunt += 1;
|
this.cachedTileCount += 1;
|
||||||
} else {
|
} else {
|
||||||
// no fresh data - queue a request
|
// no fresh data - queue a request
|
||||||
var boundsParams = generateBoundsParams(
|
var boundsParams = generateBoundsParams(
|
||||||
@ -209,14 +209,20 @@ window.MapDataRequest.prototype.processRequestQueue = function(isFirstPass) {
|
|||||||
|
|
||||||
window.runHooks ('mapDataRefreshEnd', {});
|
window.runHooks ('mapDataRefreshEnd', {});
|
||||||
|
|
||||||
|
var longStatus = 'Tiles: ' + this.cachedTileCount + ' cached, ' +
|
||||||
|
this.successTileCount + ' loaded, ' +
|
||||||
|
(this.staleTileCount ? this.staleTileCount + ' stale, ' : '') +
|
||||||
|
(this.failedTileCount ? this.failedTileCount + ' failed, ' : '') +
|
||||||
|
'in ' + duration + ' seconds';
|
||||||
|
|
||||||
if (!window.isIdle()) {
|
if (!window.isIdle()) {
|
||||||
// refresh timer based on time to run this pass, with a minimum of REFRESH seconds
|
// refresh timer based on time to run this pass, with a minimum of REFRESH seconds
|
||||||
var refreshTimer = Math.max(this.REFRESH, duration*this.FETCH_TO_REFRESH_FACTOR);
|
var refreshTimer = Math.max(this.REFRESH, duration*this.FETCH_TO_REFRESH_FACTOR);
|
||||||
this.refreshOnTimeout(refreshTimer);
|
this.refreshOnTimeout(refreshTimer);
|
||||||
this.setStatus ('done');
|
this.setStatus (this.failedTileCount ? 'errors' : this.staleTileCount ? 'out of date' : 'done', longStatus);
|
||||||
} else {
|
} else {
|
||||||
console.log("suspending map refresh - is idle");
|
console.log("suspending map refresh - is idle");
|
||||||
this.setStatus ('idle');
|
this.setStatus (this.failedTileCount ? 'errors' : this.staleTileCount ? 'out of date' : 'idle', longStatus);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -257,8 +263,8 @@ window.MapDataRequest.prototype.processRequestQueue = function(isFirstPass) {
|
|||||||
var pendingTileCount = this.requestedTileCount - (this.successTileCount+this.failedTileCount+this.staleTileCount);
|
var pendingTileCount = this.requestedTileCount - (this.successTileCount+this.failedTileCount+this.staleTileCount);
|
||||||
var longText = 'Tiles: ' + this.cachedTileCount + ' cached, ' +
|
var longText = 'Tiles: ' + this.cachedTileCount + ' cached, ' +
|
||||||
this.successTileCount + ' loaded, ' +
|
this.successTileCount + ' loaded, ' +
|
||||||
(this.staleTileCount ? this.staleTileCount + 'stale, ' : '') +
|
(this.staleTileCount ? this.staleTileCount + ' stale, ' : '') +
|
||||||
(this.failedTileCount ? this.failedTileCount + 'failed, ' : '') +
|
(this.failedTileCount ? this.failedTileCount + ' failed, ' : '') +
|
||||||
pendingTileCount + ' remaining';
|
pendingTileCount + ' remaining';
|
||||||
|
|
||||||
progress = this.requestedTileCount > 0 ? (this.requestedTileCount-pendingTileCount) / this.requestedTileCount : undefined;
|
progress = this.requestedTileCount > 0 ? (this.requestedTileCount-pendingTileCount) / this.requestedTileCount : undefined;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user