work-in-progress - committing to switch to other work

This commit is contained in:
Jon Atkins
2013-08-27 21:04:28 +01:00
parent 81d0cb0ed8
commit 571a17d84b
6 changed files with 101 additions and 74 deletions

View File

@ -69,6 +69,12 @@ window.MapDataRequest.prototype.clearQueue = function() {
}
window.MapDataRequest.prototype.getStatus = function() {
return { short: 'blah', long: 'blah blah blah' };
};
window.MapDataRequest.prototype.refresh = function() {
this.cache.expire();
@ -78,19 +84,21 @@ window.MapDataRequest.prototype.refresh = function() {
// a 'set' to keep track of hard failures for tiles
this.tileErrorCount = {};
// fill tileBounds with the data needed to request each tile
this.tileBounds = {};
var bounds = clampLatLngBounds(map.getBounds());
var zoom = getPortalDataZoom();
var minPortalLevel = getMinPortalLevelForZoom(zoom);
window.runHooks ('mapDataRefreshStart', {bounds: bounds, zoom: zoom});
this.render.startRenderPass(bounds);
this.render.clearPortalsBelowLevel(minPortalLevel);
console.log('requesting data tiles at zoom '+zoom+' (L'+minPortalLevel+'+ portals), map zoom is '+map.getZoom());
// fill tileBounds with the data needed to request each tile
this.tileBounds = {};
var x1 = lngToTile(bounds.getWest(), zoom);
var x2 = lngToTile(bounds.getEast(), zoom);
@ -143,6 +151,8 @@ window.MapDataRequest.prototype.processRequestQueue = function(isFirstPass) {
console.log("finished requesting data!");
window.runHooks ('mapDataRefreshEnd', {});
if (!window.isIdle()) {
this.refreshOnTimeout(this.REFRESH);
} else {