API Docs for: 7.2
Show:

MQA.Loader Class

Module: MQA

Export Loader Public Methods

Methods

_getModule

(
  • moduleName
)
private

Gets a module record, creating it if necessary

Parameters:

_initialize

() private

This method is called by the module loader suffix file when it has determined enough information to be able to load modules. It is exported as MQA.Loader._initialize.

_moduleLoaded

() private

Called as the last statement of a module script to notify the loader that the module is now available.

_withModuleTest

() private

Loads single module and invokes a callback (internal). Return true if the callback was invoked during this call..

isLoaded

()

Return true if the given module is loaded

registerModules

()

Add all module records in newModules to the registry.

requiredCss

(
  • moduleName
  • prefixCss
)

To be called from within a module to load attached css

Parameters:

withModule

(
  • module
  • [module2]
  • [module3]
  • callback
)

Public withModule function which takes a variable number of arguments. All arguments up to the first non-string argument are taken to be module names. The next argument (if exists) is taken to be a callback.

Parameters:

  • module String

    module to load, add as comma-separated modules as you like

  • [module2] String optional
  • [module3] String optional
  • callback Function

    the last argument (if a function) will be treated as the callback and will be called once all modules are loaded

Example:

 // download the modules
 MQA.withModule('largezoom', 'mousewheel', function() {

    // add the Large Zoom control
    map.addControl(
      new MQA.LargeZoom(),
      new MQA.MapCornerPlacement(MQA.MapCorner.TOP_LEFT, new MQA.Size(5,5))
    );

    // enable zooming with your mouse
    map.enableMouseWheelZoom();
  });

writeScript

(
  • contents
)

Append a script element to the document to load the given uri.

Parameters: