Layer View and Legends
With the Style Layers Editor the view of the layers and their legends can be configured.
The Layer view section controls following:
- Which layers there are shown to the user
- Wether a layer should shown from the start or not
- How the layers should be group
The result of the configuration is shown in the Layer View toolbox.
The Legends sections controls following:
- The legends to display for the style layer
The result of the legends configuration is shown in the Legends toolbox.
NOTE that the legends does not affect the styling and the styling does not affect the legends, it is up to the user that configures the legends to match them with the styling.
Layer view configuration
The Path parameter controls the grouping and display name of the style layer. The path is a list of items, where the last item represent the display name of the layer. A path is required to have a least one item and all the items can have spaces in them. Items are separated with /.
Example 1: a path set to Layer 1 results in the layer being displayed at the root level with the name Layer 1.
Example 2: a path set to Group A/Group B/Layer 1 results in the layer being displayed in Group B which is placed under Group A which is placed at the root level. The name of the layer is Layer 1.
Multiple layers can be placed in the same group by giving them the same items in the path.
Example 3: Layer 1 has the path Group A/Layer 1 and Layer 2 has the path Group A/Layer 2, then both layers will be placed under Group A.
The Initial layer state parameter control wether the layer should active from the start or not. If checked, the layer will be active from the start.
The Hidden parameter controls if the user should be able to toggle the layer and thereby if the layer should be shown in the Layer View toolbox.
Use-case with hidden
If the Initial layer state is check and Hidden is also checked and the Path is set to Group A/Layer 1 then the layer will be active from the start and the only way the user can deactivate it, is by toggling the group. This do require that other non-hidden layers are also placed in the group.
If all layers in a group is set to hidden, then the group will be treated like a pseudo-layer, meaning that it is displayed like a normal layer rather than a group.
This is preferable if there one or more style layers configured to handle user interaction and a single layer that actually shows something on the map, then all the layers can be grouped into a pseudo layer, so when the pseudo-layer is toggled, both the interactive layers and the layer displaying some styling on the map is toggled at the same time.
Layer view toolbox
The Layer view toolbox displays all groups and layers in ascending order based on the name. However, nested group are always displayed after the layers placed directly under the parent group.
Legends configuration
A style layer can have 0 to many legends, and each legend requires a label and a color. If needed the outline color can also be specified, by default it will be the same as the fill color.
Legends toolbox
Legends for all active style layers are displayed. The style layers are displayed in the same order as in the Layer view toolbox.
The legends are displayed in the order the have be configured.
For pseudo-layers, the legends for each underling layer are merged together. The legends from each underling style layer are merged together in ascending order based on the name of the style layer. However, the legends for each individual style layer keeps the order the are configured in.