[openstreetmap/openstreetmap-website] Manage map tiles dark mode with leaflet-osm plugin (PR #4777)

Anton Khorev notifications at github.com
Thu May 9 14:32:51 UTC 2024


I guess #4769 meant "how about we use dark tile variants when available". If [Transport Dark](https://www.thunderforest.com/maps/transport-dark/) is approved to be used on the osm website, we can switch to it in dark mode when "Transport Map" is selected.

Here's how it can work together with prefers-color-scheme switching from #4761:

![image](https://github.com/openstreetmap/openstreetmap-website/assets/4158490/8f0000ba-04f5-4540-ae9d-ce73f16bd770)
![image](https://github.com/openstreetmap/openstreetmap-website/assets/4158490/381f1092-55fb-433c-87a2-93dbfae9a105)
![image](https://github.com/openstreetmap/openstreetmap-website/assets/4158490/ea3f6bbb-f703-48e1-8b40-ad84a64f035b)
![image](https://github.com/openstreetmap/openstreetmap-website/assets/4158490/d2b9c0e5-2688-4f45-9b25-fbb90b829546)

Layers without alternative dark tiles get dimmed, layers with switch to their alternative tiles.

I modified leaflet-osm in this repository directly. Is https://github.com/openstreetmap/leaflet-osm maintained? Its [npm package](https://www.npmjs.com/package/leaflet-osm) was last updated years ago.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/4777

-- Commit Summary --

  * Manage map tiles dark mode with leaflet-osm plugin

-- File Changes --

    M app/assets/javascripts/application.js (2)
    M app/assets/stylesheets/common.scss (1)
    M vendor/assets/leaflet/leaflet.osm.js (60)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/4777.patch
https://github.com/openstreetmap/openstreetmap-website/pull/4777.diff

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

Message ID: <openstreetmap/openstreetmap-website/pull/4777 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240509/6919f96f/attachment.htm>


More information about the rails-dev mailing list