diff --git a/code/map_data.js b/code/map_data.js index b2a60a47..1216dae0 100644 --- a/code/map_data.js +++ b/code/map_data.js @@ -216,12 +216,12 @@ window.requestData = function() { return 0; }); - data = { zoom: z }; + data = { }; data.boundsParamsList = tls; // keep a list of tile_ids with each request. in the case of a server error, we can try and use cached tiles if available var tile_ids = [] $.each(tls,function(i,req) { tile_ids.push(req.qk); }); - window.requests.add(window.postAjax('getThinnedEntitiesV3', data, function(data, textStatus, jqXHR) { window.handleDataResponse(data,false,tile_ids); }, function() { window.handleFailedRequest(tile_ids); })); + window.requests.add(window.postAjax('getThinnedEntitiesV4', data, function(data, textStatus, jqXHR) { window.handleDataResponse(data,false,tile_ids); }, function() { window.handleFailedRequest(tile_ids); })); }); // process the requests from the cache @@ -255,7 +255,7 @@ window.handleFailedRequest = function(tile_ids) { handleDataResponse(cachedData, true); } - if(requests.isLastRequest('getThinnedEntitiesV3')) { + if(requests.isLastRequest('getThinnedEntitiesV4')) { var leftOverPortals = portalRenderLimit.mergeLowLevelPortals(null); handlePortalsRender(leftOverPortals); } diff --git a/code/map_data_calc_tools.js b/code/map_data_calc_tools.js index 33e444cb..8f845c5e 100644 --- a/code/map_data_calc_tools.js +++ b/code/map_data_calc_tools.js @@ -10,20 +10,20 @@ // http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames window.lngToTile = function(lng, zoom) { - return Math.floor((lng + 180) / 360 * Math.pow(2, zoom)); + return Math.floor((lng + 180) / 360 * Math.pow(2, (zoom>12)?zoom:(zoom+2))); } window.latToTile = function(lat, zoom) { return Math.floor((1 - Math.log(Math.tan(lat * Math.PI / 180) + - 1 / Math.cos(lat * Math.PI / 180)) / Math.PI) / 2 * Math.pow(2, zoom)); + 1 / Math.cos(lat * Math.PI / 180)) / Math.PI) / 2 * Math.pow(2, (zoom>12)?zoom:(zoom+2))); } window.tileToLng = function(x, zoom) { - return x / Math.pow(2, zoom) * 360 - 180; + return x / Math.pow(2, (zoom>12)?zoom:(zoom+2)) * 360 - 180; } window.tileToLat = function(y, zoom) { - var n = Math.PI - 2 * Math.PI * y / Math.pow(2, zoom); + var n = Math.PI - 2 * Math.PI * y / Math.pow(2, (zoom>12)?zoom:(zoom+2)); return 180 / Math.PI * Math.atan(0.5 * (Math.exp(n) - Math.exp(-n))); } diff --git a/code/portal_render_limit.js b/code/portal_render_limit.js index 299f28cf..cd1f4cb5 100644 --- a/code/portal_render_limit.js +++ b/code/portal_render_limit.js @@ -98,7 +98,7 @@ window.portalRenderLimit.splitOrMergeLowLevelPortals = function(originPortals) { portalRenderLimit.resetCounting(); portalRenderLimit.countingPortals(originPortals); - var resultPortals = requests.isLastRequest('getThinnedEntitiesV3') + var resultPortals = requests.isLastRequest('getThinnedEntitiesV4') ? portalRenderLimit.mergeLowLevelPortals(originPortals) : portalRenderLimit.splitLowLevelPortals(originPortals); diff --git a/code/request_handling.js b/code/request_handling.js index 90368909..722333b2 100644 --- a/code/request_handling.js +++ b/code/request_handling.js @@ -121,7 +121,14 @@ window.startRefreshTimeout = function(override) { } else { window.requests._quickRefreshPending = false; t = REFRESH*1000; - var adj = ZOOM_LEVEL_ADJ * (18 - window.map.getZoom()); + + // new getThinnedEntitiesV4 involves a LOT more requests when zoomed out above a data level of 13 + // so, to give the refresh a chance to complete (and also reduce load on niantic servers), boost the refresh interval + // in this case + // (TODO: complete rewrite of refresh+request handling. don't start timer until complete, and retry error=TIMEOUT requests) + if (getPortalDataZoom() <=12 ) t = t*4; + + var adj = ZOOM_LEVEL_ADJ * (18 - getPortalDataZoom()); if(adj > 0) t += adj*1000; } var next = new Date(new Date().getTime() + t).toLocaleTimeString(); diff --git a/main.js b/main.js index 1bdbda5c..d8149c34 100644 --- a/main.js +++ b/main.js @@ -1,7 +1,7 @@ // ==UserScript== // @id ingress-intel-total-conversion@jonatkins // @name IITC: Ingress intel map total conversion -// @version 0.13.2.@@DATETIMEVERSION@@ +// @version 0.13.3.@@DATETIMEVERSION@@ // @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @updateURL @@UPDATEURL@@ // @downloadURL @@DOWNLOADURL@@ @@ -117,8 +117,8 @@ L_PREFER_CANVAS = false; // CONFIG OPTIONS //////////////////////////////////////////////////// window.REFRESH = 60; // refresh view every 30s (base time) window.ZOOM_LEVEL_ADJ = 5; // add 5 seconds per zoom level -window.ON_MOVE_REFRESH = 1.25; //refresh time to use after a movement event -window.MINIMUM_OVERRIDE_REFRESH = 5; //limit on refresh time since previous refresh, limiting repeated move refresh rate +window.ON_MOVE_REFRESH = 2.5; //refresh time to use after a movement event +window.MINIMUM_OVERRIDE_REFRESH = 10; //limit on refresh time since previous refresh, limiting repeated move refresh rate window.REFRESH_GAME_SCORE = 15*60; // refresh game score every 15 minutes window.MAX_IDLE_TIME = 4*60; // stop updating map after 4min idling window.PRECACHE_PLAYER_NAMES_ZOOM = 17; // zoom level to start pre-resolving player names diff --git a/mobile/AndroidManifest.xml b/mobile/AndroidManifest.xml index a5af95cf..3b4838a1 100644 --- a/mobile/AndroidManifest.xml +++ b/mobile/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="37" + android:versionName="0.5.4.2"> 12 ? mapZoom + 1 : mapZoom; // limiting the mazimum zoom level for data retrieval reduces the number of requests at high zoom levels // (as all portal data is retrieved at z=17, why retrieve multiple z=18 tiles when fewer z=17 would do?) diff --git a/website/page/home.php b/website/page/home.php index 3a5c897b..de020dce 100644 --- a/website/page/home.php +++ b/website/page/home.php @@ -13,6 +13,12 @@ offers many more features. It is available for

Latest news

+

16th August 2013

+

+IITC 0.13.3 and IITC Mobile 0.5.4.2 have been released. This is another critical update required to work +with another change Niantic have made to the standard intel site. +

+

14th August 2013

IITC 0.13.2 and IITC Mobile 0.5.4.1 have been released. This is a critical release required to work with diff --git a/website/page/news.php b/website/page/news.php index 6ffd5252..77edbe72 100644 --- a/website/page/news.php +++ b/website/page/news.php @@ -1,5 +1,11 @@

News

+

16th August 2013

+

+IITC 0.13.3 and IITC Mobile 0.5.4.2 have been released. This is another critical update required to work +with another change Niantic have made to the standard intel site. +

+

14th August 2013

IITC 0.13.2 and IITC Mobile 0.5.4.1 have been released. This is a critical release required to work with