-
- All Implemented Interfaces:
-
com.google.maps.android.clustering.algo.Algorithm
,com.google.maps.android.clustering.algo.ScreenBasedAlgorithm
public class NonHierarchicalViewBasedAlgorithm<T extends ClusterItem> extends NonHierarchicalDistanceBasedAlgorithm<T> implements ScreenBasedAlgorithm<T>
Algorithm that can be used for managing large numbers of items (>1000 markers). This algorithm works the same way as NonHierarchicalDistanceBasedAlgorithm but works, only in visible area. It requires shouldReclusterOnMapMovement to be true in order to re-render clustering when camera movement changes the visible area.
-
-
Constructor Summary
Constructors Constructor Description NonHierarchicalViewBasedAlgorithm(int screenWidth, int screenHeight)
-
Method Summary
Modifier and Type Method Description void
onCameraChange(CameraPosition cameraPosition)
boolean
shouldReclusterOnMapMovement()
void
updateViewSize(int width, int height)
Update view width and height in case map size was changed.You need to recluster all the clusters, to update view state after view size changes. -
Methods inherited from class com.google.maps.android.clustering.algo.NonHierarchicalDistanceBasedAlgorithm
addItem, addItems, clearItems, getClusters, getItems, getMaxDistanceBetweenClusteredItems, removeItem, removeItems, setMaxDistanceBetweenClusteredItems, updateItem
-
Methods inherited from class com.google.maps.android.clustering.algo.AbstractAlgorithm
lock, unlock
-
Methods inherited from class com.google.maps.android.clustering.algo.ScreenBasedAlgorithm
onCameraChange
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
onCameraChange
void onCameraChange(CameraPosition cameraPosition)
-
shouldReclusterOnMapMovement
boolean shouldReclusterOnMapMovement()
-
updateViewSize
void updateViewSize(int width, int height)
Update view width and height in case map size was changed.You need to recluster all the clusters, to update view state after view size changes.
- Parameters:
width
- map width in dpheight
- map height in dp
-
-
-
-