Module Loading Methods

Bing
 

The following methods allow you to register and load your own modules for use by the map control. Al of these static methods are under the Microsoft.Maps namespace.

NameDescription
loadModule(moduleKey: string or string[], options?: ModuleOptions or function())Loads the specified registered module, making its functionality available. You can provide the name of a single module or an array of names in. Options or a callback function that is called when the module is loaded can be specified.

To register a custom module, use the registerModule method before calling the loadModule method.
moduleLoaded(moduleKey: string)Signals that the specified module has been loaded and if specified, calls the callback function in loadModule. Call this method at the end of your custom module script.
registerModule(moduleKey:string, scriptURL:string, options:{styleURLs:string[]})Registers a module with the map control. The name of the module is specified in moduleKey, the module script is defined in scriptURL, and the options provides the location of a *.css file to load with the module.

Tip: To minimize possible conflicts with other custom modules, choose a unique module name (defined in moduleKey). For example, you can use your company name in the name of the module.

Once you have registered a module, you can make its functionality available by loading it using loadModule.

Show: