42

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);
JohnP
  • 49,507
  • 13
  • 108
  • 140

3 Answers3

22

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.

DineshKP
  • 364
  • 2
  • 12
scai
  • 20,297
  • 4
  • 56
  • 72
  • Thanks, I will check these out. I'm using the tile server for a prototype app, and will be switching to a different paid server or most likely roll our own soon. – JohnP Sep 04 '13 at 05:41
  • 5
    I went with open mapquest. For anyone with the same question, here's a handy list of tile servers you can use - https://gist.github.com/mourner/1804938 – JohnP Sep 04 '13 at 09:46
  • Thanks! Unfortunately the corresponding project is dead. I updated my answer. – scai Mar 20 '17 at 07:45
9

All you need to do is to work with basemaps instead of openstreetmap

const mainLayer = L.tileLayer('https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}.png', {
  minZoom: 3,
  maxZoom: 17,
  attribution: '&copy; <a href="https://carto.com/">carto.com</a> contributors'
});
mainLayer.addTo(this.map);
5

For German language

You can use this german tile server: https://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png.

L.tileLayer('https://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png', {
  ...
})
...
Ergis
  • 1,105
  • 1
  • 7
  • 18
Shaheel_Azhar
  • 73
  • 2
  • 7
  • in case someone would like to do the same, but for French: L.tileLayer('https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png', { maxZoom: 100, minZoom: 1, attribution : '© OpenStreetMap contributors', noWrap : true }); Also a good link to check for tiles url: https://wiki.openstreetmap.org/wiki/Tile_servers – manfall19 Nov 04 '21 at 13:08