-
- All Implemented Interfaces:
-
com.google.maps.android.clustering.view.ClusterRenderer
public class DefaultClusterRenderer<T extends ClusterItem> implements ClusterRenderer<T>
The default view for a ClusterManager. Markers are animated in and out of clusters.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classDefaultClusterRenderer.Companion
-
Field Summary
Fields Modifier and Type Field Description private IntegerminClusterSize
-
Constructor Summary
Constructors Constructor Description DefaultClusterRenderer(Context context, GoogleMap mMap, ClusterManager<T> mClusterManager, Executor mExecutor)DefaultClusterRenderer(Context context, GoogleMap mMap, ClusterManager<T> mClusterManager)
-
Method Summary
Modifier and Type Method Description final IntegergetMinClusterSize()If cluster size is less than this size, display individual markers. final UnitsetMinClusterSize(Integer minClusterSize)If cluster size is less than this size, display individual markers. UnitonAdd()Called when the view is added. UnitonRemove()Called when the view is removed. IntegergetColor(Integer clusterSize)Called to determine the color of a Cluster. IntegergetClusterTextAppearance(Integer clusterSize)Called to determine the text appearance of a cluster. UnitonClustersChanged(Set<Cluster<T>> clusters)Called when the view needs to be updated because new clusters need to be displayed. UnitsetOnClusterClickListener(ClusterManager.OnClusterClickListener<T> listener)UnitsetOnClusterInfoWindowClickListener(ClusterManager.OnClusterInfoWindowClickListener<T> listener)UnitsetOnClusterInfoWindowLongClickListener(ClusterManager.OnClusterInfoWindowLongClickListener<T> listener)UnitsetOnClusterItemClickListener(ClusterManager.OnClusterItemClickListener<T> listener)UnitsetOnClusterItemInfoWindowClickListener(ClusterManager.OnClusterItemInfoWindowClickListener<T> listener)UnitsetOnClusterItemInfoWindowLongClickListener(ClusterManager.OnClusterItemInfoWindowLongClickListener<T> listener)UnitsetAnimation(Boolean animate)Called to set animation on or off UnitsetAnimationDuration(Long animationDurationMs). final MarkergetMarker(T clusterItem)Get the marker from a ClusterItem final MarkergetMarker(Cluster<T> cluster)Get the marker from a Cluster final TgetClusterItem(Marker marker)Get the ClusterItem from a marker final Cluster<T>getCluster(Marker marker)Get the Cluster from a marker -
-
Constructor Detail
-
DefaultClusterRenderer
DefaultClusterRenderer(Context context, GoogleMap mMap, ClusterManager<T> mClusterManager, Executor mExecutor)
-
DefaultClusterRenderer
DefaultClusterRenderer(Context context, GoogleMap mMap, ClusterManager<T> mClusterManager)
-
-
Method Detail
-
getMinClusterSize
final Integer getMinClusterSize()
If cluster size is less than this size, display individual markers.
-
setMinClusterSize
final Unit setMinClusterSize(Integer minClusterSize)
If cluster size is less than this size, display individual markers.
-
getClusterTextAppearance
@StyleRes() Integer getClusterTextAppearance(Integer clusterSize)
Called to determine the text appearance of a cluster.
-
onClustersChanged
Unit onClustersChanged(Set<Cluster<T>> clusters)
Called when the view needs to be updated because new clusters need to be displayed.
- Parameters:
clusters- the clusters to be displayed.
-
setOnClusterClickListener
Unit setOnClusterClickListener(ClusterManager.OnClusterClickListener<T> listener)
-
setOnClusterInfoWindowClickListener
Unit setOnClusterInfoWindowClickListener(ClusterManager.OnClusterInfoWindowClickListener<T> listener)
-
setOnClusterInfoWindowLongClickListener
Unit setOnClusterInfoWindowLongClickListener(ClusterManager.OnClusterInfoWindowLongClickListener<T> listener)
-
setOnClusterItemClickListener
Unit setOnClusterItemClickListener(ClusterManager.OnClusterItemClickListener<T> listener)
-
setOnClusterItemInfoWindowClickListener
Unit setOnClusterItemInfoWindowClickListener(ClusterManager.OnClusterItemInfoWindowClickListener<T> listener)
-
setOnClusterItemInfoWindowLongClickListener
Unit setOnClusterItemInfoWindowLongClickListener(ClusterManager.OnClusterItemInfoWindowLongClickListener<T> listener)
-
setAnimation
Unit setAnimation(Boolean animate)
Called to set animation on or off
-
setAnimationDuration
Unit setAnimationDuration(Long animationDurationMs)
.setAnimationDuration The default duration is 300 milliseconds.
- Parameters:
animationDurationMs- long: The length of the animation, in milliseconds.
-
getMarker
final Marker getMarker(T clusterItem)
Get the marker from a ClusterItem
- Parameters:
clusterItem- ClusterItem which you will obtain its marker
-
getMarker
final Marker getMarker(Cluster<T> cluster)
Get the marker from a Cluster
- Parameters:
cluster- which you will obtain its marker
-
getClusterItem
final T getClusterItem(Marker marker)
Get the ClusterItem from a marker
- Parameters:
marker- which you will obtain its ClusterItem
-
getCluster
final Cluster<T> getCluster(Marker marker)
Get the Cluster from a marker
- Parameters:
marker- which you will obtain its Cluster
-
-
-
-