Class: ClusterTree

geo.util. ClusterTree

new geo.util.ClusterTree(group, zoom, children)

This class manages a group of nearby points that are clustered as a single object for display purposes. The class constructor is private and only meant to be created by the ClusterGroup object.

This is a tree-like data structure. Each node in the tree is a cluster containing child clusters and unclustered points.

Name Type Description
group geo.util.ClusterGroup

The source cluster group

zoom number

The zoom level of the current node

children Array.<object> optional

An array of ClusterTrees or point objects


Get the coordinates of the cluster (the mean position of all the points contained). This is lazily calculated and cached.

Type Description
geo.geoPosition The 2-d coordinates of the center.


Return the total number of child points contained in the cluster.

Type Description
number Total points contained

Recursively call a function on all points contained in the cluster. Calls the function with this as the current ClusterTree object, and arguments to arguments the point object and the zoom level:, point, zoom).

Name Type Description
func function

The function to call.