Skip to content

Add a more realistic example of changing the map language #7148

@1ec5

Description

@1ec5

The “Change a map’s language” example illustrates how to set a layout property, which is an important skill. But if the developer is actually looking for how to localize the map into the user’s preferred language, the usual method is to install a plugin that can automatically localize the map. That way, the developer doesn’t have to know in advance which symbol layers to manipulate.

I think there should be an example of how to install and configure a localization plugin. There doesn’t need to be an example on how to use every plugin, but setting the language is a basic user expectation at this point, similar to enabling right-to-left text support.

There are at least three MapLibre-compatible plugins for localizing the map:

  • Diplomat: still in beta but the most featureful and tileset-agnostic
  • Mapbox GL Language: optimized for Mapbox Streets
  • maplibre-gl-omt-language: optimized for OpenMapTiles (specifically MapTiler’s configuration), undocumented and not under source control but in use on openstreetmap.org

I’ve been working on making Diplomat a no-compromises option for MapLibre GL JS and would be happy to contribute an example of it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions