@CommanderStorm commented on this pull request.
> + if (layer.options.leafletOsmId === "OpenMapTiles") {
+ OSM.MapLibre.setMapLanguage(miniMap);
+ }
> So this is setting the language (which currently only affects the
> OpenMapTiles layer) but only if the main map...
> it's changing global state anyway, and once at page load time (once the main
> map is initialised) so it depends on the initial layer
No, this is setting the OpenMapTiles minimap's language.
It is not changing global state or affected by the main map.
It is affected by the
- global state of what the prefered language is and
- the local state which languages the style supports.
Since there is no way to change the language without a reload cycle, no further
action is required.
Am I missing something?
> As the language is global state I suspect it should just be set once when
> MapLibre is initialised and regardless of what layers are active?
Since currently only OMT supports this, I think the current approach is fine.
Raster layers won't support languages, but Shortbread might.
I can remove the if statement if you want.
I am unusure if the current approach is compatible
CC @pnorman
Should I enable this for shortbread too, or is the following more of a
far-future?
- https://github.com/shortbread-tiles/shortbread-docs/pull/106/changes
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6683#discussion_r2702367739
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