Search code examples
javascriptjqueryopenlayersopenlayers-5

how to change OpenLayers 5.3's tile language


I am working on a map application using OpenLayers 5.3.0.

How can I change the language for the map tiles? when I view Japan or Korea, all the places are displayed in the local language.

How can I change it to English?

I searched on the official API doc, but I was not able to find the attribute related to i18 or language.

This is how I initialize the Map

map = new ol.Map({
        target: 'map',
        layers: [
            new ol.layer.Tile({
                preload: 3,
                source: new ol.source.OSM()
            }),
            vectorLayer
        ],
        overlays: [overlay],
        loadTilesWhileAnimating: true,
        view: new ol.View({
            center: ol.proj.fromLonLat([2.896372, 44.60240]),
            zoom: 3
        })
    });

How can I change this tile to English? japan tile map

Thanks for answering.


Solution

  • when I view Japan or Korea, all the places are displayed in the local language.

    This relates to map tile service that you used instead of openlayers. OpenStreetMap defaults to the local or official language in each part of the world. So all the places in Japan or Korea are displayed in the local language.

    There are some tile sources. OSM wiki about Map Internationalization, more tiles