Is there any way to select the preferred language in SfMaps with Openstreetmaps?

Hello,


I am using SfMaps component and OpenStreetMaps as a Map Provider.

I am trying to display the location's names only in English but unfortunately, it is always displaying the default names for each location, please see the screenshot below: 

In the screenshot, you can see that the UK is displayed in English, Germany in German Poland in Polish etc. 

Image_5868_1704279598634


In the second screenshot, you can see that OpenStreetMap is displaying both names locally and in English (only if the translation is provided).
Image_5033_1704279612992

Is there any way to select the preferred language in SfMaps with Openstreetmaps? 


2 Replies 1 reply marked as answer

PS Pawel Szpytma January 3, 2024 11:02 AM UTC

Image_1180_1704279693641second image provided



HP Hemanathan Pandian Syncfusion Team January 4, 2024 01:56 PM UTC

Hi Pawel,


Maps component supports rendering online maps such as Azure maps, Bings maps and so on via their tile server URLs. The tile server URLs must follow the below format to render in the Maps component.


https://< domain_name >/maps/basic/{z}/{x}/{y}.png


”zoom” - It represents zoom factor (level).

”x” - It indicates tile image x-position (tileX).

”y” - It indicates tile image y-position (tileY).


To know more about the online maps in Maps component, please follow the below UG documentation link.

https://blazor.syncfusion.com/documentation/maps/providers/other-maps


To support localization for the OpenStreetMap, you need to set the tile server URL that supports localization parameters must be set in the “UrlTemplate” property of the Maps component.


For demonstration, we found a tile server URL (from a UG document) as shown below which supports the English language for all the labels.

https://maptiles.p.rapidapi.com/en/map/v1/zoom/x/y.png?rapidapi-key=YOUR-KEY


NOTE: You need to add the subscription key to use the above URL.


Please find the screenshot below for your reference.

Similarly, you can check with OpenStreetMap team for their English localized map and set it in the Blazor Maps component


Please let us know if you need any further assistance.


Marked as answer
Loader.
Up arrow icon