2

I am working on a Shiny application where I am required to plot positions of ships on a map. Currently I am using leaflet and the OpenSeaMap as the base layer on which I am plotting the positions (addProviderTiles(providers$OpenSeaMap)). However, when the map is rendered the various cities and ports appear in the local language as shown below: enter image description here That's not very useful as the users are mostly English speaking. Is there any way in changing the tiles to display only English names? I have already had a look at this. I am restricted to using the OpenSeaMap tiles only because of the traffic separation schemes displayed in those tiles.

Dhiraj
  • 1,650
  • 1
  • 18
  • 44
  • 2
    Possible duplicate of [R leaflet Language of the map : Can we specify to use English language](https://stackoverflow.com/questions/38638103/r-leaflet-language-of-the-map-can-we-specify-to-use-english-language) – Iman Aug 05 '18 at 15:13
  • @imi I did have a look at that and I am already using a specific tile from leaflet-providers (`OpenSeaMap`) as mentioned in my post. I have to compulsarily use that particular tile because of the traffic separation schemes displayed in it. Hence the question. – Dhiraj Aug 05 '18 at 15:55

1 Answers1

1

If you have to stick to OpenSeaMap tiles then no, you can't change the language of the labels. Unfortunately these Labels are part of the raster images, they are not a separate layer.

However OpenSeaMap is composed of a base layer and a seamark layer (https://tiles.openseamap.org/seamark/). The base layer containing the map, city labels and so on is the OSM standard style and can be replaced by any other layer. So you can use a tile server with English labels plus the seamark layer on top of it.

If this is not a solution for you then how about adding an additional layer with English labels? So your users can at least switch to a layer with labels they can read, browse to the area they want to view, then switch back to OpenSeaMap tiles to see sea marks. Not a nice solution but it works.

scai
  • 20,297
  • 4
  • 56
  • 72
  • thanks for the two solutions. Will try the first option, though I don't have any experience with tile servers. The second option, though not very elegant, is still a solution. Thanks again for this, appreciate. – Dhiraj Aug 06 '18 at 12:44
  • See https://leaflet-extras.github.io/leaflet-providers/preview/ for a list of possible tile servers and their URLs. Unfortunately I have no experience with R so I can't explain how to use them in R. – scai Aug 06 '18 at 12:47
  • what is it with questions about `leaflet` that nobody uses any code? – Fons MA Feb 24 '22 at 22:00