map params adjusted due to server overload of shonin anomaly

This commit is contained in:
Jon Atkins 2015-03-28 16:27:48 +00:00
parent e7a136ec04
commit a169176bad
2 changed files with 7 additions and 4 deletions

View File

@ -165,7 +165,7 @@ window.setupMap = function() {
center: [0,0], center: [0,0],
zoom: 1, zoom: 1,
zoomControl: (typeof android !== 'undefined' && android && android.showZoom) ? android.showZoom() : true, zoomControl: (typeof android !== 'undefined' && android && android.showZoom) ? android.showZoom() : true,
minZoom: 1, minZoom: 5,
// zoomAnimation: false, // zoomAnimation: false,
markerZoomAnimation: false, markerZoomAnimation: false,
bounceAtZoomLimits: false bounceAtZoomLimits: false

View File

@ -12,9 +12,12 @@
window.getMapZoomTileParameters = function(zoom) { window.getMapZoomTileParameters = function(zoom) {
var ZOOM_TO_TILES_PER_EDGE = [64, 64, 128, 128, 256, 256, 256, 1024, 1024, 1536, 4096, 4096, 6500, 6500, 6500]; // var ZOOM_TO_TILES_PER_EDGE = [64, 64, 128, 128, 256, 256, 256, 1024, 1024, 1536, 4096, 4096, 6500, 6500, 6500];
// var ZOOM_TO_TILES_PER_EDGE = [256, 256, 256, 256, 512, 512, 512, 2048, 2048, 2048, 4096, 4096, 6500, 6500, 6500];
var ZOOM_TO_TILES_PER_EDGE = [256, 256, 256, 256, 512, 2048, 2048, 4096, 4096, 4096, 4096, 4096, 6500, 6500, 6500];;
var MAX_TILES_PER_EDGE = 9000; var MAX_TILES_PER_EDGE = 9000;
var ZOOM_TO_LEVEL = [8, 8, 8, 8, 7, 7, 7, 6, 6, 5, 4, 4, 3, 2, 2, 1, 1]; // var ZOOM_TO_LEVEL = [8, 8, 8, 8, 7, 7, 7, 6, 6, 5, 4, 4, 3, 2, 2, 1, 1];
var ZOOM_TO_LEVEL = [8, 8, 8, 8, 8, 8, 7, 7, 6, 6, 5, 4, 3, 2, 2, 1, 1];
// the current API allows the client to request a minimum portal level. the ZOOM_TO_LEVEL list are minimums // the current API allows the client to request a minimum portal level. the ZOOM_TO_LEVEL list are minimums
// however, in my view, this can return excessive numbers of portals in many cases. let's try an optional reduction // however, in my view, this can return excessive numbers of portals in many cases. let's try an optional reduction
@ -58,7 +61,7 @@ window.getDataZoomForMapZoom = function(zoom) {
// to avoid impacting server load, we keep ourselves restricted to a zoom level with the sane numbre // to avoid impacting server load, we keep ourselves restricted to a zoom level with the sane numbre
// of tilesPerEdge and portal levels visible // of tilesPerEdge and portal levels visible
while (zoom > 1) { while (zoom > 5) {
var newTileParams = getMapZoomTileParameters(zoom-1); var newTileParams = getMapZoomTileParameters(zoom-1);
if (newTileParams.tilesPerEdge != origTileParams.tilesPerEdge || newTileParams.level != origTileParams.level) { if (newTileParams.tilesPerEdge != origTileParams.tilesPerEdge || newTileParams.level != origTileParams.level) {
// switching to zoom-1 would result in a different detail level - so we abort changing things // switching to zoom-1 would result in a different detail level - so we abort changing things