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

Tom Hughes notifications at github.com
Wed Dec 18 13:45:33 UTC 2024


> But I found it too hacky to overwrite the class's properties from the instance each time, and I especially wanted to avoid using `__proto__`. Yet I couldn't find a way to do that.

I don't see any reason why what I was suggesting would need any of that but I've actually come up with a better solution now.

What really bothered me was having the URL sometimes in leaflet-osm and sometimes here, so what I've done is to add a new `TransportDarkMap` layer to leaflet-osm in https://github.com/openstreetmap/leaflet-osm/commit/ebfaf22426c265aaf3f401d70ffd02ca920623c9.

So now we can have a `leafletOsmDarkId: "TransportDarkMap"` key in `layers.yml` and if that key exists we construct that layer instead of the normal one and then don't do any filtering.

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

Message ID: <openstreetmap/openstreetmap-website/pull/5397/c2551365251 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20241218/eb5892ba/attachment-0001.htm>


More information about the rails-dev mailing list