java.lang.Object | |||
↳ | com.carto.layers.Layer | ||
↳ | com.carto.layers.VectorLayer | ||
↳ | com.carto.layers.ClusteredVectorLayer |
A vector layer that supports clustering point-type features.
A Pairwise centroid hierarchical clustering algorithm is used internally.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ClusteredVectorLayer(LocalVectorDataSource dataSource, ClusterElementBuilder clusterElementBuilder)
Constructs a new ClusteredVectorLayer instance from data source and a special callback.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
synchronized void | delete() | ||||||||||
boolean |
expandCluster(VectorElement clusterElement, float px)
Expands or shrinks the given cluster element.
| ||||||||||
ClusterElementBuilder |
getClusterElementBuilder()
Returns the current callback used for creating cluster elements.
| ||||||||||
float |
getMaximumClusterZoom()
Returns the maximum zoom level when clusters are shown.
| ||||||||||
float |
getMinimumClusterDistance()
Returns the current minimum distance between clusters (in device-independent pixels).
| ||||||||||
boolean |
isAnimatedClusters()
Returns the cluster animation flag value.
| ||||||||||
void |
refresh()
Refreshes the layer using old stored visibility information.
| ||||||||||
void |
setAnimatedClusters(boolean animated)
Enables or disables the animation of clusters.
| ||||||||||
void |
setMaximumClusterZoom(float maxZoom)
Sets the maximum zoom level when clusters are shown.
| ||||||||||
void |
setMinimumClusterDistance(float px)
Sets the minimum distance between clusters (in device-independent pixels).
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
Constructs a new ClusteredVectorLayer instance from data source and a special callback.
dataSource | The local data source that contains the elements for clustering. |
---|---|
clusterElementBuilder | The callback for creating and customizing cluster elements. |
Expands or shrinks the given cluster element. In expanded state,
all elements of the cluster are placed at specified distance from the cluster center.
clusterElement | The cluster element to expand or shrink. |
---|---|
px | The distance (in device-independent pixels) between cluster center and expanded elements. Use 0 to shrink already expanded cluster. |
Returns the current callback used for creating cluster elements.
Returns the maximum zoom level when clusters are shown. If zoom level is greater, then
clusters are replaced with individual elements. Default is 24.
Returns the current minimum distance between clusters (in device-independent pixels).
Returns the cluster animation flag value.
Refreshes the layer using old stored visibility information. This method might be called if some of the layer data
changes.
Enables or disables the animation of clusters. By default animations are enabled.
animated | The animated flag. |
---|
Sets the maximum zoom level when clusters are shown. If zoom level is greater, then
clusters are replaced with individual elements.
maxZoom | The new maximum clustering zoom level. |
---|
Sets the minimum distance between clusters (in device-independent pixels).
px | The new value in device-independent pixels. The default is 100. |
---|