Skip to content

Commit

Permalink
deleted: default-intel-detail
Browse files Browse the repository at this point in the history
  • Loading branch information
johndoe committed Mar 14, 2019
1 parent d728775 commit c235d8e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 24 deletions.
43 changes: 19 additions & 24 deletions code/map_data_calc_tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,31 +110,26 @@ window.getDataZoomForMapZoom = function(zoom) {
zoom = 21;
}


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;
}
// 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 number
// 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;
}

}

return zoom;
Expand Down
File renamed without changes.

0 comments on commit c235d8e

Please sign in to comment.