Class NonHierarchicalViewBasedAlgorithm<T extends ClusterItem>
- java.lang.Object
-
- com.google.maps.android.clustering.algo.AbstractAlgorithm<T>
-
- com.google.maps.android.clustering.algo.NonHierarchicalDistanceBasedAlgorithm<T>
-
- com.google.maps.android.clustering.algo.NonHierarchicalViewBasedAlgorithm<T>
-
- Type Parameters:
T-
- All Implemented Interfaces:
Algorithm<T>,ScreenBasedAlgorithm<T>
public class NonHierarchicalViewBasedAlgorithm<T extends ClusterItem> extends NonHierarchicalDistanceBasedAlgorithm<T> implements ScreenBasedAlgorithm<T>
This algorithm works the same way asNonHierarchicalDistanceBasedAlgorithmbut works, only in visible area. It requires to be reclustered on camera movement because clustering is done only for visible area.
-
-
Constructor Summary
Constructors Constructor Description NonHierarchicalViewBasedAlgorithm(int screenWidth, int screenHeight)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonCameraChange(com.google.android.gms.maps.model.CameraPosition cameraPosition)booleanshouldReclusterOnMapMovement()voidupdateViewSize(int width, int height)Update view width and height in case map size was changed.-
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 java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.google.maps.android.clustering.algo.Algorithm
addItem, addItems, clearItems, getClusters, getItems, getMaxDistanceBetweenClusteredItems, lock, removeItem, removeItems, setMaxDistanceBetweenClusteredItems, unlock, updateItem
-
-
-
-
Method Detail
-
onCameraChange
public void onCameraChange(com.google.android.gms.maps.model.CameraPosition cameraPosition)
- Specified by:
onCameraChangein interfaceScreenBasedAlgorithm<T extends ClusterItem>
-
shouldReclusterOnMapMovement
public boolean shouldReclusterOnMapMovement()
- Specified by:
shouldReclusterOnMapMovementin interfaceScreenBasedAlgorithm<T extends ClusterItem>
-
updateViewSize
public 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
-
-