@CommanderStorm 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;

If it is possible with resonable effort, that would be another step into the 
direction where "we" want to go.

Removing this is on my TODO list for the second-to-last MapLibre migration PR, 
but if we can pull this out this again makes the diff smaller.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6772#discussion_r2774199384
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