[openstreetmap/openstreetmap-website] Use class based map tiles dark mode (PR #5505)

Marwin Hochfelsner notifications at github.com
Thu Jan 16 18:52:47 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 tried that multiple ways, but jQuery-based variants always errored out, so I just left it this way.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5505#discussion_r1919040815
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/5505/review/2556984920 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250116/bee734ce/attachment.htm>


More information about the rails-dev mailing list