fixes #174
Also fixes nsla libraries showing "undefined" for discovery layer
This commit is contained in:
parent
9554ff9438
commit
c6a7887cee
|
@ -63,11 +63,18 @@ function LocationsLayer(data, color, outline, type) {
|
|||
fieldSeparator: ',',
|
||||
onEachFeature: function (feature, layer) {
|
||||
if (type === 'ils') {
|
||||
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)
|
||||
|
|
Loading…
Reference in a new issue