From 140c5c2cb91c3adde8c8da505e6ea83c3f473ae6 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Wed, 22 May 2013 17:35:59 +0100 Subject: [PATCH] re-do request bucket handling - instead of grouping up to four requests together, so large window sizes make more requests, group requests into max 4 blocks I think this is closer to the stock intel site behaviour, and should vastly reduce requests, especially at high resolutions --- code/map_data.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/map_data.js b/code/map_data.js index 10372b77..1edd99bc 100644 --- a/code/map_data.js +++ b/code/map_data.js @@ -29,7 +29,7 @@ window.requestData = function() { for (var x = x1; x <= x2; x++) { for (var y = y1; y <= y2; y++) { var tile_id = pointToTileId(z, x, y); - var bucket = Math.floor(x / 2) + "" + Math.floor(y / 2); + var bucket = (x % 2) + ":" + (y % 2); if (!tiles[bucket]) tiles[bucket] = []; tiles[bucket].push(generateBoundsParams( @@ -44,6 +44,7 @@ window.requestData = function() { // Reset previous result of Portal Render Limit handler portalRenderLimit.init(); + // finally send ajax requests $.each(tiles, function(ind, tls) { data = { zoom: z };