-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Support preclustering filtering #2613
Comments
@mourner any progress on this? i'm working with very large data sets and calling |
any updates on this? Thanks. |
This would be more than helpful. Concerning the syntax, would this be something in the likes of?
Another side note: the documentation for setFilter links to deprecated syntax https://www.mapbox.com/mapbox-gl-js/api#map#setfilter, but looking at the expression syntax it seems quite similar to me, no? Would order be important? As in: any filters coming before the "has point count" filter would apply to anything symbol specific and anything after would apply to the cluster? |
I'm trying to revive this: |
Any update on this one ? When working with huge data sets, might be very useful |
@crow7m : Take a look at their answer to my ticket above, it's clear they are not really willing to work on this :( |
I'm also looking forward to updates on this. I've just started using Mapbox and it would be really useful for my specific project. In the meantime, does anyone have a link to an example of the work around? I'm trying to create filters based on the feature's properties for my clustered map. I see that it involves filtering manually and using setData, but is there an example out there of that? |
No progress on this for soon 4 years? This would solve a lot of problems performance wise when filtering huge data-sets that are clustered. @mourner |
I think with the for the source and for the layer Update: Update2: |
Hi all, is there any news about this feature state? |
Yes, we plan to work on this soon since this is such a highly requested feature — stay tuned for news in the coming weeks! |
@mourner : Since it's been a few weeks, are there any updates on this feature? |
@mourner I am also interested in being able to apply filters on sources dynamically. |
still nothing guys? this shouldn't be that hard... we have this bug on our website and apps for a really long time and had to explain all the time we can't fix it cause Mapbox is not willing to fix :/ |
Hi guys! Any aupdate? like I see this can not be implemented, (4 years of requesting). |
Hey friends, I took a stab at this at #9864 — please let me know if this works for your use case! It's a minimal implementation, only allowing setting the initial filter when adding the source, but there seems to be workaround for that — e.g. removing and re-adding a source with different options, which should be fine performance-wise since we have to re-process the whole data anyway, and the file by the URL is already cached by the browser. |
Hi @mourner , thanks for the effort, so just to make sure i got it correct, instead of heavy operations with data, we will be able to pass same data to source and just update the filter in order to get filtered results, and in order for clusters to redraw on the map, correct ? if so i guess it will be better than filtering the whole data set every time we want to filter and redraw clusters. Thanks for your time and effort. |
like i understand there is no possibility to update the source filter, right? Only by removing and adding a new source is not a solution for me, because therefore i also need to remove an recreate all depening layers. |
I also have to admit that I don't understand what to do in order to implement both clusters and filters... I have the feeling it is still not possible to implement both. Can you please explain how to implement both in order to make sure this issue has been addressed ? The example in the pull request does not help at all. If needed I can create an issue requesting to add an example in Mapbox documention. Thanks. |
@Codain |
For some reason the current solution did not work when using a feature property for filtering. I used this as a workaround. Giving credits here: https://gis.stackexchange.com/questions/276268/filter-clustering-mapbox-gl-js This is my code right before the cluster layers are added, where my dataset, analogFeatures, is filtered by a feature property:
I used this example for clustering https://docs.mapbox.com/mapbox-gl-js/example/cluster/, and it works how I want it to. Hope this helps someone! |
@angelabelle you could just do |
Still doesn't let us filter the data after the source has been set initially which essentially forces us to setData, which sucks, everytime we want to filter cluster-data on the fly :( |
for me it works by using |
@enersis-pst could you elaborate a bit with a code snippet? Did you manage to filter cluster-data without using setData with filtered features? |
@tmlmt on hover you see first only one feature inside the circle. |
Thanks a lot, @enersis-pst! I took the liberty to make a fork which shows a bit more visually what happens on-click, without the verbose console output. Just keep clicking and it will switch back and forth between points A or B+C being shown. https://jsfiddle.net/4fao60cu/3/ In the meantime I managed to make cluster filtering work as suggested above by filtering the source and using Thanks all for the above comments. |
Allow users to filter features before they are clustered. Some users may want this filtering to happen without transferring GeoJSON between the main thread and worker threads.
We can filter these within the GL JS codebase before passing them to
supercluster
.continued from mapbox/supercluster#11
cc @mourner @lyzidiamond
The text was updated successfully, but these errors were encountered: