Merge pull request #29 from hughrun/mode-switch
change naming of library view modes
This commit is contained in:
commit
131136c97d
8
about.md
8
about.md
|
@ -42,16 +42,18 @@ Library locations are classified into four types. In general mode these are:
|
|||
|
||||
* Settler Knowledge Centres
|
||||
* Indigenous Knowledge Centres
|
||||
* Worker Pacification Centres
|
||||
* Imperial Knowledge Centres
|
||||
* Mechanics Institutes
|
||||
* Colonial Knowledge Centres
|
||||
|
||||
If this naming convention makes you uncomfortable, you may view the map in *White fragility mode*, in which case the names are:
|
||||
If this naming convention is confusing, you may view the map in *Colonial mode*, in which case the names are:
|
||||
|
||||
* Public Libraries
|
||||
* Indigenous Knowledge Centres
|
||||
* Mechanics Institutes
|
||||
* National & State Libraries
|
||||
|
||||
Standard Mode invites you to think about the work these institutions do to normalise certain types of knowledge and not others.
|
||||
|
||||
### Important files that are not in this repository
|
||||
|
||||
If you look at `merge_service_data.py` you will notice that there are two files used in creating `website/data/boundaries.topo.json` that are missing from this repository:
|
||||
|
|
|
@ -47,20 +47,21 @@
|
|||
<h3 id="caveats">Caveats</h3>
|
||||
<p>Most of the data for the map comes from government open data sources. As such it is subject to government bias, and may be out of date or over/under sampled. I make no claim or warranty that the data being complete, accurate, or up to date — though I aim for it to be all of those things. If in doubt, always check with the library directly.</p>
|
||||
<h3 id="nomenclature">Nomenclature</h3>
|
||||
<p>Library locations are classified into four types. In general mode these are:</p>
|
||||
<p>Library locations are classified into four types. In Standard Mode these are:</p>
|
||||
<ul>
|
||||
<li>Settler Knowledge Centres</li>
|
||||
<li>Indigenous Knowledge Centres</li>
|
||||
<li>Worker Pacification Centres</li>
|
||||
<li>Imperial Knowledge Centres</li>
|
||||
<li>Mechanics Institutes</li>
|
||||
<li>Colonial Knowledge Centres</li>
|
||||
</ul>
|
||||
<p>If this naming convention makes you uncomfortable, you may view the map in <em>White fragility mode</em>, in which case the names are:</p>
|
||||
<p>If this naming convention is confusing, you may view the map in <em>Colonial Mode</em>, in which case the names are:</p>
|
||||
<ul>
|
||||
<li>Public Libraries</li>
|
||||
<li>Indigenous Knowledge Centres</li>
|
||||
<li>Mechanics Institutes</li>
|
||||
<li>National & State Libraries</li>
|
||||
</ul>
|
||||
<p>Standard Mode invites you to think about the work these institutions do to normalise certain types of knowledge and not others.</p>
|
||||
</section>
|
||||
</main>
|
||||
<footer>
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
|
||||
<div id="mode-switch">
|
||||
<div></div>
|
||||
<button id="mode-button" name="mode-button">View in White Fragility Mode</button>
|
||||
<button id="mode-button" name="mode-button" class="hidden"></button>
|
||||
</div>
|
||||
<!-- div to attach everything to -->
|
||||
<div id="mapid"></div>
|
||||
|
|
|
@ -329,24 +329,26 @@ Promise.all([boundaries, branchesCsv, ikcCsv, mechanics, nslaBranches])
|
|||
overlayMaps = {
|
||||
"Settler Knowledge Centres" : branches,
|
||||
"Indigenous Knowledge Centres" : ikcs,
|
||||
"Worker Pacification Centres" : mechsAndSoA,
|
||||
"Imperial Knowledge Centres": otherLibs
|
||||
"Mechanics Institutes" : mechsAndSoA,
|
||||
"Colonial Knowledge Centres" : otherLibs
|
||||
}
|
||||
modeButton.innerText = "View in White Fragility mode";
|
||||
modeButton.setAttribute('class', 'visible');
|
||||
modeButton.innerText = "View in Colonial Mode";
|
||||
}
|
||||
|
||||
function setFragile() {
|
||||
function setColonial() {
|
||||
overlayMaps = {
|
||||
"Public Libraries" : branches,
|
||||
"Indigenous Knowledge Centres" : ikcs,
|
||||
"Mechanics Institutes" : mechsAndSoA,
|
||||
"National & State Libraries" : otherLibs
|
||||
};
|
||||
modeButton.innerText = "View in General mode";
|
||||
modeButton.setAttribute('class', 'visible');
|
||||
modeButton.innerText = "View in Standard Mode";
|
||||
}
|
||||
|
||||
if (sessionStorage.getItem('mapMode') === 'fragile') {
|
||||
setFragile()
|
||||
if (sessionStorage.getItem('mapMode') === 'colonial') {
|
||||
setColonial()
|
||||
} else {
|
||||
setGeneral()
|
||||
}
|
||||
|
@ -369,9 +371,9 @@ Promise.all([boundaries, branchesCsv, ikcCsv, mechanics, nslaBranches])
|
|||
serviceInfo: L.control({position: 'topleft'})
|
||||
}
|
||||
|
||||
// switching mode between standard and fragile
|
||||
// switching mode between standard and colonial
|
||||
function switchMode() {
|
||||
if (sessionStorage.getItem('mapMode') === 'fragile') {
|
||||
if (sessionStorage.getItem('mapMode') === 'colonial') {
|
||||
sessionStorage.setItem('mapMode', 'general');
|
||||
setGeneral()
|
||||
mapControl.remove();
|
||||
|
@ -381,8 +383,8 @@ Promise.all([boundaries, branchesCsv, ikcCsv, mechanics, nslaBranches])
|
|||
infoBoxes.branches.addTo(map)
|
||||
}
|
||||
} else {
|
||||
sessionStorage.setItem('mapMode', 'fragile');
|
||||
setFragile()
|
||||
sessionStorage.setItem('mapMode', 'colonial');
|
||||
setColonial()
|
||||
mapControl.remove();
|
||||
infoBoxes.branches.remove()
|
||||
mapControl = L.control.layers(baseMaps, overlayMaps, {"collapsed": isSmallScreen}).addTo(map);
|
||||
|
@ -441,7 +443,6 @@ Promise.all([boundaries, branchesCsv, ikcCsv, mechanics, nslaBranches])
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
function zoomToFeature(e, props) {
|
||||
map.fitBounds(e.target.getBounds());
|
||||
e.target.bindPopup(`
|
||||
|
|
Loading…
Reference in a new issue