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

Layer filter legend render #1121

Merged
merged 11 commits into from
Feb 12, 2024

Conversation

dbauszus-glx
Copy link
Member

@dbauszus-glx dbauszus-glx commented Feb 8, 2024

The ni filter which can be toggled in a categorized legend should be compatible with a different filter type, eg. a like filter on the same field.

A ni filter card in the filter panel should be linked to the categorized theme legend. Toggling categories in the legend should re-render the filter. Toggling the category in the filter card should re-render the legend.

Filter must cloned from infoj entry into the filter.list. Otherwise a structured clone of the infoj entry will fail after the remove method is assigned to the filter.

Several filter type methods did not make use of the shared applyFilter method.

The in filter must return checkboxes in a .filter class div.

The category legend will look for the filter matching the type and field. If a filter.card exists the .filter class element will be replacedWith the mapp.ui.layers.filters element.

@dbauszus-glx dbauszus-glx linked an issue Feb 8, 2024 that may be closed by this pull request
@dbauszus-glx dbauszus-glx added the Bug A genuine bug. There must be some form of error exception to work with. label Feb 8, 2024
@dbauszus-glx dbauszus-glx marked this pull request as ready for review February 8, 2024 19:58
@simon-leech
Copy link
Contributor

@dbauszus-glx I just pushed two commits to fix issues with the basic and distributed thematic legends.

@dbauszus-glx
Copy link
Member Author

Last commit fixes two issues. The check for filter.card must be conditional whether the filter exists.

Loading images must be conditional whether an image is already loaded.

        // Assign a load event for the image and load the image.
        const image = icon.legendStyle.getImage()

        const image1 = image.getImage(1)

        if (image1.src) {

          onImgLoad()
        } else {

          image1.addEventListener('load', onImgLoad)
          image.load();
        }

Copy link

sonarcloud bot commented Feb 9, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Contributor

@simon-leech simon-leech left a comment

Choose a reason for hiding this comment

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

I've tested this one and worked through the issues I found with @dbauszus-glx
What I've tested:

  • Distributed thematic, layer legend is now working after my commit.
  • Basic thematic, layer legend is now working after my commit.
  • Categorized thematic, you can toggle display of categories in the style legend, or in the filter panel. Toggling in the style panel and filter panel work together and clearing one uses the other (there was an issue where clearing one removed the filter that was resolved by @dbauszus-glx )

@RobAndrewHurst RobAndrewHurst merged commit 5555285 into GEOLYTIX:main Feb 12, 2024
5 checks passed
@dbauszus-glx dbauszus-glx deleted the layer-filter-legend-render branch March 15, 2024 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A genuine bug. There must be some form of error exception to work with.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

layer.filter panel render
3 participants