fixes #174 #180

Merged
hughrun merged 1 commit from who-else into main 2024-02-11 15:08:39 +11:00
Showing only changes of commit c6a7887cee - Show all commits

View file

@ -63,11 +63,18 @@ function LocationsLayer(data, color, outline, type) {
fieldSeparator: ',',
onEachFeature: function (feature, layer) {
if (type === 'ils') {
layer.bindPopup(
`<strong>${feature.properties.town}</strong>` +
`<p>${feature.properties.ils}</p>` +
`<p>${feature.properties.discovery}</p>`
)
if (feature.properties.discovery) {
layer.bindPopup(
`<strong>${feature.properties.town}</strong>` +
`<p>${feature.properties.ils}</p>` +
`<p>${feature.properties.discovery}</p>`
)
} else {
layer.bindPopup(
`<strong>${feature.properties.town}</strong>` +
`<p>${feature.properties.ils}</p>`
)
}
} else {
layer.bindPopup(
`<strong>${feature.properties.town}</strong>` +
@ -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)