add tweaks of data retrieval zoom level, to make better use of the cache and be friendlier to the API in some cases

also, default-intel-detail and show-more-portals plugins fixed - the logic has been moved into IITC core, with the plugins just setting flags to change behaviour
This commit is contained in:
Jon Atkins
2014-02-22 19:30:12 +00:00
parent 8ce28334cc
commit 333c1a6daf
5 changed files with 96 additions and 47 deletions

View File

@ -2,7 +2,7 @@
// @id iitc-plugin-default-intel-detail@jonatkins
// @name IITC plugin: Default intel detail level
// @category Tweaks
// @version 0.1.1.@@DATETIMEVERSION@@
// @version 0.2.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
@ -24,23 +24,9 @@ window.plugin.defaultIntelDetail = function() {};
window.plugin.defaultIntelDetail.setup = function() {
// var stockIntelDetail = nemesis.dashboard.zoomlevel.ZOOM_TO_LOD_;
//
// // save the original function - so we can chain to it for levels we don't modify
// var origGetMinPortalLevelForZoom = window.getMinPortalLevelForZoom;
//
// // replace the window.getMinPortalLevelForZoom function - modify behaviour when L1+ or L3+ portals are shown
//
// window.getMinPortalLevelForZoom = function(z) {
// // for the further out zoom levels, use the stock intel site detail levels
// if (z <= 11) {
// return stockIntelDetail[z];
// }
// // for the closer zoom levels, stock intel and IITC default is the same. falling back
// // in this case allows this plugin to work alongside show-more-portals
// return origGetMinPortalLevelForZoom(z);
// }
// NOTE: the logic required is closely tied to the IITC+stock map detail level code - so the logic is moved there now
// and just enabled by this flag
window.CONFIG_ZOOM_DEFAULT_DETAIL_LEVEL=true;
};

View File

@ -2,7 +2,7 @@
// @id iitc-plugin-show-more-portals@jonatkins
// @name IITC plugin: Show more portals
// @category Tweaks
// @version 0.1.7.@@DATETIMEVERSION@@
// @version 0.2.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
@ -24,27 +24,9 @@ window.plugin.showMorePortals = function() {};
window.plugin.showMorePortals.setup = function() {
// // save the original function - so we can chain to it for levels we don't modify
// var origGetMinPortalLevelForZoom = window.getMinPortalLevelForZoom;
//
// // replace the window.getMinPortalLevelForZoom function - modify behaviour when L1+ or L3+ portals are shown
//
// window.getMinPortalLevelForZoom = function(z) {
// var level = origGetMinPortalLevelForZoom(z);
//
// // as of 2013-10-16...
//
// // the stock site uses the same tile size for both L1+ portals and all portals
// // therefore, changing the L1+ zoom levels into all portals zoom level is not unfriendly to the servers
// // and the same applies for L2+ and L3+ detail levels
// // (in some ways it's nicer, as IITC caches better)
//
// if (level == 1) level = 0;
// if (level == 3) level = 2;
//
// return level;
// }
// NOTE: the logic required is closely tied to the IITC+stock map detail level code - so the logic is moved there now
// and just enabled by this flag
window.CONFIG_ZOOM_SHOW_MORE_PORTALS=true;
};