-
- All Implemented Interfaces:
-
com.google.maps.android.clustering.algo.Algorithm,com.google.maps.android.clustering.algo.ScreenBasedAlgorithm
public final 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classNonHierarchicalViewBasedAlgorithm.Companion
-
Field Summary
Fields Modifier and Type Field Description private IntegermaxDistanceBetweenClusteredItemsprivate final Collection<T>items
-
Constructor Summary
Constructors Constructor Description NonHierarchicalViewBasedAlgorithm(Integer mViewWidth, Integer mViewHeight)
-
Method Summary
Modifier and Type Method Description IntegergetMaxDistanceBetweenClusteredItems()UnitsetMaxDistanceBetweenClusteredItems(Integer maxDistanceBetweenClusteredItems)Collection<T>getItems()UnitonCameraChange(CameraPosition position)BooleanshouldReclusterOnMapMovement()final UnitupdateViewSize(Integer width, Integer height)Update view width and height in case map size was changed. -
Methods inherited from class com.google.maps.android.clustering.algo.NonHierarchicalViewBasedAlgorithm
addItem, addItems, clearItems, getClusters, removeItem, removeItems, updateItem -
Methods inherited from class com.google.maps.android.clustering.algo.NonHierarchicalDistanceBasedAlgorithm
lock, unlock -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getMaxDistanceBetweenClusteredItems
Integer getMaxDistanceBetweenClusteredItems()
-
setMaxDistanceBetweenClusteredItems
Unit setMaxDistanceBetweenClusteredItems(Integer maxDistanceBetweenClusteredItems)
-
getItems
Collection<T> getItems()
-
onCameraChange
Unit onCameraChange(CameraPosition position)
-
shouldReclusterOnMapMovement
Boolean shouldReclusterOnMapMovement()
-
updateViewSize
final Unit updateViewSize(Integer width, Integer 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
-
-
-
-