aboutsummaryrefslogtreecommitdiff
path: root/web/public/javascripts/map.js
diff options
context:
space:
mode:
authorKumar Damani <kumar.damani@mail.utoronto.ca>2019-04-23 23:17:07 +0000
committerKumar Damani <kumar.damani@mail.utoronto.ca>2019-04-23 23:17:07 +0000
commit48ed2c8cfda61fd9c0e0fe1594dec4f16d7a38af (patch)
treece9b9effbf5038b0762186e88607437a8339a6b3 /web/public/javascripts/map.js
parenta7fa4d95f7e5bb30c5c25bd4bc97881045b6a1fa (diff)
removed js library for dark mode basemapHH-feat-2
Diffstat (limited to 'web/public/javascripts/map.js')
-rw-r--r--web/public/javascripts/map.js11
1 files changed, 4 insertions, 7 deletions
diff --git a/web/public/javascripts/map.js b/web/public/javascripts/map.js
index 23f4ec0..db50cbe 100644
--- a/web/public/javascripts/map.js
+++ b/web/public/javascripts/map.js
@@ -216,26 +216,23 @@ function initLiveLoading() {
}
}
-function getModeFilter(darkmode) {
- return darkmode ? ['hue:186deg', 'invert:100%'] : [];
-}
-
function toggleDarkMap(e) {
- mainTileLayer.updateFilter(getModeFilter(!darkmode));
darkmode = !darkmode;
+ document.getElementById('map').style['-webkit-filter'] =
+ document.getElementById('sidebar').style['-webkit-filter'] =
+ (darkmode) ? "invert(100%)" : "invert(0%)";
}
let toggleDarkModeBtn = document.getElementById('toggle-btn')
.addEventListener("click", toggleDarkMap);
// different basemap
-let mainTileLayer = L.tileLayer.colorFilter('https://stamen-tiles-{s}.a.ssl.fastly.net/toner-lite/{z}/{x}/{y}{r}.{ext}', {
+let mainTileLayer = L.tileLayer('https://stamen-tiles-{s}.a.ssl.fastly.net/toner-lite/{z}/{x}/{y}{r}.{ext}', {
attribution: 'Map tiles by <a href="http://stamen.com">Stamen Design</a>, <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> &mdash; Map data &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
subdomains: 'abcd',
minZoom: 0,
maxZoom: 18,
ext: 'png',
- filter: [],
}).addTo(map);
// keep track of the boundary of the markers so that we can update the