Multiple models

This example includes two different maps that both have a MapPane widget as well as an Area of Interest (AOI) widgets which displays an AOI for the model. The AOI can either be a rectangular bounding box or a single point. The colour, line width and size of point display are customized in the config file. These links also demonstrate how to reference Mapbuilder objects using the 'config.objects' array, as well as calling a model listener function.

A map can also have some interactive functionality by adding tools (controllers) to the Context document model. In this case the secondMap has a tool to handle mouse events on the MapPane widget, as well as a tool to control the firstMap by using the 'targetModel' property. Click, or click and drag out an AOI box on the second map to control the area displayed in the firstMap.

previous    next