Below are a couple of samples of context menus that can be added to the Weave client configuration.
The contentmenu
tag should be added under the tocView
or mapView
, for example:
<view id="com.cohga.html.client.map.tocView"> <label>Layers</label> <location>west</location> <contextmenu> <item action="weave.toc.openUrl"> <text>Metadata</text> <url>/resources/metadata/{layername}.htm</url> <external>true</external> </item> </contextmenu> </view>
Map
<contextmenu> <item action="weave.zoomToScale"> <text>Street Level</text> <scale>2500</scale> </item> <item action="weave.zoomToScale"> <text>Suburb Level</text> <scale>25000</scale> </item> <item action="weave.zoomToScale"> <text>Council Level</text> <scale>130000</scale> </item> <item>-</item> <item action="weave.previousExtent"> <text>Previous Extent</text> </item> <item action="weave.nextExtent"> <text>Next Extent</text> </item> <item action="weave.initialExtent"> <text>Initial Extent</text> </item> <item action="weave.fullExtent"> <text>Full Extent</text> </item> <item>-</item> <item action="weave.fixedZoomIn"> <text>Zoom In</text> </item> <item action="weave.fixedZoomOut"> <text>Zoom Out</text> </item> <item>-</item> <item action="weave.selectZoom"> <text>Zoom To Selection</text> </item> <item>-</item> <item action="weave.clear"> <text>Clear Selection</text> </item> <item action="weave.clearAll"> <text>Clear All</text> </item> <item action="weave.coords"> <text>Coordinates</text> <projection id="EPSG:4283" label="Geographic (GDA94)"/> <projection id="EPSG:4326" label="WGS84"/> <projection id="EPSG:28355" label="GDA94 / MGA Zone 55"/> <projection id="EPSG:3111" label="VicGrid94 (GDA94)"/> <projection id="EPSG:28355" label="AMG Zone 55"/> </item> <!-- Link to an external system via a URL with an embedded id --> <item action="weave.quickLink" entity="sewer_pipes" filter="sewer_pipe.plan_no" url="https://iswva02:1548/viewer.asp?type=embedd&id={id}" text="Sewer Plans" iconCls="icon-sewer_app"> <tooltip title="Sewer Plans" text="Show the plans for the clicked sewer"/> </item> </contextmenu>
Table of Contents
<contextmenu> <item action="weave.toc.selectLayer"> <text>Set Active</text> </item> <item action="weave.toc.clearSelection"> <text>Clear Selection</text> </item> <item action="weave.toc.zoomSelection"> <text>Zoom To Selection</text> </item> <item>-</item> <item action="weave.toc.zoomToMaxScale"> <text>Zoom to the Maximum Scale</text> </item> <item action="weave.toc.zoomToMinScale"> <text>Zoom to the Minimum Scale</text> </item> <item action="weave.toc.zoomToLayer"> <text>Zoom to Layer</text> </item> <item>-</item> <item action="weave.toc.openUrl"> <text>Metadata</text> <external>true</external> <iconCls>icon-tag-green</iconCls> <layer label="Mineral Tenements"> <url><![CDATA[http://metadata.nre.vic.gov.au/metadata/anzlic_report.cfm?dataset_name=MINTEN]]></url> </layer> </item> </contextmenu>
ToC context menu with layer transparency slider examples
<contextmenu> <!-- add slider to all map engines --> <item action="weave.toc.layerTransparency"/> <!-- add slider to specified map engines --> <item action="weave.toc.layerTransparency"> <mapEngines> <mapEngine>mapengine.raster</mapEngine> </mapEngines> </item> <!-- 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>
The weave.toc.layerTransparency
context menu item was added at 2.5.21.
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.
You can either specify the mapEngine
and slider
settings within a mapEngines
and sliders
section, as above, or specify them directly under the item.
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.