Table Of Contents
It is possible to arrange the table of contents that appears on the client by setting up a TOC model.
This model allows you to categorise and organise the layers that are available from a map engine.
For historical reasons all top level toc models, i.e. those that are directly referenced in a client config, should start their id
with toc.
, e.g.<toc:model id='toc.main'>
<!-- toc entries here -->
</toc:model>
rather than<toc:model id='main'>
<!-- toc entries here -->
</toc:model>
Note: Weave 2.6.8 removes this requirement
Nesting Update
An update to the toc model, at Weave 2.4.10, allows a toc model to be directly included within another toc model.
Previously it was only possible to include another toc model within a group in a toc model.
For example, a previous nested toc model would look like this:
<toc:model id="subtoc">
<mapengine>default</mapengine>
<entry id="layer1" label="Layer 1" layer="layer1"/>
</toc:model>
<toc:model id="toc.main">
<mapengine>default</mapengine>
<entry id="group1" label="Group 1" toc="subtoc"/>
<entry id="layer2" label="Layer 2" layer="layer2"/>
</toc:model>
which would result in a toc like:
+Group 1
Layer 1
Layer 2
The following is now possible:
<toc:model id="subtoc"> <!-- same as previous example -->
<mapengine>default</mapengine>
<entry id="layer1" label="Layer 1" layer="layer1"/>
</toc:model>
<toc:model id="toc.main">
<mapengine>default</mapengine>
<entry id="subtoc1" toc="subtoc"/> <!-- note no label set -->
<entry id="layer2" label="Layer 2" layer="layer2"/>
</toc:model>
which would result in a toc like:
The original structure can now also be accomplished like this:
Virtual Layers
There can be special virtual layers added to a map engine by additional bundles that provide extra functionality (e.g. an acetate layer or selection drawing), and these layers need to be taken into consideration when creating a table of contents for a map. Virtual layers will be covered later in this document.
Lockable layers
You just need to create a duplicate of the layer with the word UNLOCKED at the start. For example, if you have a layer called property
in the mxd, arcims or wms you would create another called UNLOCKEDproperty
. There is no need to add the unlocked layer to the toc model. When the user right clicks the layer, Weave checks to see if this layer is available in the mapengine. If it is, the Unlock Layer menu item will be enabled.
You can add it to the toc view contextmenu with the following.
Namespace
urn:com.cohga.server.map.toc#1.0
Tags
model
Properties
Name | Type | Required | Description |
id | string | yes | unique identifier for this toc model. |
mapengine | ref urn:com.cohga.server.map.toc#1.0:mapengine | no | The default map engine to associate with the entries included in this toc model if they don't set their own map engine. |
Sub-tags
Name | Type | Cardinality |
entry | urn:com.cohga.server.map.toc#1.0:entry | 1..n |
Content
None