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

Set Filter method for GeoJSON Source #13023

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

Ruschio
Copy link

@Ruschio Ruschio commented Dec 26, 2023

Adding setFilter method for GeoJSON source, to allow filtering data without passing new ones with setData function

Closes #10722

Launch Checklist

  • Make sure the PR title is descriptive and preferably reflects the change from the user's perspective.
  • Manually test the debug page.

@Ruschio Ruschio requested a review from a team as a code owner December 26, 2023 10:16
@CLAassistant
Copy link

CLAassistant commented Dec 26, 2023

CLA assistant check
All committers have signed the CLA.

@stepankuzmin
Copy link
Contributor

Hi @Ruschio,

Thanks for the contribution, looks good to me 👍
Could you please rebase your changes on top of the latest main branch so we ensure all the tests are passing? Thanks!

@5andr0
Copy link

5andr0 commented May 21, 2024

This needs a bump! Would be nice if this gets implemented soon

@Ruschio
Copy link
Author

Ruschio commented May 23, 2024

Hi @Ruschio,

Thanks for the contribution, looks good to me 👍 Could you please rebase your changes on top of the latest main branch so we ensure all the tests are passing? Thanks!

@stepankuzmin I rebase this pull request to the actual main branch, so that it can be included after tests.
However, I noticed that performing multiple setFilter() operations causes some problems in data display. More in detail, seems that data (such as points or icons) remain stucked for certain zoom levels, and for others filter is correctly applied.

@5andr0
Copy link

5andr0 commented May 23, 2024

@stepankuzmin I rebase this pull request to the actual main branch, so that it can be included after tests. However, I noticed that performing multiple setFilter() operations causes some problems in data display. More in detail, seems that data (such as points or icons) remain stucked for certain zoom levels, and for others filter is correctly applied.

I can confirm, that when I manualy set the source.workerOptions.filter and call source._updateWorkerData() in the next map.on('render' event the first call to map.querySourceFeatures returns an array including invalid clusters of which features have been deleted and a consecutive call to source.getClusterLeaves throws an invalid cluster id error.

I just catch and ignore that error and wait for the next render, where the source features clusters are updated

@tempranova
Copy link

Anything I can do to help get this merged? I need this feature for a project. THanks!

Ruschio and others added 5 commits September 18, 2024 13:36
Adding setFilter method for GeoJSON source, to allow filtering data without passing new ones with setData function
Fix object-shorthand lint error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

setFilter method for GeoJSONSource
5 participants