Cluster Options
Options to show and configure symbol clustering with using SymbolManager.
It exposes a minimal of configuration options, a more advanced setup can be created manually with using CircleLayer and SymbolLayers directly.
Constructors
Functions
Properties
The circle radius of the cluster items in expression, literal(18) by default
The circle radius of the cluster items in expression. Have higher priority than circleRadius, but will apply circleRadius if not set any value.
If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new Point
features in the source with additional properties:
cluster
Istrue
if the point is a clustercluster_id
A unqiue id for the cluster to be used in conjunction with the cluster inspection methodspoint_count
Number of original points grouped into this clusterpoint_count_abbreviated
An abbreviated point count
Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15.
An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form {"property_name": [operator, map_expression]}
. operator
is any expression function that accepts at least 2 operands (e.g. "+"
or "max"
) — it accumulates the property value from clusters/points the cluster contains; map_expression
produces the value of a single point.
Example: {"sum": ["+", ["get", "scalerank"]]}
.
For more advanced use cases, in place of operator
, you can use a custom reduce expression that references a special ["accumulated"]
value, e.g.: {"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}
Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile, 50 by default.
The cluster color levels, which a pair constructed with amount of point and a int color value.