[openstreetmap/openstreetmap-website] Use map tiles dark mode with leaflet-osm plugin (PR #5396)
Marwin Hochfelsner
notifications at github.com
Thu Dec 12 19:23:27 UTC 2024
This lean and updated variant of #4777 follows the rules laid out in #5328 that were implemented in #5362.
Since the editing of the user preference happens on a different view/site, there is no need to listen to color scheme changes on the fly and the whole logic can happen in the initialization of `L.OSM.TileLayer`.
|Before|After|
|-|-|
|||
Additionally, a "dark" CSS class is introduced to allow better style targeting if the user wants to.
for example like this:

You can view, comment on, or merge this pull request online at:
https://github.com/openstreetmap/openstreetmap-website/pull/5396
-- Commit Summary --
* Add an OSM.isDarkMap() function
* Use schemed map properties in L.OSM.TileLayer initialization
* Add dark Transport map url
* Use the schemed map urls
* Set normal tile display as standard
* Let the main map pass its filters to the keys
-- File Changes --
M app/assets/javascripts/osm.js.erb (8)
M app/assets/stylesheets/common.scss (2)
M vendor/assets/leaflet/leaflet.osm.js (14)
-- Patch Links --
https://github.com/openstreetmap/openstreetmap-website/pull/5396.patch
https://github.com/openstreetmap/openstreetmap-website/pull/5396.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5396
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/5396 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20241212/10ff4538/attachment.htm>
More information about the rails-dev
mailing list