From 91c561b8c5e6ee5d30b15f79a6a1cd3768882926 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Wed, 13 Nov 2013 00:09:13 +0000 Subject: [PATCH] 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...) --- code/utils_misc.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/code/utils_misc.js b/code/utils_misc.js index 43763087..7933f3bc 100644 --- a/code/utils_misc.js +++ b/code/utils_misc.js @@ -296,8 +296,14 @@ window.getPortalDataZoom = function() { window.getMinPortalLevelForZoom = function(z) { -//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]; + // 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 + 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; }