-
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
Is there a way to just renderer the visible clusters and items? #82
Comments
You could try the same idea, that I mentioned in issue#29 Just replace Polylines with Markers |
Thanks, that was really helpful. Is it normal that I still have a lot of call to the GC on the log? Is there a way to avoid it? |
ScreenBasedAlgorithmAdapter is now derived from NonHierarchicalDistanceBasedAlgorithm Added new ScreenBasedAlgorithm interface. Implementing this interface, Algorithm has map position and can skip clustering if it is not required. Removed usage of instanceof checks in ClusterManager, which broke algorithms logic, in case of decorations. googlemaps#82
@zamesilyasa ,I found your code. Sorry....but how I can edit Clustermanager? |
I honestly don't understand what are you trying to do |
I found your repo, which is fork of original google-maps-utilis. I cloned issue-82 branch in my pc. With Android Studio I add that project as module. Then i remove original gradle dependency for google-maps-utils. At this point I can use all classs like before. But i don't understand Clustmanager. I was thinking to find So, maybe I jump some step, I don't know |
That's because there is no such method anymore. Please, check VisibleClusteringDemoActivity. |
I am sorry. I'm learning github very slowly. You have reason. now, map is not fast, but also not slowly. |
Hello, i know this is closed but probably this helps someone. I manage 1500+ markers in the map. I just only did somethig like this (based on previous comments)
I put this in shouldRenderAsCluster method |
@nfajardo what is latLngBounds? How you initialise this variable? are you changing this on the zoom change every time? |
Hi @SAPNA-BHOR And in this methods Hope this help you! |
I'm currently using this solution, but I noticed some bad effects with the clustering. So, I'm thinking, is there a way to increase the VisibleBounds with a simply offset to avoid this effect? For example, let me suppose that the VisibleRegion was 100x100, is there a way to set the visible region to 120x120? So when the user drags the map, the nearest cluster doesn't show the bad animation. Is it possible? |
Can any one help on my requirement...I have a json response which has 4 array object..Each array object has list of LatLng values (placing markers on those latlng)..My Cluster should be formed based on array objects..Each array object has a unique ID?? |
Hi,
I don't know if it is the default behavior, but both methods, onBeforeClusterItemRendered and onBeforeClusterRendered, are called every time that I zoom out the map, even when there are not clusters or items visible. Is there a way to just renderer the visible clusters and items?
I have a map with 1000 items, and every item has his own image, so I need to render only the visible elements.
Thanks!
From duplicate issue #82, from @kaads123:
Summary:
ClusterManager draws all the markers/clusters, not only visible ones. It should draw only those that are in visibleRegion. This causes a map with 2000 markers skip frames and ANR (even on new devices) when zooming in/out.
Steps to reproduce:
Add 2000 or more markers and try zooming in and zooming out fast. This can be reproduced in the sample app
Expected behavior:
Draw only those markers/clusters which are in visibleRegion.latLngBounds of the GoogleMap
Observed behavior:
Draws every marker added to ClusterManager
Device and Android version:
Moto G3 with Android 6.0.1
Nexus 6P with Android 7.1.2
Screenshots:
Zoomed out from 20f to 1f quickly
The text was updated successfully, but these errors were encountered: