From a596f959d00a0bbde1c51fdf8fb0e9ffdc4c6787 Mon Sep 17 00:00:00 2001 From: Marwin Hochfelsner <50826859+hlfan@users.noreply.github.com> Date: Thu, 12 Dec 2024 20:58:58 +0100 Subject: [PATCH] Get the layer container the right way --- vendor/assets/leaflet/leaflet.osm.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/vendor/assets/leaflet/leaflet.osm.js b/vendor/assets/leaflet/leaflet.osm.js index e9279c4d4a..ce1609a9c8 100644 --- a/vendor/assets/leaflet/leaflet.osm.js +++ b/vendor/assets/leaflet/leaflet.osm.js @@ -14,10 +14,11 @@ L.OSM.TileLayer = L.TileLayer.extend({ if (url) this.schemeClass = isDarkMap ? 'dark' : 'light'; L.TileLayer.prototype.initialize.call(this, url || options.url); this.on('add', function () { - 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); + container = this.getContainer(); + if (container) { + if (this.schemeClass) container.classList.add(this.schemeClass); + container.style.setProperty('--dark-mode-map-filter', this.options.filter); + if (document.getElementById('map').contains(container)) document.querySelector('.key-ui').style.setProperty('--dark-mode-map-filter', this.options.filter); } }); }