From c2b567f053c08e1c7d353b4b8dfbb931fd0373bc Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Sat, 15 Jun 2013 19:11:47 +0100 Subject: [PATCH] data tile cache: send ajax requests before processing cached data --- code/map_data.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/code/map_data.js b/code/map_data.js index 95ee3b08..18d59d85 100644 --- a/code/map_data.js +++ b/code/map_data.js @@ -114,17 +114,18 @@ window.requestData = function() { // Reset previous result of Portal Render Limit handler portalRenderLimit.init(); - // process the requests from the cache - console.log('got '+Object.keys(cachedData.result.map).length+' data tiles from cache'); - handleDataResponse(cachedData, true); - - // finally send ajax requests + // send ajax requests console.log('requesting '+requestTileCount+' tiles in '+Object.keys(tiles).length+' requests'); $.each(tiles, function(ind, tls) { data = { zoom: z }; data.boundsParamsList = tls; window.requests.add(window.postAjax('getThinnedEntitiesV2', data, function(data, textStatus, jqXHR) { window.handleDataResponse(data,false); }, window.handleFailedRequest)); }); + + // process the requests from the cache + console.log('got '+Object.keys(cachedData.result.map).length+' data tiles from cache'); + handleDataResponse(cachedData, true); + } // Handle failed map data request