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

@ -1,12 +1,12 @@
// ==UserScript==
// @id iitc-plugin-show-less-portals@jonatkins
// @name IITC plugin: Show less portals when zoomed out
// @category Tweaks
// @version 0.1.4.@@DATETIMEVERSION@@
// @category Deleted
// @version 0.2.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
// @description [@@BUILDNAME@@-@@BUILDDATE@@] Decrease the portal detail level used when zoomed out. This can speed up map loading, decrease the amount of data used, and solve excessive request issues. Only applies when zoomed out to show no closer than L3 portals. May stop display of the smaller links/fields.
// @description [@@BUILDNAME@@-@@BUILDDATE@@] IITC now defaults to showing fewer portals when zoomed out, making this plugin unnecessary
// @include https://www.ingress.com/intel*
// @include http://www.ingress.com/intel*
// @match https://www.ingress.com/intel*
@ -14,46 +14,3 @@
// @grant none
// ==/UserScript==
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
// use own namespace for plugin
window.plugin.showLessPortals = function() {};
window.plugin.showLessPortals.setup = function() {
// save the original function - so we can chain to it for levels we don't modify
var origGetPortalDataZoom = window.getPortalDataZoom;
// replace the window.getPortalDataZoom function - modify behaviour when zoomed close
window.getPortalDataZoom = function() {
var mapZoom = map.getZoom();
// the latest intel site update, as of 2013-10-16, requests a silly number of map tiles at the larger zoom levels
// IITC matches the behaviour by default, but it makes sense to reduce the detail level sooner
// at the largest scale zooms - move back two levels
if (mapZoom <= 7) {
return Math.max(mapZoom-2,0);
}
// intermediate zoom levels - move back one
if (mapZoom <= 11) {
return Math.max(mapZoom-1,0);
}
// otherwise revert to default behaviour
return origGetPortalDataZoom();
}
};
var setup = window.plugin.showLessPortals.setup;
// PLUGIN END //////////////////////////////////////////////////////////
@@PLUGINEND@@