try to use the stock intel site map zoom->detail level loopup, to allow that to be changed at the Niantic end and IITC to match

catch errors and fallback to the currently known values
(is this a good idea? good question...)
This commit is contained in:
Jon Atkins 2013-11-13 00:09:13 +00:00
parent 110857cda3
commit 91c561b8c5

View File

@ -296,8 +296,14 @@ window.getPortalDataZoom = function() {
window.getMinPortalLevelForZoom = function(z) {
// try to use the zoom-to-level mapping from the stock intel page, if available
var ZOOM_TO_LEVEL;
try {
ZOOM_TO_LEVEL = nemesis.dashboard.zoomlevel.ZOOM_TO_LOD_;
} catch(e) {
//based on code from stock gen_dashboard.js
var ZOOM_TO_LEVEL = [8, 8, 8, 8, 7, 7, 6, 6, 5, 4, 4, 3, 3, 2, 2, 1, 1];
ZOOM_TO_LEVEL = [8, 8, 8, 8, 7, 7, 6, 6, 5, 4, 4, 3, 3, 2, 2, 1, 1];
}
var l = ZOOM_TO_LEVEL[z] || 0;
return l;
}