[openstreetmap/openstreetmap-website] Use class based map tiles dark mode (PR #5505)
Marwin Hochfelsner
notifications at github.com
Thu Jan 16 19:53:05 UTC 2025
@hlfan commented on this pull request.
> @@ -52,10 +57,12 @@ L.OSM.Map = L.Map.extend({
code: "G"
});
- this.on("layeradd", function (event) {
- if (this.baseLayers.indexOf(event.layer) >= 0) {
- this.setMaxZoom(event.layer.options.maxZoom);
- }
+ this.on("layeradd", function ({ layer }) {
+ if (this.baseLayers.indexOf(layer) < 0) return;
+ this.setMaxZoom(layer.options.maxZoom);
+ const key = document.querySelector(".key-ui");
I've looked further into it, this is on me for having minified leaflet overwrite the `$` function.
This works:
```js
jQuery(".key-ui").attr("class", "key-ui " + layer.options.className);
```
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5505#discussion_r1919121955
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/5505/review/2557169970 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250116/826e776a/attachment.htm>
More information about the rails-dev
mailing list