Individual Map Center pages often make use of additional functionality that isn’t included in the core nhmc package; without such additional functionality, all that would appear is a blank map! The Map Center implements these extras in the form of “modules”, which are simply JavaScript functions that are executed when the coreInitialized signal fires.
The general organization of a module consists of:
Declaring which core packages are in use by calling the namespace function.
Defining an handler for the coreInitialized signal. This signal should only fire once, but existing modules tend to bind to it using $(document).one() for additional safety.
The body of that handler generally includes:
A simple stub module might look something like this:
namespace("nhmc");
namespace("nhmc.charts");
namespace("nhmc.cleanup");
namespace("nhmc.config");
namespace("nhmc.ctrl");
namespace("nhmc.geo");
namespace("nhmc.tooltips");
$(document).one('coreInitialized', function() {
// Module body goes here.
});
Modules: