@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/2500844...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to