Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default-intel-detail: action doesn't correspond to description #1296

Open
johnd0e opened this issue Dec 14, 2018 · 0 comments
Open

default-intel-detail: action doesn't correspond to description #1296

johnd0e opened this issue Dec 14, 2018 · 0 comments

Comments

@johnd0e
Copy link

johnd0e commented Dec 14, 2018

Use the portal level detail levels from the standard intel site. By default, IITC shows less detail when zoomed out, as this is enough for general use, is more friendly to the niantic servers, and loads much faster. This plugin restores the default zoom level to portal level mapping. Note: using this plugin causes a larger number of requests to the intel server, and at high resolutions can cause excessive requests to be made (yes: the default intel site also has this problem!), so it is not recommended except for low resolution screens.

Here is all the code:

window.plugin.defaultIntelDetail.setup = function() {
// 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;
};

if (!window.CONFIG_ZOOM_DEFAULT_DETAIL_LEVEL) {
// to improve the cacheing performance, we try and limit the number of zoom levels we retrieve data for
// to avoid impacting server load, we keep ourselves restricted to a zoom level with the sane numbre
// of tilesPerEdge and portal levels visible
var origTileParams = getMapZoomTileParameters(zoom);
while (zoom > MIN_ZOOM) {
var newTileParams = getMapZoomTileParameters(zoom-1);
if ( newTileParams.tilesPerEdge != origTileParams.tilesPerEdge
|| newTileParams.hasPortals != origTileParams.hasPortals
|| newTileParams.level*newTileParams.hasPortals != origTileParams.level*origTileParams.hasPortals // multiply by 'hasPortals' bool - so comparison does not matter when no portals available
) {
// switching to zoom-1 would result in a different detail level - so we abort changing things
break;
} else {
// changing to zoom = zoom-1 results in identical tile parameters - so we can safely step back
// with no increase in either server load or number of requests
zoom = zoom-1;
}
}

As I can understand this part of getDataZoomForMapZoom, the optimization does not affect details level, and that it exact intent of the getDataZoomForMapZoom.
So (contrary to the description) option window.CONFIG_ZOOM_DEFAULT_DETAIL_LEVEL is unable to increase details level, and there is no reason to use it (even for lo-res screens).

johnd0e pushed a commit to johnd0e/ingress-intel-total-conversion that referenced this issue Feb 25, 2019
johnd0e pushed a commit to johnd0e/ingress-intel-total-conversion that referenced this issue Mar 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant