[openstreetmap/openstreetmap-website] Generate maplibre styles from `layers.yml` (PR #6772)

Frank Elsinga notifications at github.com
Thu Feb 5 22:52:47 UTC 2026


@CommanderStorm commented on this pull request.



> @@ -6,7 +6,7 @@
   canEmbed: true
   canDownloadImage: true
   maxZoom: 19
-  tileUrl: "https://tile.openstreetmap.org/{zoom}/{x}/{y}.png"
+  tileUrl: "https://tile.openstreetmap.org/{z}/{x}/{y}.png"

To explain:
the ID scheme uses `{zoom}`, which is why I did it this way.
I don't care if it is `{zoom}` or `{z}`.

>      ) => {
       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;

In the maplibre change, I changed this since I NEEEDED leafletOsmId to be set to the exact style that is chosen on the main map (i.e. for the dark mode style, the dark mode).

Since this is now moved upstream, the previous version is fine again.

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

Message ID: <openstreetmap/openstreetmap-website/pull/6772/review/3759831735 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260205/f40a7a1f/attachment.htm>


More information about the rails-dev mailing list