diff --git a/code/boot.js b/code/boot.js index 50441c6b..fc997a63 100644 --- a/code/boot.js +++ b/code/boot.js @@ -165,7 +165,7 @@ window.setupMap = function() { center: [0,0], zoom: 1, zoomControl: (typeof android !== 'undefined' && android && android.showZoom) ? android.showZoom() : true, - minZoom: 5, + minZoom: MIN_ZOOM, // zoomAnimation: false, markerZoomAnimation: false, bounceAtZoomLimits: false diff --git a/code/extract_niantic_parameters.js b/code/extract_niantic_parameters.js index 9561db8a..c6421afe 100644 --- a/code/extract_niantic_parameters.js +++ b/code/extract_niantic_parameters.js @@ -76,7 +76,7 @@ window.extractFromStock = function() { // a reasonable array length for tile parameters // need to find two types: // a. portal level limits. decreasing numbers, starting at 8 - // b. tiles per edge. increasing numbers. current max is 9000 + // b. tiles per edge. increasing numbers. current max is 36000, 9000 was the previous value if (topObject[0] == 8) { // check for tile levels @@ -93,7 +93,7 @@ window.extractFromStock = function() { } } // end if (topObject[0] == 8) - if (topObject[topObject.length-1] == 9000) { + if (topObject[topObject.length-1] == 36000 || topObject[topObject.length-1] == 9000) { var increasing = true; for (var i=1; i topObject[i]) { diff --git a/code/map_data_calc_tools.js b/code/map_data_calc_tools.js index da273453..9e0b4d9d 100755 --- a/code/map_data_calc_tools.js +++ b/code/map_data_calc_tools.js @@ -10,14 +10,11 @@ // http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames + 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 = [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 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]; + var ZOOM_TO_TILES_PER_EDGE = [256, 256, 256, 256, 512, 512, 512, 2048, 2048, 2048, 4096, 4096, 6500, 6500, 6500, 18e3, 18e3, 36e3]; + var ZOOM_TO_LEVEL = [ 8, 8, 8, 8, 7, 7, 7, 6, 6, 5, 4, 4, 3, 2, 2, 1, 1 ]; if (niantic_params.ZOOM_TO_LEVEL && niantic_params.TILES_PER_EDGE) { ZOOM_TO_LEVEL = niantic_params.ZOOM_TO_LEVEL; @@ -35,13 +32,14 @@ window.getMapZoomTileParameters = function(zoom) { // reduce portal detail level by one - helps reduce clutter level = level+1; } - } + var maxTilesPerEdge = ZOOM_TO_TILES_PER_EDGE[ZOOM_TO_TILES_PER_EDGE.length-1]; + return { level: level, maxLevel: ZOOM_TO_LEVEL[zoom] || 0, // for reference, for log purposes, etc - tilesPerEdge: ZOOM_TO_TILES_PER_EDGE[zoom] || MAX_TILES_PER_EDGE, + tilesPerEdge: ZOOM_TO_TILES_PER_EDGE[zoom] || maxTilesPerEdge, zoom: zoom // include the zoom level, for reference }; } @@ -66,7 +64,7 @@ window.getDataZoomForMapZoom = function(zoom) { // to avoid impacting server load, we keep ourselves restricted to a zoom level with the sane numbre // of tilesPerEdge and portal levels visible - while (zoom > 5) { + while (zoom > MIN_ZOOM) { var newTileParams = getMapZoomTileParameters(zoom-1); 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