-
- All Implemented Interfaces:
-
com.google.maps.android.clustering.view.ClusterRenderer
public class DefaultAdvancedMarkersClusterRenderer<T extends ClusterItem> implements ClusterRenderer<T>
The default view for a ClusterManager. Markers are animated in and out of clusters.
-
-
Constructor Summary
Constructors Constructor Description DefaultAdvancedMarkersClusterRenderer(Context context, GoogleMap map, ClusterManager<T> clusterManager)
-
Method Summary
Modifier and Type Method Description voidonAdd()Called when the view is added. voidonRemove()Called when the view is removed. intgetColor(int clusterSize)Called to determine the color of a Cluster. intgetClusterTextAppearance(int clusterSize)Called to determine the text appearance of a cluster. intgetMinClusterSize()Gets the minimum cluster size used to render clusters. voidsetMinClusterSize(int minClusterSize)Sets the minimum cluster size used to render clusters. voidonClustersChanged(Set<out Cluster<T>> clusters)Called when the view needs to be updated because new clusters need to be displayed. voidsetOnClusterClickListener(ClusterManager.OnClusterClickListener<T> listener)voidsetOnClusterInfoWindowClickListener(ClusterManager.OnClusterInfoWindowClickListener<T> listener)voidsetOnClusterInfoWindowLongClickListener(ClusterManager.OnClusterInfoWindowLongClickListener<T> listener)voidsetOnClusterItemClickListener(ClusterManager.OnClusterItemClickListener<T> listener)voidsetOnClusterItemInfoWindowClickListener(ClusterManager.OnClusterItemInfoWindowClickListener<T> listener)voidsetOnClusterItemInfoWindowLongClickListener(ClusterManager.OnClusterItemInfoWindowLongClickListener<T> listener)voidsetAnimation(boolean animate)Called to set animation on or off voidsetAnimationDuration(long animationDurationMs)Sets the length of the animation in milliseconds. MarkergetMarker(T clusterItem)Get the marker from a ClusterItem TgetClusterItem(Marker marker)Get the ClusterItem from a marker MarkergetMarker(Cluster<T> cluster)Get the marker from a Cluster Cluster<T>getCluster(Marker marker)Get the Cluster from a marker -
-
Constructor Detail
-
DefaultAdvancedMarkersClusterRenderer
DefaultAdvancedMarkersClusterRenderer(Context context, GoogleMap map, ClusterManager<T> clusterManager)
-
-
Method Detail
-
onAdd
void onAdd()
Called when the view is added.
-
onRemove
void onRemove()
Called when the view is removed.
-
getColor
int getColor(int clusterSize)
Called to determine the color of a Cluster.
-
getClusterTextAppearance
@StyleRes() int getClusterTextAppearance(int clusterSize)
Called to determine the text appearance of a cluster.
-
getMinClusterSize
int getMinClusterSize()
Gets the minimum cluster size used to render clusters. For example, if "4" is returned,then for any clusters of size 3 or less the items will be rendered as individual markersinstead of as a single cluster marker.
-
setMinClusterSize
void setMinClusterSize(int minClusterSize)
Sets the minimum cluster size used to render clusters. For example, if "4" is provided,then for any clusters of size 3 or less the items will be rendered as individual markersinstead of as a single cluster marker.
- Parameters:
minClusterSize- the minimum cluster size used to render clusters.
-
onClustersChanged
void onClustersChanged(Set<out 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
void setOnClusterClickListener(ClusterManager.OnClusterClickListener<T> listener)
-
setOnClusterInfoWindowClickListener
void setOnClusterInfoWindowClickListener(ClusterManager.OnClusterInfoWindowClickListener<T> listener)
-
setOnClusterInfoWindowLongClickListener
void setOnClusterInfoWindowLongClickListener(ClusterManager.OnClusterInfoWindowLongClickListener<T> listener)
-
setOnClusterItemClickListener
void setOnClusterItemClickListener(ClusterManager.OnClusterItemClickListener<T> listener)
-
setOnClusterItemInfoWindowClickListener
void setOnClusterItemInfoWindowClickListener(ClusterManager.OnClusterItemInfoWindowClickListener<T> listener)
-
setOnClusterItemInfoWindowLongClickListener
void setOnClusterItemInfoWindowLongClickListener(ClusterManager.OnClusterItemInfoWindowLongClickListener<T> listener)
-
setAnimation
void setAnimation(boolean animate)
Called to set animation on or off
-
setAnimationDuration
void setAnimationDuration(long animationDurationMs)
Sets the length of the animation in milliseconds. The default duration is 300 milliseconds.
- Parameters:
animationDurationMs- long: The length of the animation, in milliseconds.
-
getMarker
Marker getMarker(T clusterItem)
Get the marker from a ClusterItem
- Parameters:
clusterItem- ClusterItem which you will obtain its marker
-
getClusterItem
T getClusterItem(Marker marker)
Get the ClusterItem from a marker
- Parameters:
marker- which you will obtain its ClusterItem
-
getMarker
Marker getMarker(Cluster<T> cluster)
Get the marker from a Cluster
- Parameters:
cluster- which you will obtain its marker
-
getCluster
Cluster<T> getCluster(Marker marker)
Get the Cluster from a marker
- Parameters:
marker- which you will obtain its Cluster
-
-
-
-