how to set bingmap user region dynamically using api

Surya 6 Reputation points
2023-10-10T08:32:36.6+00:00

We have a requirement to set the Bing Maps user region dynamically after loading without using url parameters. We can see in the below documentation link to customize the map option on load, but passing the setting the value of ur is not working.

https://video2.skills-academy.com/en-us/bingmaps/v8-web-control/creating-and-hosting-map-controls/customize-map-options-on-load-example

Please suggest an alternative way to set the user region dynamically in a simple way.

TIA

Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
653 questions
Windows Maps
Windows Maps
A Microsoft app that provides voice navigation and turn-by-turn driving, transit, and walking directions.
253 questions
{count} votes

1 answer

Sort by: Most helpful
  1. rbrundritt 16,456 Reputation points Microsoft Employee
    2023-10-10T15:50:04.35+00:00

    If you are going to set the user region, it needs to be done in the script URL as this downloads different content. That said, you generally should not be setting this value, it is mainly there for testing purposes only. The map platform will automatically detect the correct value for the user based on where their request originates from. Note that there is risks in showing users maps that don't align with their user region which can impact your business.

    1 person found this answer helpful.
    0 comments No comments