Closed devemux86 closed 7 years ago
See PR #296 and #310 by @nebular.
Closed via #296 and #310.
The implementation can be improved in cluster calculation and rendering.
Is this on the current snapshot on sonatype? Looks like it has been updated recently but I could not import the new classes.
Should be in latest snapshots and I see they were built successfully.
Perhaps you need to somehow force Gradle to update them "now" in your build? e.g. see a way in integration guide
Thanks! Ended up pulling it to make a few changes anyway.
Ended up pulling it to make a few changes anyway.
Any improvement is welcome! :slightly_smiling_face:
If I can be of any help please don't hesitate to ask :)
I might do, it's very much spaghetti code at the moment!
The only big issue I am having right now is the overlapping of clusters. It's a bit confusing when clusters end up on top of each other, and I am trying to avoid this by increasing the grid size (to limited success). I'm going to persevere and see what I end up with. ;)
The reason why that happens is that the "cluster" is really the first element with its bitmap changed, so, for example, if there's a succession of spaced markers, the latest ones will not be clustered together until they "invade" the first item position.
The good thing of this approach is that it's very quick to do the calculations and the required changes to the MarkerRender
are minimal.
The bad thing is that, I agree, you get more overlapping than it is desirable.
What would solve the situation is, when one item act as a cluster, to update its position to the middle point. Probably a good approach would be to store the new calculated coordinates in new properties inInternalItem.Clustered
and, if the item acts as a cluster, use those coordinates instead of the original ones.
Incrementing the GRIDSIZE as you have experienced, kind of hides the problem, but depending on how the markers are spaced it can happen again. This week I'm busy with a project deadline, the next one (if you don't fix it before) I will gladly try to improve the algorythm.
Very interesting, thanks for the info!
What seems a bit strange, from user's perspective, is that during zoom in / out the clusters are created in non deterministic way, like each time a random clustering happens.
Implement clustering in adjacent markers.