@hlfan commented on this pull request.


>      ) => {
       if (credit) layerOptions.attribution = makeAttribution(credit);
       if (nameId) layerOptions.name = 
OSM.i18n.t(`javascripts.map.base.${nameId}`);
 
-      if (OSM.isDarkMap() && L.OSM[leafletOsmDarkId]) {
-        layerOptions.leafletOsmId = leafletOsmDarkId;
-      } else if (L.OSM[leafletOsmId]) {
-        layerOptions.leafletOsmId = leafletOsmId;
-      } else {
-        layerOptions.leafletOsmId = "TileLayer";
-      }
-
-      const layerConstructor = L.OSM[layerOptions.leafletOsmId];
+      const layerConstructor =
+        (OSM.isDarkMap() && L.OSM[leafletOsmDarkId]) ||
+        L.OSM[leafletOsmId] ||
+        L.OSM.TileLayer;

I've pondered preemptively ditching the L.OSM layers for a single source of 
truth. What do you think of that?

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

Message ID: 
<openstreetmap/openstreetmap-website/pull/6772/review/[email protected]>
_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to