diff --git a/website/load-map.js b/website/load-map.js index 71781a6..adfa3c7 100644 --- a/website/load-map.js +++ b/website/load-map.js @@ -63,11 +63,18 @@ function LocationsLayer(data, color, outline, type) { fieldSeparator: ',', onEachFeature: function (feature, layer) { if (type === 'ils') { - layer.bindPopup( - `${feature.properties.town}` + - `

${feature.properties.ils}

` + - `

${feature.properties.discovery}

` - ) + if (feature.properties.discovery) { + layer.bindPopup( + `${feature.properties.town}` + + `

${feature.properties.ils}

` + + `

${feature.properties.discovery}

` + ) + } else { + layer.bindPopup( + `${feature.properties.town}` + + `

${feature.properties.ils}

` + ) + } } else { layer.bindPopup( `${feature.properties.town}` + @@ -120,7 +127,7 @@ Promise.all([boundaries, branchesCsv, ikcCsv, mechanics, nslaBranches, caul]) const mechsAndSoA = new LocationsLayer(data[3], 'rgb(255,165,0)', 800) const otherLibs = new LocationsLayer(data[4], '#75f857', 800) const nslaLibs = new LocationsLayer(data[4], '#FF3961', 20000, 'ils') - const academicLibs = new LocationsLayer(data[5], '#0073A1', 1000, 'ils') + const academicLibs = new LocationsLayer(data[5], '#0073A1', 5000, 'ils') // add to the initial map on load branches.addTo(map) ikcs.addTo(map)