ClusterManager

open class ClusterManager<T : ClusterItem?> : GoogleMap.OnCameraIdleListener, GoogleMap.OnMarkerClickListener, GoogleMap.OnInfoWindowClickListener

Groups many items on a map based on zoom level.

ClusterManager should be added to the map as an:

  • com.google.android.gms.maps.GoogleMap.OnCameraIdleListener
  • com.google.android.gms.maps.GoogleMap.OnMarkerClickListener

Constructors

Link copied to clipboard
constructor(context: Context, map: GoogleMap)
constructor(context: Context, map: GoogleMap, markerManager: MarkerManager)

Types

Link copied to clipboard
Called when a Cluster is clicked.
Link copied to clipboard
Called when a Cluster's Info Window is clicked.
Link copied to clipboard
Called when a Cluster's Info Window is long clicked.
Link copied to clipboard
Called when an individual ClusterItem is clicked.
Link copied to clipboard
Called when an individual ClusterItem's Info Window is clicked.
Link copied to clipboard
Called when an individual ClusterItem's Info Window is long clicked.

Functions

Link copied to clipboard
open fun addItem(myItem: T): Boolean
Adds an item to a cluster.
Link copied to clipboard
open fun addItems(items: Collection<T>): Boolean
Adds items to clusters.
Link copied to clipboard
open fun clearItems()
Removes all items from the cluster manager.
Link copied to clipboard
open fun cluster()
Force a re-cluster on the map.
Link copied to clipboard
open fun getAlgorithm(): Algorithm<T>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun onCameraIdle()
Might re-cluster.
Link copied to clipboard
open fun onInfoWindowClick(@NonNull marker: Marker)
Link copied to clipboard
open fun onMarkerClick(@NonNull marker: Marker): Boolean
Link copied to clipboard
open fun removeItem(item: T): Boolean
Removes an item from clusters.
Link copied to clipboard
open fun removeItems(items: Collection<T>): Boolean
Removes items from clusters.
Link copied to clipboard
open fun setAlgorithm(algorithm: Algorithm<T>)
open fun setAlgorithm(algorithm: ScreenBasedAlgorithm<T>)
Link copied to clipboard
open fun setAnimation(animate: Boolean)
Link copied to clipboard
Sets a callback that's invoked when a Cluster is tapped.
Link copied to clipboard
Sets a callback that's invoked when a Cluster info window is tapped.
Link copied to clipboard
Sets a callback that's invoked when a Cluster info window is long-pressed.
Link copied to clipboard
Sets a callback that's invoked when an individual ClusterItem is tapped.
Link copied to clipboard
Sets a callback that's invoked when an individual ClusterItem's Info Window is tapped.
Sets a callback that's invoked when an individual ClusterItem's Info Window is long-pressed.
Link copied to clipboard
open fun setRenderer(renderer: ClusterRenderer<T>)
Link copied to clipboard
open fun updateItem(item: T): Boolean
Updates an item in clusters.