1 |
3032
|
perry
|
|
2 |
|
|
<h2>Multiple models</h2>
|
3 |
|
|
|
4 |
|
|
|
5 |
|
|
<div style="float:right;width:auto; padding: 4px">
|
6 |
|
|
<div id="firstMapPane"></div>
|
7 |
|
|
</div>
|
8 |
|
|
|
9 |
|
|
<p>
|
10 |
|
|
This example includes two different maps that both have a MapPane widget
|
11 |
|
|
as well as an Area of Interest (AOI) widgets which displays an AOI for the model.
|
12 |
|
|
The AOI can either be a
|
13 |
|
|
<a href="javascript:alert('hover over this link to see the AOI')"
|
14 |
|
|
onmouseover="javascript:config.objects['firstMap'].setParam('aoi', new Array(new Array(-75,45),new Array(0,0)))">
|
15 |
|
|
rectangular bounding box
|
16 |
|
|
</a>
|
17 |
|
|
or a
|
18 |
|
|
<a href="javascript:alert('hover over this link to see the AOI')"
|
19 |
|
|
onmouseover="config.objects['firstMap'].setParam('aoi', new Array(new Array(0,0),new Array(0,0)))">single point.</a>
|
20 |
|
|
The colour, line width and size of point display are customized in the config
|
21 |
|
|
file.
|
22 |
|
|
These links also demonstrate how to reference Mapbuilder objects using
|
23 |
|
|
the 'config.objects' array, as well as calling a model listener function.
|
24 |
|
|
</p>
|
25 |
|
|
|
26 |
|
|
<div id="secondMapPane" style="float: left; width: auto; padding: 4px"></div>
|
27 |
|
|
|
28 |
|
|
<p>
|
29 |
|
|
A map can also have some interactive functionality by adding tools
|
30 |
|
|
(controllers) to the Context document model.
|
31 |
|
|
In this case the secondMap has a tool to handle mouse events on the
|
32 |
|
|
MapPane widget, as well as a tool to control the firstMap by
|
33 |
|
|
using the 'targetModel' property.
|
34 |
|
|
<b>Click</b>, or <b>click and drag</b> out an AOI box on the second map
|
35 |
|
|
to control the area displayed in the firstMap.
|
36 |
|
|
</p>
|
37 |
|
|
|
38 |
|
|
<p style="text-align:right; clear:left"><a href="?page=samples/tutorial1">previous</a>
|
39 |
|
|
<a href="?page=samples/tutorial3">next</a></p>
|