aboutsummaryrefslogtreecommitdiff
path: root/web/public/javascripts/map.js
diff options
context:
space:
mode:
authorKumar Damani <damani.kumar@gmail.com>2019-04-23 23:18:56 +0000
committerKumar Damani <damani.kumar@gmail.com>2019-04-23 23:18:56 +0000
commit8ba91bfe6950d3dbfae3140b4435f8b17851a5f8 (patch)
tree0b552ba3d749db631fc8ddb534c06303604f097d /web/public/javascripts/map.js
parent7598abdc6c56ed0ca07867c84350c94042952764 (diff)
parent48ed2c8cfda61fd9c0e0fe1594dec4f16d7a38af (diff)
Merge branch 'HH-feat-2' into 'qa'
removed js library for dark mode basemap See merge request kdam0/helpthehomeless!6
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