-
- All Implemented Interfaces:
-
com.google.maps.android.clustering.algo.Algorithm
public final class ContinuousZoomEuclideanCentroidAlgorithm<T extends ClusterItem> extends CentroidNonHierarchicalDistanceBasedAlgorithm<T>
A variant of CentroidNonHierarchicalDistanceBasedAlgorithm that uses continuous zoom scaling and Euclidean distance for clustering.
This class overrides .getClusters to compute clusters with a zoom-dependent radius, while keeping the centroid-based cluster positions.
-
-
Field Summary
Fields Modifier and Type Field Description private IntegermaxDistanceBetweenClusteredItemsprivate final Collection<T>items
-
Constructor Summary
Constructors Constructor Description ContinuousZoomEuclideanCentroidAlgorithm()
-
Method Summary
Modifier and Type Method Description IntegergetMaxDistanceBetweenClusteredItems()UnitsetMaxDistanceBetweenClusteredItems(Integer maxDistanceBetweenClusteredItems)Collection<T>getItems()Set<Cluster<T>>getClusters(Float zoom)Returns clusters of items for the given zoom level, with cluster positions set to the centroid of their constituent items rather than the position of any single item. -
Methods inherited from class com.google.maps.android.clustering.algo.CentroidNonHierarchicalDistanceBasedAlgorithm
addItem, addItems, clearItems, 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()
-
getClusters
Set<Cluster<T>> getClusters(Float zoom)
Returns clusters of items for the given zoom level, with cluster positions set to the centroid of their constituent items rather than the position of any single item.
- Parameters:
zoom- the current zoom level
-
-
-
-