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

#10684: Legend filtering for GeoServer WMS layers #10718

Merged
merged 7 commits into from
Dec 19, 2024

Conversation

dsuren1
Copy link
Contributor

@dsuren1 dsuren1 commented Dec 5, 2024

Description

This PR implements legend filtering of the WMS layer including both the formats (image and json). Incorporates filtering factoring map extents and additional layer filter and interactions between them. Applicable for both 2D and 3D map along with legend widget. Implement reset legend when filter are incompatible

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x", remove the others)

  • Enhancement

Issue

What is the current behavior?

What is the new behavior?

  • Layer and legend filtering

    legend_filtering.mp4
  • Legend filtering in printing

    Screenshot 2024-12-05 at 7 26 25 PM Screenshot 2024-12-05 at 7 27 10 PM
  • Applies to dashboard legend widget

  • Applicable for both 2D and 3D map

Breaking change

Does this PR introduce a breaking change? (check one with "x", remove the other)

  • Yes, and I documented them in migration notes
  • No

Other useful information

@dsuren1 dsuren1 requested a review from allyoucanmap December 11, 2024 13:57
@dsuren1 dsuren1 requested a review from allyoucanmap December 12, 2024 09:15
@dsuren1 dsuren1 linked an issue Dec 16, 2024 that may be closed by this pull request
1 task
Copy link
Contributor

@allyoucanmap allyoucanmap left a comment

Choose a reason for hiding this comment

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

The warning message is showing up also in the following conditions:

  • the map view extent does not contain the visible layer features. This is more complex to detect
warning-message-legend-2.mp4
  • the filter button is deactivated (the one inline with the layer TOC node). In this case the message should be avoided completely because legend filters are not applicable
warning-message-legend.mp4

@tdipisa @dsuren1 I think for the moment we could solve the second point when deactivated the message should never show up. The first point is technically correct but maybe the message could be misleading

@dsuren1
Copy link
Contributor Author

dsuren1 commented Dec 18, 2024

@allyoucanmap @tdipisa

The first point is technically correct but maybe the message could be misleading

shall we modify the warning text to either of this?

Applied legend filters are incompatible with the active layer filter, or the map view extent does not contain visible layer features. Click on reset to remove legend filters

or

Legend filters are incompatible with the active layer filter, or no visible features are within the map view. Click reset to clear legend filters.

@allyoucanmap
Copy link
Contributor

Legend filters are incompatible with the active layer filter, or no visible features are within the map view. Click reset to clear legend filters.

@dsuren1 this seems fine

@dsuren1 dsuren1 requested a review from allyoucanmap December 18, 2024 08:49
@allyoucanmap allyoucanmap merged commit d1ebec1 into geosolutions-it:master Dec 19, 2024
6 checks passed
@tdipisa
Copy link
Member

tdipisa commented Jan 9, 2025

A quick note for you @ElenaGallo regarding #10236 (comment) whose implementation is expected as part of this PR:

  • selection of a different style (internal editing)

This seems to work as expected

  • editing of the selected style and changing the rule with the visual style editor (internal editing)

This is still not working as expected but with @dsuren1 and @allyoucanmap we decided to leave it as it is for now. There is only a bug there for which the warning message is not displayed in the layer legend when the style is edited with relevant changes affecting the legend and the user comes back to the TOC. At the moment the warning is displayed only if the user moves the map or collapse and expand again the legend when the style is edited

  • creation of a new style with the visual style editor (internal editing)

This is not covered at all and @dsuren1 has to provide the requested implementation as indicated in the above issue comment, that is, the following:

  • Maintain the Interactive legend state (enabled/disabled) as it is
  • Reset the existing Interactive legend filter
  • Temporary disable the Interactive legend filter while editing the style
  • external editing of a style (eg. on GeoServer) (external editing)

This one still need to be tested and we are waiting for you @ElenaGallo: once a style is edited externally (on GS for example), the same working should appear if the user moves the map or collapse and expand again the legend.

@ElenaGallo
Copy link
Contributor

@tdipisa all tests are passed.

@tdipisa
Copy link
Member

tdipisa commented Jan 9, 2025

@tdipisa all tests are passed.

@ElenaGallo do you mean you have tested all 3 issues connected to this PR and all went well? Did you see the above comment? Due to this, #10236 cannot be closed now, we have to wait for @dsuren1 fixes first. He will provide a new PR for what requested.

@ElenaGallo
Copy link
Contributor

@tdipisa yes, I have tested the three linked issues and what is testable for now in relation to the comment you reported above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants