diff --git a/website/load-map.js b/website/load-map.js
index c021719..176ab70 100644
--- a/website/load-map.js
+++ b/website/load-map.js
@@ -1,5 +1,5 @@
// add tile layer from OSM
-var baseMap = L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
+const baseMap = L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
attribution: 'Map data © OpenStreetMap contributors, CC-BY-SA, Imagery © Mapbox',
maxZoom: 18,
id: 'mapbox/dark-v10',
@@ -8,7 +8,7 @@ var baseMap = L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/
accessToken: 'pk.eyJ1IjoiaHVnaHIiLCJhIjoiY2lxenRqMGQyMDJvdWZwbWd0d2JxeGswNiJ9.vfUQRJDzbJhaG_865TSkPA'
});
-var baseRules = L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
+const baseRules = L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
attribution: 'Map data © OpenStreetMap contributors, CC-BY-SA, Imagery © Mapbox
Incorporates Administrative Boundaries ©PSMA Australia Limited licensed by the Commonwealth of Australia under Creative Commons Attribution 4.0 International licence (CC BY 4.0).',
maxZoom: 18,
id: 'mapbox/light-v10',
@@ -18,7 +18,7 @@ var baseRules = L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}
});
// attach map to #mapid div above and centre
-var map = L.map('mapid', {
+const map = L.map('mapid', {
center: [-27.00, 133.000],
zoom: 5,
layers: [baseMap]
@@ -43,7 +43,7 @@ L.TopoJSON = L.GeoJSON.extend({
// -----------------------------------------------------------------
// library services fines overlay
-var fines = new L.TopoJSON(libraryServices, {
+const fines = new L.TopoJSON(libraryServices, {
style: function(feature){
return {
fillColor: getFinesColor(feature.properties.fines),
@@ -64,7 +64,7 @@ onEachFeature: function onEachFeature(feature, layer) {
// fill patterns for loan period overlay
-var circles = new L.PatternCircle({
+const circles = new L.PatternCircle({
color: '#000',
weight: 1,
radius: 2,
@@ -74,7 +74,7 @@ var circles = new L.PatternCircle({
fillOpacity: 1
});
-var loanTwo = new L.Pattern({
+const loanTwo = new L.Pattern({
width: 8,
height: 8
})
@@ -82,12 +82,12 @@ var loanTwo = new L.Pattern({
loanTwo.addShape(circles);
loanTwo.addTo(map);
-var loanThree = new L.StripePattern({
+const loanThree = new L.StripePattern({
color: '#000'
});
loanThree.addTo(map);
-var loanFour = new L.StripePattern({
+const loanFour = new L.StripePattern({
color: '#000',
weight: 6,
spaceWeight: 2,
@@ -95,7 +95,7 @@ angle: 45
});
loanFour.addTo(map);
-var loanSix = new L.StripePattern({
+const loanSix = new L.StripePattern({
color: '#000',
weight: 2,
spaceWeight: 6,
@@ -104,15 +104,15 @@ var loanSix = new L.StripePattern({
loanSix.addTo(map);
function getLoanFillPattern(w) {
-return w == '2' ? loanTwo :
- w == '3' ? loanThree :
- w == '4' ? loanFour :
- w == '6' ? loanSix : null
+ return w == '2' ? loanTwo :
+ w == '3' ? loanThree :
+ w == '4' ? loanFour :
+ w == '6' ? loanSix : null
}
// loan period overlay
-var loanPeriod = new L.TopoJSON(libraryServices, {
-style: function(feature){
+const loanPeriod = new L.TopoJSON(libraryServices, {
+ style: function(feature){
return {
weight: 3,
color: "#fff",
@@ -122,12 +122,11 @@ style: function(feature){
fillPattern: getLoanFillPattern(feature.properties.standard_loan_weeks)
}
},
-
-onEachFeature: function onEachFeature(feature, layer) {
- layer.on({
- mouseover: e => highlightFeature(e),
- mouseout: e => resetHighlight(e, loanPeriod),
- click: zoomToFeature
+ onEachFeature: function onEachFeature(feature, layer) {
+ layer.on({
+ mouseover: e => highlightFeature(e),
+ mouseout: e => resetHighlight(e, loanPeriod),
+ click: zoomToFeature
})
}
});
@@ -146,7 +145,7 @@ const branches = L.layerGroup([
pointToLayer: function (feature, latlng) {
return L.circle(latlng, {color: "#FF3961", radius: 800}) // this is an 800m radius around the library
}
- }),
+ }),
L.geoCsv(branchesCsv, {
firstLineTitles: true,
fieldSeparator: ',',
@@ -156,27 +155,27 @@ const branches = L.layerGroup([
`
${feature.properties.address}
` +
`phone: ${feature.properties.phone}
${feature.properties.address}
` +
- `phone: ${feature.properties.phone}
${feature.properties.address}
` +
+ `phone: ${feature.properties.phone}
${feature.properties.address}
` +
`phone: ${feature.properties.phone}
${feature.properties.address}
` +
`phone: ${feature.properties.phone}
${feature.properties.address}
` +
`phone: ${feature.properties.phone}
${feature.properties.address}
` +
`phone: ${feature.properties.phone}
${feature.properties.address}
` +
`phone: ${feature.properties.phone}