Versions Compared

Key

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

Client - Views - Legend

Description

Provides a means of displaying a single image in a panel to be used as a legend or if an image isn't specified then Weave can generate a dynamic map imagelegend, supporting both static legend images and dynamically generated legends.
The dynamic legends support map engines that generate bit map images, e.g. ArcIMS, and those that generate a hierarchy, e.g. ArcGIS Server and WMS.

There is a corresponding action that can be used to display the image legend in a popup window instead (but can't currently generate a custom image).

ID

com.cohga.client.panel.legend

Sub-tags

Name

type

cardinality

description

label

String

0..1

Label to display in tab

image

image

0..1

Details about the image to display

mapengine

mapEngine

string

0..

1

n

Map engine(s) to use to generate the

legend

dynamic legends,

base

all available map

engine

engines will be used if

not

none specified

remove

list

0..1

List of layer ids, comma separated, to remove from the dynamic legends. Note that this is the layer id as the associated map engine would report it, it has nothing to do with any the id used in a toc model entry. As of 2.5.11 you can use the format "layerid/mapengine", rather than just "layerid" if the layer id is not unique across all map engines, also you can use "*/mapengine" to remove all layers from a map engine.

showMode

'visible', 'all', 'checked'

0..1

What type of dynamic legend to generate, default is 'visible'. 'all' will display all layers regardless of their map visibility or toc state, 'visible' will only display layers that are currently displayed on the map, 'checked' will display only layers that are checked in the toc regardless of the map scale and visibility of the layer on the map.

staticLegend

staticLegend

0..n

Static images to add to legend

...

extentOnlyboolean0..1If set to true (and you're using QGis WMS server) then the legend can generate content just related to the current view extent, default value is false.
selectionMode'on', 'off'0..1If set to "off" then selection entries will not be displayed in the legend, the default is "on". This is available at 2.5.28. Prior to 2.5.28 remove can be used, e.g. <remove>*/mapengine.selection</remove>.
StaticLegend Tag

Name

type

cardinality

description

src1

url

String

1..1

URL of image to display

width

Integer

location

'top' or 'bottom'

0..1

The width of

Should the

image pointed to by the above URL

height

Integer

1..1

The height of the image pointed to by the above URL

legend image be before the dynamic legends or after, defaults to 'top'

minScale

Number

0..1

Minimum scale range to display layer at

maxScale

Number

0..1

Maximum scale range to display layer at

Example

Display a pre-generated legend imagelegend using all map engines

Code Block
xml
xml
linenumberstrue

<view id='com.cohga.client.panel.legend'>
        <label>Legend</label>
</view>
       <image>
                <src>http://gissrv/igis/images/legend.png</src>

Display a legend using only a single map engine

Code Block
xml
xml
linenumberstrue
<view id='com.cohga.client.panel.legend'>
                <width>123</width><label>Legend</label>
                <height>864</height>
       <mapEngine>mapengine.vector</mapEngine>
</image>
</view>

Dynamically generate a legend for an single map engine and remove a couple of layers

Code Block
xml
xml
linenumberstrue

<view id='com.cohga.client.panel.legend'>
        <label>Legend</label>
        <mapengine>mapengine.main</mapengine>
        <remove>hillshade,elevation</remove>
</view>

Dynamically generate a legend for an alternative map engine and remove a couple of layers and add two static images on at the top and one at the bottom

Code Block
xml
xml
linenumberstrue

<view id='com.cohga.client.panel.legend'>
        <label>Legend</label>
        <mapengine>mapengine.main</mapengine>
        <remove>hillshade,elevation</remove>
        <staticLegend url="http://server/images/markers.png"/>
        <staticLegend url="http://server/images/aerial.png" location='bottom'/>
</view>


Code Block
languagexml
titleRemove map engine specific layers from legend. All layers from mapengine.vector and elevation from mapengine.raster.
<view id='com.cohga.client.panel.legend'>
        <label>Legend</label>
        <remove>*/mapengine.vector,elevation/mapengine.raster</remove>
</view>