我正在使用leafletjs - http://leafletjs.com/
我需要将图层和覆盖文本本地化为用户选择的语言。
传单代码是这样的:
// create map
map = L.map('map', {
center: [dlat, dlng],
zoom: dzoom,
layers: [osmap, markersgroup, POIgroup, mylayergroup, fencesgroup]
});
var baseLayers = {
"Normal": osmap,
"Satellite": satellite
};
var overlays = {
"All Markers": markersgroup,
"Online Markers": onlinegroup,
"Offline Markers": offlinegroup,
"Live Markers": livegroup
};
如您所见,覆盖名称设置为“所有标记”、“在线标记”等。我需要能够选择这些并更改为法语、西班牙语字符串。
html 呈现如下:
<div class="leaflet-control-layers-overlays">
<label>
<input type="checkbox" class="leaflet-control-layers-selector" checked="">
<span> All Markers</span>
</label>
<label>
<input type="checkbox" class="leaflet-control-layers-selector">
<span> Online Markers</span>
</label>
<label>
<input type="checkbox" class="leaflet-control-layers-selector">
<span> Offline Markers</span>
</label>
<label>
<input type="checkbox" class="leaflet-control-layers-selector">
<span> Live Markers</span>
</label>
</div>
我可以span
在每个中选择label
并手动重命名吗?