Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

com.cohga.html.client.main.tocView

weave.toc

Sub-tags

Name

type

cardinality

description

label

String

0..1

Label to display in tab

location

String

1..1

Which region to add the view to

toolbar

toolbar 

0..1

A toolbar of items to appear at the top of the view

statusbarstatusbar 0..1A toolbar of items to appear at the bottom of the view
contextmenucontextmenu 0..1a right-click context menu
checkParentOnVisibleboolean0..1Should the parent group also be turned on when a layer is turned on, default is false


Code Block
languagexml
titleExample ToC view will all available items
<view id="com.cohga.html.client.map.tocView">
	<label>Layers</label>
	<location>west</location>
	<toolbar>
		<item action="weave.toc.expandAll"/>
		<item action="weave.toc.collapseAll"/>
		<item action="weave.toc.save"/>
		<item action="weave.toc.load"/>
		<item>-&gt;</item>
		<item component="weave.toc.filter"/>
	</toolbar>
	<contextmenu>
		<item action="weave.toc.styleLayer"/>
		<item action="weave.toc.selectLayer"/>
		<item action="weave.toc.zoomToLayer"/>
		<item action="weave.toc.zoomSelection"/>
		<item action="weave.toc.zoomToMinScale"/>
		<item action="weave.toc.zoomToMaxScale"/>
		<item action="weave.toc.clearSelection"/>
		<item action="weave.toc.lockLayer"/>
	</contextmenu>
</view>

...

If the layer is lockable this allows the user to toogle the state of the locking for the layer. A lockable layer is a layer that has the ability to disable the scale ranges that are applied to a layers display, allowing a user to view the layer outside of it's normal scale ranges. To create a lockable layer you need to duplicate the layer in the underlying map engine, rename the new layer to include UNLOCKED as a prefix (or :UNLOCKED as a suffix) and remove any scale ranges that are attached to the symbology for the new layer. Then when Weave attempts to display the layer in an unlocked state it will display the unlocked version of the layer rather than the original. Note, you should not include the unlocked version of the layer in the ToC model.

Layer Transparency Slider

The weave.toc.layerTransparency context menu item was added at 2.5.21, this item adds a new slider to the context menu allowing you to directly change the transparency of the underlying map engine. Note that the slider is attached to individual layers in the ToC panel but it changes the transparency for the entire map engine that the layer belongs to and not just the layer associated with the ToC entry.

You can either specify the mapEngine and slider settings within a mapEngines and sliders section, as in the example, or specify them directly under the item.

You can also specify width and interval, either at the action level or the slider level, to specify the width of the slider and the movement interval of the slider.

Note that the tool currently only works on a layer entry in a ToC, and will not be available for a group, even if that group is set as not expandable. This has been resolved and will be available from 2.5.23.

Code Block
languagexml
titleToC context menu with layer transparency slider examples
<contextmenu>
    <!-- add slider to all map engines -->
    <item action="weave.toc.layerTransparency"/>
</contextmenu>


<contextmenu>
    <!-- add slider to specified map engines -->
    <item action="weave.toc.layerTransparency">
        <mapEngines>
            <mapEngine>mapengine.raster</mapEngine>
        </mapEngines>
    </item>
</contextmenu>


<contextmenu>
    <!-- add slider to specified map engines and configure individual sliders-->
    <item action="weave.toc.layerTransparency">
        <sliders>
            <slider mapengine="mapengine.vector" value="70"/>
            <slider mapengine="mapengine.raster" value="30"/>
        </sliders>
    </item>
</contextmenu>