diff --git a/code/boot.js b/code/boot.js index e77d4630..ec9be61c 100644 --- a/code/boot.js +++ b/code/boot.js @@ -102,7 +102,7 @@ window.setupMap = function() { portalsLayers[i].eachLayer(function(item) { var itemGuid = item.options.guid; // check if 'item' is a resonator - if(!window.resonators[itemGuid]) return; + if(getTypeByGuid(itemGuid) != TYPE_RESONATOR) return true; portalsLayers[i].removeLayer(item); }); } diff --git a/code/map_data.js b/code/map_data.js index 5d29de6a..36b3fe7a 100644 --- a/code/map_data.js +++ b/code/map_data.js @@ -146,11 +146,11 @@ window.cleanUp = function() { portalsLayers[i].eachLayer(function(item) { var itemGuid = item.options.guid; // check if 'item' is a portal - if(!window.portals[itemGuid]) return; + if(getTypeByGuid(itemGuid) != TYPE_PORTAL) return true; // portal must be in bounds and have a high enough level. Also don’t // remove if it is selected. if(itemGuid == window.selectedPortal || - (b.contains(item.getLatLng()) && i >= minlvl)) return; + (b.contains(item.getLatLng()) && i >= minlvl)) return true; cnt[0]++; portalsLayers[i].removeLayer(item); }); @@ -188,7 +188,7 @@ window.removeByGuid = function(guid) { break; case TYPE_RESONATOR: if(!window.resonators[guid]) return; - var r = window.resonators[guid] + var r = window.resonators[guid]; for(var i = 1; i < portalsLayers.length; i++) portalsLayers[i].removeLayer(r); break; @@ -297,7 +297,7 @@ window.renderResonators = function(ent) { var lon0 = ent[2].locationE6.lngE6/1E6 + dLon * 180/Math.PI; var Rlatlng = [lat0, lon0]; var r = L.circleMarker(Rlatlng, { - radius: 4, + radius: 3, // #AAAAAA outline seems easier to see the fill opacity color: '#AAAAAA', opacity: 1, @@ -318,11 +318,11 @@ window.renderResonators = function(ent) { } // append portal guid with -resonator-[slot] to get guid for resonators -window.portalResonatorGuid = function(portalGuid, slot){ +window.portalResonatorGuid = function(portalGuid, slot) { return portalGuid + '-resonator-' + slot; } -window.isResonatorsShow = function(){ +window.isResonatorsShow = function() { return map.getZoom() >= RESONATOR_DISPLAY_ZOOM_LEVEL; } diff --git a/main.js b/main.js index d3a90b14..b27b56e6 100644 --- a/main.js +++ b/main.js @@ -145,7 +145,7 @@ var PLAYER = window.PLAYER; var CHAT_SHRINKED = 60; // Minimum zoom level resonator will display -var RESONATOR_DISPLAY_ZOOM_LEVEL = 16; +var RESONATOR_DISPLAY_ZOOM_LEVEL = 17; // Constants for resonator positioning var SLOT_TO_LAT = [0, Math.sqrt(2)/2, 1, Math.sqrt(2)/2, 0, -Math.sqrt(2)/2, -1, -Math.sqrt(2)/2];