nsla overlay #136
|
@ -32,11 +32,11 @@ If you are adding a lot of data and have a new source for it, make sure it is ci
|
|||
|
||||
### Missing or inaccurate data
|
||||
|
||||
Currently we're missing data for some library services in relation to **standard loan periods** and **fines for overdue items**.
|
||||
Currently we're missing data for some library services in relation to **standard loan periods** and **fines for overdue items**. Any acurate and specific information about fines for South and Western Australia would be particularly helpful.
|
||||
|
||||
It's likely that some **library location data** is inaccurate — especially for New South Wales. It's also possible that the address data is wrong (even though the location shown may be correct), and in some cases it is missing.
|
||||
|
||||
It's possible that some of the **fines data for Queensland** is a little off. This came from the State Library of Queensland but I know for a fact that some of the data was wrong (e.g. Gold Coast Libraries does not charge overdue fines, but the SLQ reports says it does).
|
||||
It's possible that some of the **fines data for Queensland** is a little off. This came from the State Library of Queensland but some of the data was wrong (e.g. Gold Coast Libraries does not charge overdue fines, but the SLQ report says it does).
|
||||
|
||||
I am particularly interested if you know of data sources for entire regions, states, or Australia — especially if they're reliably kept up to date.
|
||||
|
||||
|
|
|
@ -32,15 +32,15 @@
|
|||
<p>I’d love your help to make <em>Library Map</em> as accurate and useful as possible.</p>
|
||||
<h3 id="how-to-contribute-your-idea-bug-report-or-improvement">How to contribute your idea, bug report or improvement</h3>
|
||||
<ol type="1">
|
||||
<li>Look at the <a href="https://github.com/hughrun/public_library_map/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22">current GitHub issues tagged <code>help wanted</code></a>to see if you can help. Most of these will be to do with updating data, like finding street addresses or other information.</li>
|
||||
<li>Look at the <a href="https://github.com/hughrun/public_library_map/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22">current GitHub issues tagged <code>help wanted</code></a> to see if you can help. Most of these will be to do with updating data, like finding street addresses or other information.</li>
|
||||
<li>You can <a href="https://github.com/hughrun/public_library_map/issues">create a new issue</a> on GitHub.</li>
|
||||
<li>You can <a href="https://docs.github.com/en/github/.collaborating-with-issues-and-pull-requests/about-pull-requests">send a pull request</a> — though it is <em>strongly preferred</em> that you either ask to be assigned to an existing issue (so everyone knows you're working on it), or create a new issue, first.</li>
|
||||
<li>You can <a href="https://docs.github.com/en/github/.collaborating-with-issues-and-pull-requests/about-pull-requests">send a pull request</a> — though it is <em>strongly preferred</em> that you either ask to be assigned to an existing issue (so everyone knows you’re working on it), or create a new issue, first.</li>
|
||||
<li>You can just send an email to <code>librarymap</code>@<code>hugh</code>.<code>run</code> and ask me to fix/add something.</li>
|
||||
</ol>
|
||||
<h3 id="if-you-have-not-used-git-or-github-before">If you have not used Git or GitHub before</h3>
|
||||
<p>There is a class outline for an <a href="https://librarycarpentry.org/lc-git/">introduction to Git and GitHub aimed at librarians</a> at <code>librarycarpentry.org</code>. This assumes you are using the command line. If you create or already have a GitHub account, you can also <a href="https://docs.github.com/en/github/managing-files-in-a-repository/editing-files-in-another-users-repository">edit files directly in the browser</a>, or use <a href="https://desktop.github.com/">GitHub Desktop</a> - both of which are probably less intimidating options if you don’t have any desire to learn how to use a command line/shell interface, or just want to make a single minor update.</p>
|
||||
<h3 id="which-files-to-update">Which files to update</h3>
|
||||
<p>To update information about library <em>services</em> (e.g. fines info, loan period etc) you should edit <code>website/data/library_services_information.csv</code></p>
|
||||
<p>To update information about library <em>services</em> (e.g. fines info, loan period etc) you should edit <code>website/data/library_services_information.csv</code>.</p>
|
||||
<p>After your Pull Request is merged, a GitHub Action will automatically create a second pull request that merges data from <code>website/data/library_services_information.csv</code> into <code>website/data/boundaries.topo.json</code>. Please do not edit the <code>topo.json</code> file directly.</p>
|
||||
<p>To update information about library <em>locations</em> (e.g. street address, phone number, coordinates) you should edit the relevant csv location file:</p>
|
||||
<ul>
|
||||
|
@ -52,17 +52,17 @@
|
|||
<h3 id="citing-and-crediting-data-sources">Citing and crediting data sources</h3>
|
||||
<p>If you are adding a lot of data and have a new source for it, make sure it is cited. You should update the list of sources at both <code>sources.md</code> <em>and</em> <code>website/sources/index.html</code>. If your source is “I just know because it’s my local library” or “I looked it up on their website” you don’t need to add that to the list of sources. If your source is “I found a PDF listing every public library on the State Library website”, you do.</p>
|
||||
<h3 id="missing-or-inaccurate-data">Missing or inaccurate data</h3>
|
||||
<p>Currently we’re missing data for some library services in relation to <strong>standard loan periods</strong> and <strong>fines for overdue items</strong>.</p>
|
||||
<p>Currently we’re missing data for some library services in relation to <strong>standard loan periods</strong> and <strong>fines for overdue items</strong>. Any acurate and specific information about fines for South and Western Australia would be particularly helpful.</p>
|
||||
<p>It’s likely that some <strong>library location data</strong> is inaccurate — especially for New South Wales. It’s also possible that the address data is wrong (even though the location shown may be correct), and in some cases it is missing.</p>
|
||||
<p>It’s possible that some of the <strong>fines data for Queensland</strong> is a little off. This came from the State Library of Queensland but I know for a fact that some of the data was wrong (e.g. Gold Coast Libraries does not charge overdue fines, but the SLQ reports says it does).</p>
|
||||
<p>It’s possible that some of the <strong>fines data for Queensland</strong> is a little off. This came from the State Library of Queensland but some of the data was wrong (e.g. Gold Coast Libraries does not charge overdue fines, but the SLQ report says it does).</p>
|
||||
<p>I am particularly interested if you know of data sources for entire regions, states, or Australia — especially if they’re reliably kept up to date.</p>
|
||||
<p>If you can fill in any of these blanks, please update the relevant CSV file and send a pull request. If your data is coming from somewhere in particular, you should also add that to <code>sources.md</code> in the relevant table.</p>
|
||||
<h3 id="ideas-for-additional-data">Ideas for additional data</h3>
|
||||
<p>You might have an idea for library data that would be useful to map. I’m really happy to hear about these ideas! It’s possible that the information you want to map is unavailable, or just really hard to get, or maybe I will disagree that it’s useful. That’s ok - please ask anyway, expecially if you know where to find the data.</p>
|
||||
<p>You might have an idea for library data that would be useful to map. I’m really happy to hear about these ideas! It’s possible that the information you want to map is unavailable, or just really hard to get, or maybe I will disagree that it’s useful. That’s ok - please ask anyway, especially if you know where to find the data.</p>
|
||||
<h3 id="improvements-to-documentation">Improvements to documentation</h3>
|
||||
<p>I’m always — <em>always</em> — happy to hear how I can improve documentation. Even better if you make the edit and then send a pull request.</p>
|
||||
<h3 id="improvements-to-the-website-design-layout-or-information">Improvements to the website design, layout, or information</h3>
|
||||
<p>You might have an idea for an improvement that’s not about the data per se, but rather about the website. Maybe there’s some accessibilty improvements I can make. Let me know!</p>
|
||||
<p>You might have an idea for an improvement that’s not about the data per se, but rather about the website. Maybe there’s some accessibility improvements I can make. Let me know!</p>
|
||||
<h3 id="licensing-and-copyright">Licensing and copyright</h3>
|
||||
<p>By contributing to this project you agree to license your work under the following licenses:</p>
|
||||
<p><strong>/website/data/*</strong>: <a href="https://creativecommons.org/licenses/by-sa/4.0/">CC-BY-SA</a></p>
|
||||
|
|
|
@ -428,4 +428,4 @@ Wyndham-East Kimberley Shire Council,Wyndham-East Kimberley,wa,,2,Follett Destin
|
|||
Yalgoo Shire Council,Yalgoo,wa,,?,OCLC Amlib,https://www.yalgoo.wa.gov.au/town-services/services-public-library.aspx,
|
||||
Yilgarn Shire Council,Yilgarn,wa,yes,2,OCLC Amlib,https://www.yilgarn.wa.gov.au/crc/library/southern-cross-public-library.aspx,
|
||||
York Shire Council,York,wa,,3,OCLC Amlib,https://www.york.wa.gov.au/community/facilities/library.aspx,
|
||||
Warrnambool City Council,Warrnambool,vic,?,3,Spydus,https://library.warrnambool.vic.gov.au/,
|
||||
Warrnambool City Council,Warrnambool,vic,?,3,Civica Spydus,https://library.warrnambool.vic.gov.au/,
|
||||
|
|
|
|
@ -1,10 +1,10 @@
|
|||
lat,lng,town,address,phone
|
||||
-37.809815,144.96513,State Library of Victoria,"328 Swanston Street, Melbourne",03 8664 7000
|
||||
-35.2964664654173,149.129530279015,National Library of Australia,"Parkes Place, Canberra",02 6262 1111
|
||||
-33.8658844393665,151.213300984753,State Library of New South Wales,"Macquarie Street, Sydney",02 9273 1414
|
||||
-27.4709532627151,153.018134355766,State Library of Queensland,"Stanley Place, South Brisbane",07 3840 7666
|
||||
-34.9203274502345,138.602616669435,State Library of South Australia,"North Terrace & Kintore Ave, Adelaide",08 8207 7250
|
||||
-31.9490538016994,115.860634584705,State Library of Western Australia,"25 Francis St, Perth",08 9427 3111
|
||||
-42.8815965006531,147.325005456166,Hobart Reading Room (State Reference Library),"91 Murray Street, Hobart",03 6165 5597
|
||||
-12.4666020117882,130.842962053658,Northern Territory Library,"4 Bennett St, Parliament House, Darwin",08 8999 7177
|
||||
-35.3241714564223,149.164639259617,ACT Heritage Library,"255 Canberra Ave, Fyshwick",02 6207 5163
|
||||
lat,lng,town,address,phone,ils
|
||||
-37.809815,144.96513,State Library of Victoria,"328 Swanston Street, Melbourne",03 8664 7000,Ex Libris Voyager
|
||||
-35.2964664654173,149.129530279015,National Library of Australia,"Parkes Place, Canberra",02 6262 1111,Ex Libris Voyager
|
||||
-33.8658844393665,151.213300984753,State Library of New South Wales,"Macquarie Street, Sydney",02 9273 1414,Ex Libris Alma
|
||||
-27.4709532627151,153.018134355766,State Library of Queensland,"Stanley Place, South Brisbane",07 3840 7666,Ex Libris Alma
|
||||
-34.9203274502345,138.602616669435,State Library of South Australia,"North Terrace & Kintore Ave, Adelaide",08 8207 7250,Innovative Sierra
|
||||
-31.9490538016994,115.860634584705,State Library of Western Australia,"25 Francis St, Perth",08 9427 3111,Innovative Sierra
|
||||
-42.8815965006531,147.325005456166,Hobart Reading Room (State Reference Library),"91 Murray Street, Hobart",03 6165 5597,SirsiDynix Symphony
|
||||
-12.4666020117882,130.842962053658,Northern Territory Library,"4 Bennett St, Parliament House, Darwin",08 8999 7177,OCLC WorldShare
|
||||
-35.3241714564223,149.164639259617,ACT Heritage Library,"255 Canberra Ave, Fyshwick",02 6207 5163,Civica Spydus
|
||||
|
|
|
|
@ -27,22 +27,53 @@ function BaseMap(id) {
|
|||
})
|
||||
}
|
||||
|
||||
function LocationsLayer(data, color) {
|
||||
function getIlsColor(f) {
|
||||
return f == 'AIT Aurora' ? '#d16a6e' :
|
||||
f == 'Champ LMSi' ? '#ff00db' :
|
||||
f == 'Civica Spydus' ? '#800080' :
|
||||
f == 'DECD Bookmark' ? '#e1153e' :
|
||||
f == 'Ex Libris Alma' ? '#ff6500' :
|
||||
f == 'Ex Libris Voyager' ? 'yellow' :
|
||||
f == 'Follett Destiny' ? '#df4917' :
|
||||
f == 'Infor V-smart' ? '#e174c1' :
|
||||
f == 'Innovative Sierra' ? '#ff0000' :
|
||||
f == 'Koha ILS' ? '#2fbf2f' :
|
||||
f == 'Libero' ? '#ffa500' :
|
||||
f == 'Locally developed' ? '#bfdf17' :
|
||||
f == 'OCLC Amlib' ? '#ddb372' :
|
||||
f == 'OCLC WorldShare' ? '#2fbf97' :
|
||||
f == 'SirsiDynix Horizon' ? '#ffff00' :
|
||||
f == 'SirsiDynix Symphony' ? '#115583' :
|
||||
f == 'Softlink Liberty' ? '#00f9ff' :
|
||||
f == 'SumWare Athenaeum' ? '#ff3232' : '#bbb';
|
||||
}
|
||||
|
||||
function LocationsLayer(data, color, outline, type) {
|
||||
this.data = data;
|
||||
this.color = color;
|
||||
this.outline = outline;
|
||||
this.type = type;
|
||||
return L.layerGroup([
|
||||
L.geoCsv(data, {
|
||||
firstLineTitles: true,
|
||||
fieldSeparator: ',',
|
||||
onEachFeature: function (feature, layer) {
|
||||
if (type === 'ils') {
|
||||
layer.bindPopup(
|
||||
`<strong>${feature.properties.town}</strong>` +
|
||||
`<p>${feature.properties.ils}</p>`
|
||||
)
|
||||
} else {
|
||||
layer.bindPopup(
|
||||
`<strong>${feature.properties.town}</strong>` +
|
||||
`<p>${feature.properties.address}<br/>` +
|
||||
`phone: ${feature.properties.phone}</p>`
|
||||
)
|
||||
}
|
||||
},
|
||||
pointToLayer: function (f, latlng) {
|
||||
return L.circle(latlng, {color: color, radius: 800}) // this is an 800m radius around the library
|
||||
let col = type === 'ils' ? getIlsColor(f.properties.ils) : color;
|
||||
return L.circle(latlng, {color: col, radius: outline}) // this is an 800m radius around the library
|
||||
}
|
||||
}),
|
||||
L.geoCsv(data, {
|
||||
|
@ -56,7 +87,8 @@ function LocationsLayer(data, color) {
|
|||
)
|
||||
},
|
||||
pointToLayer: function (f, latlng) {
|
||||
return L.circleMarker(latlng, {color: color, radius: 2, fill: true})
|
||||
let col = type === 'ils' ? getIlsColor(f.properties.ils) : color;
|
||||
return L.circleMarker(latlng, {color: col, radius: 2, fill: true})
|
||||
}
|
||||
})
|
||||
])
|
||||
|
@ -78,10 +110,11 @@ Promise.all([boundaries, branchesCsv, ikcCsv, mechanics, nslaBranches])
|
|||
});
|
||||
|
||||
// LOCATION LAYERS
|
||||
const branches = new LocationsLayer(data[1], "#FF3961")
|
||||
const ikcs = new LocationsLayer(data[2], "#76DBA7")
|
||||
const mechsAndSoA = new LocationsLayer(data[3], "rgb(255,165,0)")
|
||||
const otherLibs = new LocationsLayer(data[4], "#75f857")
|
||||
const branches = new LocationsLayer(data[1], '#FF3961', 800)
|
||||
const ikcs = new LocationsLayer(data[2], '#76DBA7', 800)
|
||||
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')
|
||||
// add to the initial map on load
|
||||
branches.addTo(map)
|
||||
ikcs.addTo(map)
|
||||
|
@ -111,8 +144,8 @@ Promise.all([boundaries, branchesCsv, ikcCsv, mechanics, nslaBranches])
|
|||
return {
|
||||
fillColor: getFinesColor(feature.properties.fines),
|
||||
weight: 3,
|
||||
color: "white",
|
||||
dashArray: "4",
|
||||
color: 'white',
|
||||
dashArray: '4',
|
||||
fillOpacity: 0.2
|
||||
}
|
||||
},
|
||||
|
@ -177,10 +210,10 @@ Promise.all([boundaries, branchesCsv, ikcCsv, mechanics, nslaBranches])
|
|||
style: function(feature){
|
||||
return {
|
||||
weight: 3,
|
||||
color: "#fff",
|
||||
dashArray: "4",
|
||||
color: '#fff',
|
||||
dashArray: '4',
|
||||
fillOpacity: 0.2,
|
||||
fillColor: "#bbb",
|
||||
fillColor: '#bbb',
|
||||
fillPattern: getLoanFillPattern(feature.properties.standard_loan_weeks)
|
||||
}
|
||||
},
|
||||
|
@ -199,8 +232,8 @@ Promise.all([boundaries, branchesCsv, ikcCsv, mechanics, nslaBranches])
|
|||
return {
|
||||
fillColor: getIlsColor(feature.properties.ILS),
|
||||
weight: 3,
|
||||
color: "white",
|
||||
dashArray: "4",
|
||||
color: 'white',
|
||||
dashArray: '4',
|
||||
fillOpacity: 0.2
|
||||
}
|
||||
},
|
||||
|
@ -218,9 +251,9 @@ Promise.all([boundaries, branchesCsv, ikcCsv, mechanics, nslaBranches])
|
|||
// control layers
|
||||
// ++++++++++++++
|
||||
const baseMaps = {
|
||||
"Libraries" : baseMap,
|
||||
"Rules" : baseRules,
|
||||
"Library Management Software" : baseIls
|
||||
'Libraries' : baseMap,
|
||||
'Rules' : baseRules,
|
||||
'Library Management Software' : baseIls
|
||||
}
|
||||
|
||||
// change the branches overlay names depending on the mode.
|
||||
|
@ -230,24 +263,24 @@ Promise.all([boundaries, branchesCsv, ikcCsv, mechanics, nslaBranches])
|
|||
|
||||
function setGeneral() {
|
||||
overlayMaps = {
|
||||
"Settler Knowledge Centres" : branches,
|
||||
"Indigenous Knowledge Centres" : ikcs,
|
||||
"Mechanics Institutes" : mechsAndSoA,
|
||||
"Colonial Knowledge Centres" : otherLibs
|
||||
'Settler Knowledge Centres' : branches,
|
||||
'Indigenous Knowledge Centres' : ikcs,
|
||||
'Mechanics Institutes' : mechsAndSoA,
|
||||
'Colonial Knowledge Centres' : otherLibs
|
||||
}
|
||||
modeButton.setAttribute('class', 'visible');
|
||||
modeButton.innerText = "View in Colonial Mode";
|
||||
modeButton.innerText = 'View in Colonial Mode';
|
||||
}
|
||||
|
||||
function setColonial() {
|
||||
overlayMaps = {
|
||||
"Public Libraries" : branches,
|
||||
"Indigenous Knowledge Centres" : ikcs,
|
||||
"Mechanics Institutes" : mechsAndSoA,
|
||||
"National & State Libraries" : otherLibs
|
||||
'Public Libraries' : branches,
|
||||
'Indigenous Knowledge Centres' : ikcs,
|
||||
'Mechanics Institutes' : mechsAndSoA,
|
||||
'National & State Libraries' : otherLibs
|
||||
};
|
||||
modeButton.setAttribute('class', 'visible');
|
||||
modeButton.innerText = "View in Standard Mode";
|
||||
modeButton.innerText = 'View in Standard Mode';
|
||||
}
|
||||
|
||||
if (sessionStorage.getItem('mapMode') === 'colonial') {
|
||||
|
@ -260,7 +293,7 @@ Promise.all([boundaries, branchesCsv, ikcCsv, mechanics, nslaBranches])
|
|||
var mapControl = L.control.layers(
|
||||
baseMaps,
|
||||
overlayMaps,
|
||||
{ "collapsed" : isSmallScreen }
|
||||
{ 'collapsed' : isSmallScreen }
|
||||
).addTo(map);
|
||||
|
||||
// scale
|
||||
|
@ -281,7 +314,7 @@ Promise.all([boundaries, branchesCsv, ikcCsv, mechanics, nslaBranches])
|
|||
setGeneral()
|
||||
mapControl.remove();
|
||||
infoBoxes.branches.remove()
|
||||
mapControl = L.control.layers(baseMaps, overlayMaps, {"collapsed": isSmallScreen}).addTo(map);
|
||||
mapControl = L.control.layers(baseMaps, overlayMaps, {'collapsed': isSmallScreen}).addTo(map);
|
||||
if (!isSmallScreen) {
|
||||
infoBoxes.branches.addTo(map)
|
||||
}
|
||||
|
@ -290,7 +323,7 @@ Promise.all([boundaries, branchesCsv, ikcCsv, mechanics, nslaBranches])
|
|||
setColonial()
|
||||
mapControl.remove();
|
||||
infoBoxes.branches.remove()
|
||||
mapControl = L.control.layers(baseMaps, overlayMaps, {"collapsed": isSmallScreen}).addTo(map);
|
||||
mapControl = L.control.layers(baseMaps, overlayMaps, {'collapsed': isSmallScreen}).addTo(map);
|
||||
if (!isSmallScreen) {
|
||||
infoBoxes.branches.addTo(map)
|
||||
}
|
||||
|
@ -307,32 +340,13 @@ Promise.all([boundaries, branchesCsv, ikcCsv, mechanics, nslaBranches])
|
|||
f == 'no_unconfirmed' ? '#b8e186' : '#bbb';
|
||||
}
|
||||
|
||||
function getIlsColor(f) {
|
||||
return f == 'AIT Aurora' ? '#d16a6e' :
|
||||
f == 'Champ LMSi' ? '#ff00db' :
|
||||
f == 'Civica Spydus' ? '#800080' :
|
||||
f == 'DECD Bookmark' ? '#e1153e' :
|
||||
f == 'Follett Destiny' ? '#df4917' :
|
||||
f == 'Infor V-smart' ? '#e174c1' :
|
||||
f == 'Innovative Sierra' ? '#ff0000' :
|
||||
f == 'Koha ILS' ? '#2fbf2f' :
|
||||
f == 'Libero' ? '#ffa500' :
|
||||
f == 'Locally developed' ? '#bfdf17' :
|
||||
f == 'OCLC Amlib' ? '#ddb372' :
|
||||
f == 'OCLC WorldShare' ? '#2fbf97' :
|
||||
f == 'SirsiDynix Horizon' ? '#ffff00' :
|
||||
f == 'SirsiDynix Symphony' ? '#115583' :
|
||||
f == 'Softlink Liberty' ? '#00f9ff' :
|
||||
f == 'SumWare Athenaeum' ? '#ff3232' : '#bbb';
|
||||
}
|
||||
|
||||
// highlight feature on mouse hover
|
||||
function highlightFeature(e) {
|
||||
const layer = e.target;
|
||||
layer.setStyle({
|
||||
weight: 6,
|
||||
color: '#FF3961',
|
||||
dashArray: "0",
|
||||
dashArray: '0',
|
||||
fillOpacity: 0
|
||||
});
|
||||
|
||||
|
@ -351,18 +365,18 @@ Promise.all([boundaries, branchesCsv, ikcCsv, mechanics, nslaBranches])
|
|||
<strong>${props.name}</strong>` +
|
||||
`<p>Fines: ` +
|
||||
(
|
||||
props.fines === "no" ? "No" :
|
||||
props.fines == "no_unconfirmed" ? "Probably no" :
|
||||
props.fines === "yes" ? "Yes" :
|
||||
props.fines == "adults" ? "No for children" :
|
||||
props.fines == "by_lga" ? "Varies by LGA" : "Unknown"
|
||||
props.fines === 'no' ? 'No' :
|
||||
props.fines == 'no_unconfirmed' ? 'Probably no' :
|
||||
props.fines === 'yes' ? 'Yes' :
|
||||
props.fines == 'adults' ? 'No for children' :
|
||||
props.fines == 'by_lga' ? 'Varies by LGA' : 'Unknown'
|
||||
) +
|
||||
`<br/>Loans : ` +
|
||||
(!props.standard_loan_weeks || props.standard_loan_weeks == "?" ? `Unknown` : `${props.standard_loan_weeks} weeks`) +
|
||||
(!props.standard_loan_weeks || props.standard_loan_weeks == '?' ? `Unknown` : `${props.standard_loan_weeks} weeks`) +
|
||||
`<br/>Software : ` +
|
||||
(!props.ILS || props.ILS == "?" ? `Unknown` : `${props.ILS}`) +
|
||||
(!props.ILS || props.ILS == '?' ? `Unknown` : `${props.ILS}`) +
|
||||
`<br/>Website: ` +
|
||||
(!props.website || props.website == "?" ? `Unknown` : `<a target="_blank" href="`+ `${props.website}` + `" >` + `${props.website}` + `</a>`) +
|
||||
(!props.website || props.website == '?' ? `Unknown` : `<a target="_blank" href="`+ `${props.website}` + `" >` + `${props.website}` + `</a>`) +
|
||||
`</p>`
|
||||
).openPopup()
|
||||
}
|
||||
|
@ -479,6 +493,12 @@ Promise.all([boundaries, branchesCsv, ikcCsv, mechanics, nslaBranches])
|
|||
// we remove info boxes before adding them again where relevant
|
||||
// this is so we don't accidentally stack up multiple copies dependng on user
|
||||
// navigation journey
|
||||
|
||||
var ilsMaps = {
|
||||
"NSLA Libraries" : nslaLibs,
|
||||
"Local Libraries" : ils
|
||||
}
|
||||
|
||||
map.on('baselayerchange', l => {
|
||||
for (let k in infoBoxes) {
|
||||
infoBoxes[k].remove()
|
||||
|
@ -493,7 +513,11 @@ Promise.all([boundaries, branchesCsv, ikcCsv, mechanics, nslaBranches])
|
|||
mapControl.removeLayer(overlayMaps[i])
|
||||
overlayMaps[i].remove()
|
||||
}
|
||||
ils.remove()
|
||||
for (let i in ilsMaps ) {
|
||||
mapControl.removeLayer(ilsMaps[i])
|
||||
ilsMaps[i].remove()
|
||||
}
|
||||
// ils.remove()
|
||||
if (!isSmallScreen) { // only add infoboxes to larger screens
|
||||
infoBoxes.loanPeriod.addTo(map)
|
||||
infoBoxes.fines.addTo(map)
|
||||
|
@ -510,14 +534,24 @@ Promise.all([boundaries, branchesCsv, ikcCsv, mechanics, nslaBranches])
|
|||
fines.remove()
|
||||
loanPeriod.remove()
|
||||
// add ILS layer
|
||||
// TODO: here we add NSLA libraries
|
||||
// mapControl.addOverlay(nslaLibs, "National/State libraries")
|
||||
// mapControl.addOverlay(ils, "Local Libraries")
|
||||
ils.addTo(map)
|
||||
nslaLibs.addTo(map)
|
||||
for (let k in ilsMaps ) {
|
||||
mapControl.addOverlay(ilsMaps[k], k)
|
||||
}
|
||||
} else {
|
||||
// if 'Libraries' layer...
|
||||
mapControl.removeLayer(fines)
|
||||
mapControl.removeLayer(loanPeriod)
|
||||
fines.remove()
|
||||
loanPeriod.remove()
|
||||
ils.remove()
|
||||
for (let i in ilsMaps ) {
|
||||
mapControl.removeLayer(ilsMaps[i])
|
||||
ilsMaps[i].remove()
|
||||
}
|
||||
branches.addTo(map)
|
||||
for (let k in overlayMaps ) {
|
||||
mapControl.addOverlay(overlayMaps[k], k)
|
||||
|
|
Loading…
Reference in a new issue