Class ClusterRendererMultipleItems
-
- All Implemented Interfaces:
-
com.google.maps.android.clustering.view.ClusterRenderer
public class ClusterRendererMultipleItems<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 enumClusterRendererMultipleItems.AnimationType
-
Field Summary
Fields Modifier and Type Field Description private IntegerminClusterSize
-
Constructor Summary
Constructors Constructor Description ClusterRendererMultipleItems(Context context, GoogleMap mMap, ClusterManager<T> mClusterManager, Executor mExecutor)ClusterRendererMultipleItems(Context context, GoogleMap mMap, ClusterManager<T> mClusterManager)
-
Method Summary
Modifier and Type Method Description IntegergetMinClusterSize()If cluster size is less than this size, display individual markers. UnitsetMinClusterSize(Integer minClusterSize)If cluster size is less than this size, display individual markers. final UnitsetAnimationType(ClusterRendererMultipleItems.AnimationType type)final UnitsetAnimationInterpolator(TimeInterpolator interpolator)Sets the interpolator for the animation. 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. final UnitsetLoggingEnabled(Boolean enabled)Enables or disables logging for the cluster renderer. 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 UnitstopAnimation()MarkergetMarker(T clusterItem)Get the marker from a ClusterItem MarkergetMarker(Cluster<T> cluster)Get the marker from a Cluster TgetClusterItem(Marker marker)Get the ClusterItem from a marker Cluster<T>getCluster(Marker marker)Get the Cluster from a marker -
-
Constructor Detail
-
ClusterRendererMultipleItems
ClusterRendererMultipleItems(Context context, GoogleMap mMap, ClusterManager<T> mClusterManager, Executor mExecutor)
-
ClusterRendererMultipleItems
ClusterRendererMultipleItems(Context context, GoogleMap mMap, ClusterManager<T> mClusterManager)
-
-
Method Detail
-
getMinClusterSize
Integer getMinClusterSize()
If cluster size is less than this size, display individual markers.
-
setMinClusterSize
Unit setMinClusterSize(Integer minClusterSize)
If cluster size is less than this size, display individual markers.
-
setAnimationType
final Unit setAnimationType(ClusterRendererMultipleItems.AnimationType type)
-
setAnimationInterpolator
final Unit setAnimationInterpolator(TimeInterpolator interpolator)
Sets the interpolator for the animation.
- Parameters:
interpolator- the interpolator to use for the animation.
-
getClusterTextAppearance
@StyleRes() Integer getClusterTextAppearance(Integer clusterSize)
Called to determine the text appearance of a cluster.
-
setLoggingEnabled
final Unit setLoggingEnabled(Boolean enabled)
Enables or disables logging for the cluster renderer.
When enabled, the renderer will log internal operations such as cluster rendering, marker updates, and other debug information. This is useful for development and debugging, but should typically be disabled in production builds.
- Parameters:
enabled-trueto enable logging;falseto disable it.
-
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.
-
stopAnimation
final Unit stopAnimation()
-
getMarker
Marker getMarker(T clusterItem)
Get the marker from a ClusterItem
- Parameters:
clusterItem- ClusterItem which you will obtain its marker- Returns:
a marker from a ClusterItem or null if it does not exists
-
getMarker
Marker getMarker(Cluster<T> cluster)
Get the marker from a Cluster
- Parameters:
cluster- which you will obtain its marker- Returns:
a marker from a cluster or null if it does not exists
-
getClusterItem
T getClusterItem(Marker marker)
Get the ClusterItem from a marker
- Parameters:
marker- which you will obtain its ClusterItem- Returns:
a ClusterItem from a marker or null if it does not exists
-
getCluster
Cluster<T> getCluster(Marker marker)
Get the Cluster from a marker
- Parameters:
marker- which you will obtain its Cluster- Returns:
a Cluster from a marker or null if it does not exists
-
-
-
-