updates to the portal detail level handling

- iitc now defaults to lower detail than the standard intel site when zoomed out - it loads much faster, shows more than enough for general use, and is less likely to trigger 'excessive requests' issues
- show more portals plugin: updated for interface changes
- show-less-portals-zoomed-out: deleted (this is now the IITC default)
- new plugin: default-intel-detail - restores the original IITC behaviour on zoom to portal detail level mapping. not recommended

for #656 number 3
This commit is contained in:
Jon Atkins
2013-11-24 04:59:41 +00:00
parent 1f25428388
commit f22d185b5b
6 changed files with 74 additions and 98 deletions

View File

@ -2,11 +2,11 @@
// @id iitc-plugin-show-more-portals@jonatkins
// @name IITC plugin: Show more portals
// @category Tweaks
// @version 0.1.5.@@DATETIMEVERSION@@
// @version 0.1.6.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
// @description [@@BUILDNAME@@-@@BUILDDATE@@] Boost the detail level of portals shown so that unclaimed portals are visible when normally L1+ portals would be shown, and L2+ are visible when normally L3+ are shown
// @description [@@BUILDNAME@@-@@BUILDDATE@@] Boost the detail level of portals shown so that unclaimed portals are visible when normally L1+ portals would be shown, and L2+ are visible when normally L3+ are shown. Recent protocol changes by Niantic means this no longer sends more requests than the standard intel site, and can mean fewer requests.
// @include https://www.ingress.com/intel*
// @include http://www.ingress.com/intel*
// @match https://www.ingress.com/intel*
@ -25,29 +25,24 @@ 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 origGetPortalDataZoom = window.getPortalDataZoom;
var origGetMinPortalLevelForZoom = window.getMinPortalLevelForZoom;
// replace the window.getPortalDataZoom function - modify behaviour when zoomed close
// replace the window.getMinPortalLevelForZoom function - modify behaviour when L1+ or L3+ portals are shown
window.getPortalDataZoom = function() {
var mapZoom = map.getZoom();
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 (mapZoom >= 15) {
return 17;
}
// and, the same scale for L2+ and L3+ portals. again, forcing the level down isn't unfriendly to the servers
// (ditto on the caching)
if (mapZoom >= 12) {
return 13;
}
if (level == 1) level = 0;
if (level == 3) level = 2;
return origGetPortalDataZoom();
return level;
}