@hlfan 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());
Overriding `L.MaplibreGL._initGL()` is unreasonable now, but when Leaflet is
dropped, we could make this a part of `OSM.MapLibre.Map`.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6683#pullrequestreview-3704336773
You are receiving this because you are subscribed to this thread.
Message ID:
<openstreetmap/openstreetmap-website/pull/6683/review/[email protected]>_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev