ConfigurableMap Class

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.