简体   繁体   中英

How to change language of angular leaflet-map?

Is it possible to change the language of leaflet map tiles? Like changing the names of country and states to the preferred language like German/french/Chinese which ever user chooses.Thanks in advance..

Maybe this plugin is for you : https://github.com/buche/leaflet-languageselector

EDIT :

The problem is that you're using tiles which are only png files. You can see in your network console the files loading when you zoom. It look like this :

单张瓷砖

在此处输入图片说明

It's not pure HTML/CSS so you can't have access to the name of countries and change it to the desired language.

You would need to render your own tiles or find another tile provider here : http://leaflet-extras.github.io/leaflet-providers/preview/ (which is not really great ...)

You can also try mapbox because they are using vector : https://www.mapbox.com/help/change-language/

https://www.mapbox.com/help/change-language/#change-label-language-in-mapbox-studio-classic

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