More advanced applications will likely want to add functionality by performing specific actions in response to user input. There are a few methods provided in Mapbuilder to customize your application.
An important aspect of the MVC design pattern is that it is event driven. Almost everything that happens over the course of the application execution is the result of an event being triggered on a model, which then calls listener functions registered with that model. This allows the models, widgets and tools to remain independant of each other and makes Mapbuilder very modular - objects can be added and removed from the configuration without affecting the other objects.
There is a global "config" object that can be referenced from anywhere. You can retrieve a reference to all other objects by using the config.objects property. For example, a model with an ID of "model_x" would be referenced as config.objects.model_x, or config.objects["model_x"].
The following functions are available for carrying out user actions:
The way to use these functions is to set them as the HREF element of an anchor tag:
<a href="javascript:config.loadModel(...)"/>
or as an event handler (onclick, onmouseover, etc.) on any HTML element that allows it:
<td onclick="config.loadModel(...)"/>