Skip to content

Latest commit

 

History

History
30 lines (24 loc) · 2.12 KB

configurablemap-class.md

File metadata and controls

30 lines (24 loc) · 2.12 KB
title description ms.custom ms.date ms.reviewer ms.suite ms.tgt_pltfrm ms.topic ms.assetid caps.latest.revision author ms.author manager ms.service
ConfigurableMap Class | Microsoft Docs
This article describes the ConfigurableMap Class and its createFromConfig method that allows you to generate a map using a JSON configuration file and the Configuration Driven Maps framework.
02/28/2018
article
cb96d5dd-0aaf-42d3-89cc-c2fe784f8cb5
2
rbrundritt
richbrun
stevelom
bing-maps

ConfigurableMap Class

[!INCLUDE bing-maps-web-control-sdk-retirement]

This class allows you to generate a map using a JSON configuration file using the Configuration Driven Maps framework. This generates a map instance which you can then use just like you would when loading the Map class. However, it has the added benefit of loading data layers that have been specified in the configuration file.

Static Methods

The ConfigurableMap class has the following static methods available.

Name Return Type Description
createFromConfig(element: string or HTMLElement, configFileUrl: string, withCredentials: boolean, requestHeaders?: IDictionary<string>, callback?: function(map: Map), errorCallback?: function(errorMsg: string)) A static function that loads a map using a JSON configuraiton file.

element - The parent element of the map as a CSS selector string or HTMLElement.
configFileUrl - The Url to download the JSON configuration file from. This should JSON file should contain a IConfigurableMapOptions object.
withCredentials - Creates the config file request with the setwithcredentials property.
requestHeaders - Set of headers that need to be added to config file request.
callback - Callback that is triggered when the map loads successfully.
errorCallback - Callback that is triggered when an error occurs when loading the map.