diff --git a/code/boot.js b/code/boot.js index d38a30b2..4aba2da4 100644 --- a/code/boot.js +++ b/code/boot.js @@ -232,13 +232,10 @@ window.setupMap = function() { localStorage['ingress.intelmap.type']=selInd; }); - // map update status handling - map.on('movestart zoomstart', function() { window.mapRunsUserAction = true }); - map.on('moveend zoomend', function() { window.mapRunsUserAction = false }); - - // update map hooks - map.on('movestart zoomstart', function() { window.requests.abort(); window.startRefreshTimeout(-1); }); - map.on('moveend zoomend', function() { window.startRefreshTimeout(ON_MOVE_REFRESH*1000) }); + // map update status handling & update map hooks + // ensures order of calls + map.on('movestart zoomstart', function() { window.mapRunsUserAction = true; window.requests.abort(); window.startRefreshTimeout(-1); }); + map.on('moveend zoomend', function() { window.mapRunsUserAction = false; window.startRefreshTimeout(ON_MOVE_REFRESH*1000); }); window.addResumeFunction(window.requestData); window.requests.addRefreshFunction(window.requestData); diff --git a/code/request_handling.js b/code/request_handling.js index 8b6c3ce7..37e11bad 100644 --- a/code/request_handling.js +++ b/code/request_handling.js @@ -39,17 +39,24 @@ window.requests.abort = function() { // to website. Updates info in layer chooser. window.renderUpdateStatus = function() { - var t = 'map status: '; - if(mapRunsUserAction) - t += 'paused during interaction'; - else if(isIdle()) - t += 'Idle, not updating.'; - else if(window.activeRequests.length > 0) - t += window.activeRequests.length + ' requests running.'; - else if(window.requests._quickRefreshPending) - t += 'refreshing...'; + var t = '