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

Legend filtering for GeoServer WMS layers #10684

Closed
4 tasks done
allyoucanmap opened this issue Nov 18, 2024 · 4 comments · Fixed by #10718
Closed
4 tasks done

Legend filtering for GeoServer WMS layers #10684

allyoucanmap opened this issue Nov 18, 2024 · 4 comments · Fixed by #10718
Assignees
Milestone

Comments

@allyoucanmap
Copy link
Contributor

allyoucanmap commented Nov 18, 2024

Description

The GetLegendGraphic request for a WMS GeoServer layer allow to filter the legend items based on the map extension and additional filters applied to the layer (eg. CQL filters). When a WMS layer has a filter applied the legend should update and show only the filtered legend items entries. This task includes following actions:

  • improve the WMS legend component (*) of the TOC to support layer filters and bounding box filter based on the map extension (both 2D and 3D maps)

  • improve the Print request for WMS layers to configure correctly the GetLegendGraphic request including layer filters and map extension filters.

  • The WMS legend component has two different type of format json and image, both should be implemented

The aim of this issue is to have consistency on the legend and the content visualized on the map and print output.

In this comment there is a working configuration for GeoServer GetLegend graphic request. We should apply this configuration only when the serverType property of the layer is undefined or geoserver

What kind of improvement you want to add? (check one with "x", remove the others)

  • Minor changes to existing features

Other useful information

@dsuren1
Copy link
Contributor

dsuren1 commented Nov 27, 2024

@tdipisa @allyoucanmap

With the interactive legend filter (as shown in the video below):

  • A legend filter is applied (last two options are selected).
  • A layer filter is then applied to an area that does not display any results.
  • The legend now updates to show only the applicable data based on the layer filter.
  • Meanwhile, the previously applied legend filter (from Step 1) remains in effect. Is this behavior acceptable?
  • Applying a new legend filter displays data on the map.
  • Clearing the layer filter reveals the effects of all previously applied legend filters.

If not, could you clarify what the expected behavior should be in this scenario?

legend-filtering.mp4

@allyoucanmap
Copy link
Contributor Author

@tdipisa @allyoucanmap

With the interactive legend filter (as shown in the video below):

  • A legend filter is applied (last two options are selected).
  • A layer filter is then applied to an area that does not display any results.
  • The legend now updates to show only the applicable data based on the layer filter.
  • Meanwhile, the previously applied legend filter (from Step 1) remains in effect. Is this behavior acceptable?
  • Applying a new legend filter displays data on the map.
  • Clearing the layer filter reveals the effects of all previously applied legend filters.

If not, could you clarify what the expected behavior should be in this scenario?

legend-filtering.mp4

@dsuren1 @tdipisa this comment is part of the interactive legend so it should be discussed in #10241, and it has a similar inconsistency described in #10236. In the video we are in a situation where the legend filter applied to the layer are not valid anymore so I think we should implement the warning described in this comment #10236 (comment):

In this case, when the legend is expanded, MS performs the requests to fetch the legend JSON. Contextually MS can compare the available filter item of the legend present in the response with the existing one in the layer state. In case of diffs detected, am inline warning is displayed to the user informing about that with a button to reset the legend state and align it to the new one.

Note: With inline warning we mean an Alert component with bsStyle warning implemented directly in the json legend component if possible

@dsuren1
Copy link
Contributor

dsuren1 commented Nov 27, 2024

So I guess it can be addressed as part of #10236 ? @tdipisa

@dsuren1
Copy link
Contributor

dsuren1 commented Nov 27, 2024

Updated:
An inline warning along with a button to reset legend filter state will be implemented as part of #10241

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

Successfully merging a pull request may close this issue.

3 participants