From 47e252da26fca0292a91160c3e0f54accab8b272 Mon Sep 17 00:00:00 2001 From: Marwin Hochfelsner <50826859+hlfan@users.noreply.github.com> Date: Thu, 12 Dec 2024 20:19:54 +0100 Subject: [PATCH] Let the main map pass its filters to the keys --- vendor/assets/leaflet/leaflet.osm.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/vendor/assets/leaflet/leaflet.osm.js b/vendor/assets/leaflet/leaflet.osm.js index a31b0ac017..e9279c4d4a 100644 --- a/vendor/assets/leaflet/leaflet.osm.js +++ b/vendor/assets/leaflet/leaflet.osm.js @@ -8,14 +8,17 @@ L.OSM.TileLayer = L.TileLayer.extend({ initialize: function (options) { isDarkMap = OSM.isDarkMap(); - options.filter = (isDarkMap ? options.darkFilter : options.lightFilter) || options.filter; + options.filter = (isDarkMap ? options.darkFilter : options.lightFilter) || options.filter || 'none'; options = L.Util.setOptions(this, options); url = isDarkMap ? options.darkUrl : options.lightUrl; if (url) this.schemeClass = isDarkMap ? 'dark' : 'light'; L.TileLayer.prototype.initialize.call(this, url || options.url); this.on('add', function () { - if (this._container && this.schemeClass) this._container.classList.add(this.schemeClass); - if (this._container && this.options.filter) this._container.style.setProperty('--dark-mode-map-filter', this.options.filter); + if (this._container) { + if (this.schemeClass) this._container.classList.add(this.schemeClass); + this._container.style.setProperty('--dark-mode-map-filter', this.options.filter); + if (document.getElementById('map').contains(this._container)) document.querySelector('.key-ui').style.setProperty('--dark-mode-map-filter', this.options.filter); + } }); } });