我想构建一个小型地图应用程序,但是OSM以当地语言(俄语,阿拉伯语等(显示标签。我希望所有标签都使用英语。 大多数建议的是添加" en tag",但我真的找不到任何如何做的例子。
我的地图对象是:
var map = L.map('map', {
center: [mapCenterLat, mapCenterLon],
zoom: 3,
minZoom: 2
});
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
标签应该如何插入OSM URL以显示英语标签?
有关包含多语言名称的栅格和矢量瓷砖服务器的列表,请参见OSM Wiki中的地图国际化。
还要查看OSM Wiki,Mapstyle.petschge.de,传单提供商演示中的瓷砖,并在各种基于OSM的地图上进行比较。他们中的一些人具有全英语的名称。
您可以将USGSTOPO用于英语,只能为我奏效文件。osmdroid中的代码为
map.setTileSource(new OnlineTileSourceBase("USGS Topo", 0, 18, 256, "",
new String[] { "http://basemap.nationalmap.gov/ArcGIS/rest/services/USGSTopo/MapServer/tile/" }) {
@Override
public String getTileURLString(long pMapTileIndex) {
return getBaseUrl()
+ MapTileIndex.getZoom(pMapTileIndex)
+ "/" + MapTileIndex.getY(pMapTileIndex)
+ "/" + MapTileIndex.getX(pMapTileIndex)
+ mImageFilenameEnding;
}
});
您还可以遵循osmdroid文档中提供的链接。这仅适用于英语而不是其他语言。请告知任何具有其他语言的人,特别是俄语。