-
Notifications
You must be signed in to change notification settings - Fork 154
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
Reduce noise when building clusters #82
Comments
I have been grappling with the same thing, hoping for an update. (Excellent lib otherwise) The cell size parameter seems to have little or no effect. I believe it's a limitation of using the grid-based algorithm. I also have a maps app on android, which doesn't have this flaw. Looking at the Google Map Utilities Library, it is using a "non-hierarchical distance-based" algorithm. I am looking to see how feasible it would be to create a drop-in replacement for CCHMapClusterOperation that implements that instead. @mikrobi I just forked this project and committed a new CCHMapClusterOperation (.h and .m) that has a distance-based algorithm translated mostly from a google maps utility but trying to work within this library's framework. To make it work, just add a line in the cluster manager: |
@amishjake I had the same thought on exchanging |
@amishjake oh, I didn't get any notification when you changed your comment and linked me. I will check your work today and will send you feedback here! |
I'm interested to see how the distance-based algorithm performs. I my experience, it certainly doesn't scale to several thousand annotations, but this might be acceptable for projects with less annotations and the need for a prettier distribution for clustered annotations. Two notes:
Thanks, |
Claus, Thanks for the feedback. The version in my distancebased_production amishjake On 4/20/2015 7:46 AM, Claus Höfele wrote:
Stephen Sheetz "The devil can cite Scripture for his purpose."
|
Closing this for now. Please reopen if there are new ideas on how to implement this. Thanks |
Hi @choefele,
I've experienced some glitches when zooming. For the perfect clustering algorithm I'd expect clusters to grow on zooming out and clusters to get split on zooming in. In the current implementation huge clusters sometimes get split when zooming out. Even when the zoom change is quite small. In combination with a "move-in"/"move-out" animation (#10) this ends up getting noisy and confusing.
When using the debug grid, it's obvious why these weird (from a user's perspective) cluster changes occur on zooming. The grid lines move a lot whenever we zoom. We can see it in the following screenshots:
State 1: The annotation (pink marker) is in the upper right corner of its grid cell. On the left we have about half a grid cell to the screen border (green marker).
![ios_simulator_-iphone_5s-iphone_5s___ios_8_2__12d508](https://cloud.githubusercontent.com/assets/423347/7062407/300cc316-de9d-11e4-96da-7ddc527b8660.png)
Now when I (very) slightly change the zoom, I get state 2: The grid position changed, so that the annotation (pink marker) is now in the upper middle of its grid cell. On the left the first grid cell almost aligns with the screen border (green) marker.
![ios_simulator_-iphone_5s-iphone_5s___ios_8_2__12d508](https://cloud.githubusercontent.com/assets/423347/7062454/b73afa60-de9d-11e4-9664-5375e15ca5f1.png)
The screenshots show that we basically see the same map area in state 1 and state 2, however the grid position changed significantly. This can lead to unexpected (for the user who doesn't know about the clustering algorithm) cluster changes because some annotations might move into another grid cell.
I haven't spent too much time yet in figuring out how we can make the grid more "stable" to avoid this behaviour. So I was wondering if you've already spent some time/thoughts on that and if you have any ideas how to improve the grid placement after zooming to avoid undesired re-clustering on small zoom changes.
Cheers!
The text was updated successfully, but these errors were encountered: