1
|
<h2>Other widgets</h2>
|
2
|
|
3
|
<p>
|
4
|
More than one view of the same model can also be included.
|
5
|
In the configuration for this page, we add in legend and cursor tracking widgets.
|
6
|
The legend renders the same context
|
7
|
document as the map, except that the layers are output as a text listing
|
8
|
with a checkbox for toggling the visibility of each layer.
|
9
|
The cursor tracking widget displays the latitude and longitude of the mouse
|
10
|
when the cursor is over the map.
|
11
|
Note also that this page is laid out using a table rather than a DIV
|
12
|
but the widgets are still associated with the HTML elements using the ID attribute.
|
13
|
</p>
|
14
|
|
15
|
<table>
|
16
|
<tr>
|
17
|
<td colspan="2" id="mainMapPane">
|
18
|
</td>
|
19
|
<td id="defaultLegend"/>
|
20
|
</tr>
|
21
|
<tr>
|
22
|
<td id="mainButtonBar" align="left"/>
|
23
|
<td id="cursorTrack" align="right"/>
|
24
|
<td/>
|
25
|
</tr>
|
26
|
</table>
|
27
|
|
28
|
|
29
|
<p>
|
30
|
The HTML for these widgets is also generated by an XSL stylesheet applied to the context document.
|
31
|
The default mapbuilder legend is shown here, however
|
32
|
custom stylesheets can be used by adding a <stylesheet> property to
|
33
|
widgets in the configuration file.
|
34
|
This property would reference a stylesheet installed on your server.
|
35
|
</p>
|
36
|
|
37
|
<p>
|
38
|
The config document itself is considered a model that may have it's own
|
39
|
widgets and tools.
|
40
|
Here the config document has Button widgets for controlling the application.
|
41
|
Widgets can be configured to act on any particular model through the <targetModel>
|
42
|
property.
|
43
|
</p>
|
44
|
|
45
|
<p align="right"><a href="?page=samples/tutorial2">previous</a>
|
46
|
<a href="?page=samples/tutorial4">next</a></p>
|