public class ClusterManager<T extends ClusterItem>
extends java.lang.Object
com.google.android.gms.maps.GoogleMap.OnCameraIdleListener
com.google.android.gms.maps.GoogleMap.OnMarkerClickListener
Modifier and Type | Class and Description |
---|---|
static interface |
ClusterManager.OnClusterClickListener<T extends ClusterItem>
Called when a Cluster is clicked.
|
static interface |
ClusterManager.OnClusterInfoWindowClickListener<T extends ClusterItem>
Called when a Cluster's Info Window is clicked.
|
static interface |
ClusterManager.OnClusterItemClickListener<T extends ClusterItem>
Called when an individual ClusterItem is clicked.
|
static interface |
ClusterManager.OnClusterItemInfoWindowClickListener<T extends ClusterItem>
Called when an individual ClusterItem's Info Window is clicked.
|
Constructor and Description |
---|
ClusterManager(android.content.Context context,
GoogleMap map) |
ClusterManager(android.content.Context context,
GoogleMap map,
MarkerManager markerManager) |
Modifier and Type | Method and Description |
---|---|
boolean |
addItem(T myItem)
Adds an item to a cluster.
|
boolean |
addItems(java.util.Collection<T> items)
Adds items to clusters.
|
void |
clearItems()
Removes all items from the cluster manager.
|
void |
cluster()
Force a re-cluster on the map.
|
Algorithm<T> |
getAlgorithm() |
MarkerManager.Collection |
getClusterMarkerCollection() |
MarkerManager.Collection |
getMarkerCollection() |
MarkerManager |
getMarkerManager() |
ClusterRenderer<T> |
getRenderer() |
void |
onCameraIdle()
Might re-cluster.
|
void |
onInfoWindowClick(Marker marker) |
boolean |
onMarkerClick(Marker marker) |
boolean |
removeItem(T item)
Removes an item from clusters.
|
boolean |
removeItems(java.util.Collection<T> items)
Removes items from clusters.
|
void |
setAlgorithm(Algorithm<T> algorithm) |
void |
setAlgorithm(ScreenBasedAlgorithm<T> algorithm) |
void |
setAnimation(boolean animate) |
void |
setOnClusterClickListener(ClusterManager.OnClusterClickListener<T> listener)
Sets a callback that's invoked when a Cluster is tapped.
|
void |
setOnClusterInfoWindowClickListener(ClusterManager.OnClusterInfoWindowClickListener<T> listener)
Sets a callback that's invoked when a Cluster is tapped.
|
void |
setOnClusterItemClickListener(ClusterManager.OnClusterItemClickListener<T> listener)
Sets a callback that's invoked when an individual ClusterItem is tapped.
|
void |
setOnClusterItemInfoWindowClickListener(ClusterManager.OnClusterItemInfoWindowClickListener<T> listener)
Sets a callback that's invoked when an individual ClusterItem's Info Window is tapped.
|
void |
setRenderer(ClusterRenderer<T> renderer) |
boolean |
updateItem(T item)
Updates an item in clusters.
|
public ClusterManager(android.content.Context context, GoogleMap map)
public ClusterManager(android.content.Context context, GoogleMap map, MarkerManager markerManager)
public MarkerManager.Collection getMarkerCollection()
public MarkerManager.Collection getClusterMarkerCollection()
public MarkerManager getMarkerManager()
public void setRenderer(ClusterRenderer<T> renderer)
public void setAlgorithm(ScreenBasedAlgorithm<T> algorithm)
public void setAnimation(boolean animate)
public ClusterRenderer<T> getRenderer()
public void clearItems()
cluster()
for the map to be cleared.public boolean addItems(java.util.Collection<T> items)
cluster()
for the
state of the clusters to be updated on the map.items
- items to add to clusterspublic boolean addItem(T myItem)
cluster()
for
the state of the clusters to be updated on the map.myItem
- item to add to clusterspublic boolean removeItems(java.util.Collection<T> items)
cluster()
for
the state of the clusters to be updated on the map.items
- items to remove from clusterspublic boolean removeItem(T item)
cluster()
for the state of the clusters to be updated on the map.item
- item to remove from clusterspublic boolean updateItem(T item)
cluster()
for
the state of the clusters to be updated on the map.item
- item to update in clusterspublic void cluster()
public void onCameraIdle()
public boolean onMarkerClick(Marker marker)
public void onInfoWindowClick(Marker marker)
public void setOnClusterClickListener(ClusterManager.OnClusterClickListener<T> listener)
public void setOnClusterInfoWindowClickListener(ClusterManager.OnClusterInfoWindowClickListener<T> listener)
public void setOnClusterItemClickListener(ClusterManager.OnClusterItemClickListener<T> listener)
public void setOnClusterItemInfoWindowClickListener(ClusterManager.OnClusterItemInfoWindowClickListener<T> listener)