-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Clustering animation too slow #164
Comments
Is it possible that the unclustering happens on all markers - not only on those that are currently displayed? My memory jumps from 12mb straight to 30mb (around 1200 markers) when zooming in. This would explain why its getting slow. I will have a look into the code when I have some time. |
As one solution you can now choose to disable the animations, which was added in 27f7a5b |
Is there a solution for this issue? I have tried both with and without animation, and I still get the same result. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@Libby713 the issue persists even if you disable the animations, the clustering action looks ugly going from a lot of unclustered markers and they become clustered. |
Would restricting the markers and therefore the clusters to only those visible within the viewport help? I am not sure if the animation currently is played out on all the cluster markers laid out on the map or only those that are within the viewport. |
@daljeet33 That sounds like a possible cause worth investigating. |
I agree that restricting clustering to visible viewport may help. Another possible fix is to move to the Maps SDK for Android v3.0.0 beta (instead of Play Services): The release notes say that this bug for "Poor performance adding markers: each marker takes about 25ms on the UI thread" was fixed in that release: |
Looks like @amuramoto started a transition to Android Maps SDK for Android v3 in this branch: @amuramoto Do you recall the current state of this branch, in terms of what's left to do? |
The standalone v3 SDK is integrated in this branch, but since the SDK is still in beta we don't want to merge with master |
@amuramoto Thanks, makes sense. |
After digging into the library a bit more, it turns out there is already an implementation of a view-based clustering algorithm - In the demo app, this is implemented in the When setting up DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
...
mClusterManager = new ClusterManager<>(this, getMap());
mClusterManager.setAlgorithm(new NonHierarchicalViewBasedAlgorithm<MyItem>(
metrics.widthPixels, metrics.heightPixels)); I modified
After this testing, I'm fairly confident that anyone having clustering performance issues should be able to resolve them by using the Please give that a shot and let us know how it goes! |
The animation is too slow. When zooming in. after all markers move to their locations the cluster circle remains there like for 2 secs until it desappears.
The text was updated successfully, but these errors were encountered: