简体   繁体   English

如何更改OpenLayers 5.3的平铺语言

[英]how to change OpenLayers 5.3's tile language

I am working on a map application using OpenLayers 5.3.0. 我正在使用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. 我搜索了官方API文档,但找不到与i18或语言相关的属性。

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. 这与您用来代替openlayers的地图图块服务有关。 OpenStreetMap defaults to the local or official language in each part of the world. OpenStreetMap默认使用世界各地的本地或官方语言。 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 关于地图国际化的 OSM Wiki, 更多图块

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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