[openstreetmap/openstreetmap-website] Use map tiles dark mode from leaflet-osm plugin (PR #5426)

Marwin Hochfelsner notifications at github.com
Mon Dec 30 12:51:20 UTC 2024


@hlfan commented on this pull request.



> @@ -31,6 +31,9 @@ L.OSM.layers = function (options) {
         var miniMap = L.map(mapContainer[0], { attributionControl: false, zoomControl: false, keyboard: false })
           .addLayer(new layer.constructor(layer.options));
 
+        if (layer.options.schemeClass) miniMap.getPane("tilePane").classList.add(layer.options.schemeClass);
+        miniMap.getPane("tilePane").style.setProperty("--dark-mode-map-filter", layer.options.filter || "none");

If the dark flag/class should have special treatment, should thunderforest-cycle get a special `nofilter` class as the first layer where the default from the current proposal https://github.com/openstreetmap/openstreetmap-website/issues/5328#issuecomment-2539051340 is explicitly asked for (https://github.com/openstreetmap/openstreetmap-website/issues/5395#issuecomment-2538451264)? And should further layers also get a class each?

Do you think it is favorable to spread the map layer filter definitions that much into CSS as well? I think having the way the layers from leaflet-osm are used in a single location including filters adds to the maintainability.

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

Message ID: <openstreetmap/openstreetmap-website/pull/5426/review/2525552189 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20241230/6e566245/attachment-0001.htm>


More information about the rails-dev mailing list