diff --git a/website/load-map.js b/website/load-map.js index 5cf0314..599abb0 100644 --- a/website/load-map.js +++ b/website/load-map.js @@ -319,6 +319,24 @@ Promise.all([boundaries, branchesCsv, ikcCsv, mechanics, nslaBranches]) setGeneral() } + // add control layers + var mapControl = L.control.layers( + baseMaps, + overlayMaps, + { "collapsed" : false } + ).addTo(map); + + // scale + L.control.scale().addTo(map); + + // info boxes + const infoBoxes = { + branches: L.control(), + fines: L.control(), + loanPeriod: L.control(), + serviceInfo: L.control({position: 'topleft'}) + } + // switching mode between standard and fragile function switchMode() { if (sessionStorage.getItem('mapMode') === 'fragile') { @@ -340,24 +358,6 @@ Promise.all([boundaries, branchesCsv, ikcCsv, mechanics, nslaBranches]) modeButton.addEventListener('click', switchMode, false); - // add control layers - const mapControl = L.control.layers( - baseMaps, - overlayMaps, - { "collapsed" : false } - ).addTo(map); - - // scale - L.control.scale().addTo(map); - - // info boxes - const infoBoxes = { - branches: L.control(), - fines: L.control(), - loanPeriod: L.control(), - serviceInfo: L.control({position: 'topleft'}) - } - function getFinesColor(f) { return f == 'no' ? '#4dac26' : f == 'yes' ? '#d01c8b' :