简体   繁体   中英

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? 日本瓷砖地图

Thanks for answering.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM