Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix print composite layer legend #2116

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

steff-o
Copy link
Contributor

@steff-o steff-o commented Dec 20, 2024

Fixes #2092 by generating valid legend graphics for Geoserver Layer Groups.

Should generate all rules for all layers in a Layer Group in print legend.

There are some limitations:

  1. If a style has several rules, the rules must be named (same as with ordinary WMS layers)
  2. A Group Layer must use the default style for each contained layer, i.e. not define another style when used inside the Group Layer, otherwise the map legend and print legend will display different symbols.
  3. A top level (without workspace) Group Layer can only contain layers with unique names through all workspaces.

These limitations are all a result of missing information in the response from the getLegendGraphic as JSON request. To overcome that a bunch of Geoserver api request would have to be performed, but that seemed a bit overmuch.

Also thematicStyling is not supported as it not supported by the map legend and would require an issue of its own.

No new configuration is added.

Copy link
Contributor

@Grammostola Grammostola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to do what it says on the tin. thematicStyling layers with a partial theme list active still print ok. Perhaps if different treatment is needed for similar types of composite layers from other map server vendors a check can be made for the source type (like print-resize does already).

Anyway based on my testing and no linting issues I approve this. Nice addition.

@Grammostola Grammostola added the PR approved To highlight approved PR:s as it is not shown in list which are approved. label Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR approved To highlight approved PR:s as it is not shown in list which are approved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Print legend does not work with composite WMS layers
2 participants