[openstreetmap/openstreetmap-website] Use map tiles dark mode with leaflet-osm plugin (PR #5396)
Marwin Hochfelsner
notifications at github.com
Thu Dec 12 21:48:01 UTC 2024
@hlfan commented on this pull request.
> options = L.Util.setOptions(this, options);
- L.TileLayer.prototype.initialize.call(this, options.url);
+ url = isDarkMap ? options.darkUrl : options.lightUrl;
Well, if the provided layers can be expected always to be a light-mode-first choice, the logic can be simplified to this more unreadable version:
```js
options.filter = isDarkMap && options.darkFilter || 'none';
options = L.Util.setOptions(this, options);
url = isDarkMap && options.darkUrl;
this.schemeClass = url && 'dark';
```
But I thought an implementation agnostic to that would be easier to think through with more options for cartographers' choices.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5396#discussion_r1882932337
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/5396/review/2500844037 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20241212/c792b2d0/attachment.htm>
More information about the rails-dev
mailing list