Setting Map Control Parameters


When specifying the URL to the map control in a script reference, additional URL parameters can be added to configure how the map control functions.

To add a parameter to the map control src URL, add a "?", the parameter, and set it "=" to one of the allowable values. Use "&" to separate parameters.

The following example sets the map control URL such that it triggers a callback function called GetMap after the script has finished loading. It also loads the experimental branch of the map control in Italian.

<script type='text/javascript' src='[YOUR_BING_MAPS_KEY]' async defer></script>

URL ParameterDescription
branchSpecifies which branch of the SDK to load. Supported values:

release (default)

See the Map Control Branches section for more details.
callbackThe name of a callback function that should be called after the map control script has finished loading.
keyThe Bing Maps Key used to authenticate the application. By specifying your Bing Maps key as a URL parameter in the map script reference, it will allow for live site issues reported to the Bing Maps Enterprise support team by licensed customers to be migrated faster.

Tip: if you need to get access to the Bing Maps key, it is available in the map options: map.getOptions().credentials
setLangSpecifies the language to use for the map labels and navigation controls.

Example: en

The map automatically detects and sets this value based on the users location and device settings. It is not generally recommended to override this parameter unless testing.
setMktThis is a market parameter that provides insights into the users location. This is used to determine which features are available to the map in this area. For example, if the user is in an area where streetside imagery is not available, the map won’t list it as an option in the navigation bar. If the locale parameter is set to "en-US", an area where streetside imagery is available, this option will appear.

Example: en-US

The map automatically detects and sets this value based on the users location and device settings. It is not generally recommended to override this parameter unless testing.
URA user region string that contains an ISO 3166-1 alpha-2 country region code. The user region value is used to ensure that disputed borders and location names, align with the views of the specified user region.

For a list of values, see the Region Localities section in the Geospatial Endpoint Service topic.

Due to the sensitivity of this feature, it is recommended to only use this when testing and to let the map automatically set this value in your production application.

Example: CN

The Bing Maps V8 Map Control automatically detects the users language and culture settings from their browser and uses this to localize the map control. However, it is possible to override the detected settings if desired by using the setLang and setMkt parameters.

Here is an example of Bing Maps with the language parameter set to "fr" and the locale parameter set to "fr-FR".

<script type='text/javascript' src='' async defer></script>

The resulting map looks like this:

French localized map

Supported Languages

Language - Country/RegionCultureMap LabelsNavigation ControlLocation & DirectionsAutoSuggest
Arabic - Saudi Arabiaar-SAxx*x
Bulgarian - Bulgariabg-BGxx*x
Catalan Spanishcaxxxx
Central Kurdishku-Arabxx*x
Chinese - Chinazh-CNxxxx
Chinese - Hong Kongzh-HKxxxx
Chinese - Simplifiedzh-Hansxxxx
Chinese - Taiwanzh-TWxxxx
Chinese - Traditionalzh-Hantxxxx
Czech - Czech Republiccs-CZxx*x
Danish - Denmarkda-DKxx*x
Dutch - Belgiumnl-BExxxx
Dutch - Netherlandsnlxxxx
Dutch - Netherlandsnl-NLxxxx
English - Australiaen-AUxxxx
English - Canadaen-CAxxxx
English - Indiaen-INxxxx
English - United Kingdomen-GBxxxx
English - United Statesen-USxxxx
Finnish - Finlandfi-FIxx*x
French - Belgiumfr-BExxxx
French - Canadafr-CAxxxx
French - Francefrxxxx
French - Francefr-FRxxxx
French - Switzerlandfr-CHxx
German - Germanydexxxx
German - Germanyde-DExxxx
Hebrew - Israelhe-ILxx*x
Hindi - Indiahi-INxx*x
Hungarian - Hungaryhu-HUxx*x
Icelandic - Icelandis-ISxx*x
Italian - Italyitxxxx
Italian - Italyit-ITxxxx
Japanese - Japanja-JPxxxx
Korean - KoreaKo-KRxx*x
Latvian - Latvialv-LVxx*x
Lithuanian - Lithuanialt-LTxx*x
Norwegian - Bokmålnbxxxx
Norwegian - Bokmål - Norwaynb-NOxxxx
Norwegian - Nynorsknnxx*x
Polish - Polandpl-PLxxxx
Portuguese - Brazilpt-BRxxxx
Portuguese - Portugalpt-PTxxxx
Russian - Russiaru-RUxxxx
Spanish - Mexicoes-MXxxxx
Spanish - Spainesxxxx
Spanish - Spaines-ESxxxx
Spanish - United Stateses-USxxxx
Swedish - Swedensvxxxx
Swedish - Swedensv-SExxxx
Tatar - Cyrillictt-Cyrlxxxx
Thai - Thailandth-THxx*x
Turkish - Turkeytr-TRxxxx
Ukrainian - Ukraineuk-UAxxx
Vietnamese - Vietnamvi-VNxx*x

* Directions input panel may not be localized. Some English words may appear in the route summary. The step by step instructions will be localized.

Localization of Error Messages

  • Error messages are always displayed in English - United States.

Why does Bing Maps use three parameters for localization?

Most mapping systems that support localization, only provide one or two parameters for localization, so you might be wondering why does Bing Maps provide three. Take for example this scenario; A user who is based in India visits a travel site. By default, the map would set the user region to "IN" and ensure that disputed borders are displayed to align with the views of the people of India, the language would be set to English ("en") or one of the many languages spoken in India depending on the customer's computer settings, and the locale parameter would be set to "en-IN" which would hide certain features that are no available in India, such as streetside. Being that this is a travel site and the user likely will be looking at areas outside of India, possibly a city in the USA, the user may be interested in displaying streetside imagery of their destination. The travel site can override the default locale parameter with a "en-US" value and this will enable this feature.