Setting map language to English in Openstreetmap with LeafletJS

JohnP picture JohnP · Sep 3, 2013 · Viewed 18.5k times · Source

I'm using LeafletJS to add a map component to my app. Everything is fine and dandy except for the localization of the map. Some country names are shown in the local language (I'm assuming).

Is there a way to show the country names in English?

enter image description here

This is the current code that I use

L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
                attribution : '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors',
                noWrap      : true 
}).addTo(map);

Answer

scai picture scai · Sep 3, 2013

The standard tile server of OSM tries to display labels in the local language whenever such data is available (local meaning the language of the country currently displayed, not your local language). The tiles, served by the tile server, already contain the labels, so you cannot remove them afterwards. But you can:

And always remember to comply with the tile usage policy of the tile server you choose.