[openstreetmap/openstreetmap-website] Minimap migration from Leaflet to MapLibre (PR #6683)

Frank Elsinga notifications at github.com
Thu Jan 29 10:54:06 UTC 2026


@CommanderStorm commented on this pull request.



> @@ -12,20 +13,7 @@ L.OSM.OpenMapTiles = L.OSM.MaplibreGL.extend({
   },
   onAdd: function (map) {
     L.OSM.MaplibreGL.prototype.onAdd.call(this, map);
-    const maplibreMap = this.getMaplibreMap();
-    const supportedLanguages = maplibregl.Map.prototype.supportedLanguages;
-    for (const preferredLanguage of OSM.preferred_languages) {
-      const normalizedPreferredLanguage = preferredLanguage
-        .toLowerCase()
-        .replace("-", "_");
-      const matchedLanguage = supportedLanguages.find(
-        (supported) => supported.toLowerCase() === normalizedPreferredLanguage
-      );
-      if (matchedLanguage) {
-        maplibreMap.setLanguage(matchedLanguage);
-        break;
-      }
-    }
+    OSM.MapLibre.setOMTMapLanguage(this.getMaplibreMap());

We need to rework this system anyhow as @1ec5 noted.
I think pushing this into the future is a good call though, that would get a bit large maybe.

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

Message ID: <openstreetmap/openstreetmap-website/pull/6683/review/3721991209 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260129/b0bb8870/attachment-0001.htm>


More information about the rails-dev mailing list