Maps Component Country names international

Hi,
is there a way to switch the country names to englisch or german ?

it’s really hard to guess what you want :sweat_smile:

The names are based on the map data provider you’re using, e.g. OpenStreetMap. You have to refer to the documentation of that provider to see if the data is available in internationalized format. As an example, for OpenStreetMap there’s https://openstreetmap.de/ showing e.g. “Großbritannien” next to “Great Britain”.

1 Like

OpenStreetMap

Vaadin Map Component

That’s the difference between openstreetmap.de and openstreetmap.org. Map uses openstreetmap.org by default.

You can make it use openstreetmap.de by creating a custom tile layer in the same way way as the default one, but with a different URL:

XYZSource.Options sourceOptions = new XYZSource.Options();
sourceOptions.setUrl("https://{a-c}.tile.openstreetmap.de/{z}/{x}/{y}.png");
sourceOptions.setAttributions(List.of("<a href=\"https://www.openstreetmap.de/\">© OpenStreetMap</a>"));
sourceOptions.setAttributionsCollapsible(false);
XYZSource source = new XYZSource(sourceOptions);

TileLayer tileLayer = new TileLayer();
tileLayer.setSource(source);
map.setBackgroundLayer(tileLayer);

Thanks a lot. This was exactly what i needed.