Skip to content

LayerChooser: Support grouping layers from different services into one entry #903

Description

@dopenguin

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[].

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions