@hlfan commented on this pull request.


> +  var baseLayers = {
+    cyclosm: ["CyclOSM"],
+    cyclemap: ["CycleMap", thunderforestOptions],
+    transportmap: ["TransportMap", thunderforestOptions],
+    hot: ["HOT"],
+    mapnik: ["Mapnik", mapnikOptions]
+  };
+  baseLayers["cycle map"] = baseLayers.cyclemap;
+  var [layer, options] = baseLayers[args.layer] || baseLayers.mapnik;
+  new L.OSM[layer](options || {}).addTo(map);

I also think big potential here was hidden in the else-if chain. I definitely 
can see the next version here be 
[layers.yml](//github.com/openstreetmap/openstreetmap-website/blob/master/config/layers.yml)-based,
 but it should be filtered to what's necessary and include toggling to 
`leafletOsmDarkId`.
And I haven't figured out how to do that compactly so this is more of a 
stop-gap that I can throw a ternary onto to add dark mode later.

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

Message ID: 
<openstreetmap/openstreetmap-website/pull/5550/review/2575047...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to