Description
Currently, the LayerChooser can only "group" sub-layers that belong to the same WMS service with options.layers.
That way, one LayerConfiguration entry maps to one ol layer and its OGC sub-layers are toggled via the WMS LAYERS source parameter.
This cannot span multiple services, because each service is a separate ol layer.
This issue intends to allow grouping layers that come from different services so they appear to users as a single entry in the LayerChooser selection.
The "sub-layers" then can be selected the same way as currently with options.layers.
This is achieved by adding the configuration parameters groups: {id, name, type, layerIds} to layerChooser, making it the first configuration parameter of that plugin.
type marks the section the group belongs to and defaults to 'mask'.
The solution should re-use the existing options menu (LayerOptions.ce.vue) to list the group members.
It's also important to note that a group stays usable as long as at least one member is available at the current zoom level.
Unavailable members are shown disabled in the options menu with the same hint already used for disabled layers.
Out of scope
- Service-internal
options.layers sub-layer toggling inside a group member is explicitly unsupported.
- Grouping of
type: 'background' layers.
- Any change to the
MapConfiguration.layers structure, it stays a plain LayerConfiguration[].
Description
Currently, the LayerChooser can only "group" sub-layers that belong to the same WMS service with
options.layers.That way, one
LayerConfigurationentry maps to oneollayer and its OGC sub-layers are toggled via the WMSLAYERSsource parameter.This cannot span multiple services, because each service is a separate
ollayer.This issue intends to allow grouping layers that come from different services so they appear to users as a single entry in the LayerChooser selection.
The "sub-layers" then can be selected the same way as currently with
options.layers.This is achieved by adding the configuration parameters
groups: {id, name, type, layerIds}tolayerChooser, making it the first configuration parameter of that plugin.typemarks the section the group belongs to and defaults to'mask'.The solution should re-use the existing options menu (
LayerOptions.ce.vue) to list the group members.It's also important to note that a group stays usable as long as at least one member is available at the current zoom level.
Unavailable members are shown disabled in the options menu with the same hint already used for disabled layers.
Out of scope
options.layerssub-layer toggling inside a group member is explicitly unsupported.type: 'background'layers.MapConfiguration.layersstructure, it stays a plainLayerConfiguration[].