OptionalbadgeAppearance of the cluster count badge.
OptionalsourceClustering options forwarded verbatim to the underlying GeoJSON source.
OptionalclusterProperties?: Record<string, unknown>Aggregators keyed by the cluster property they produce. Each value is
a [operator, mapExpression] pair (e.g. ['+', ['get', 'count']]) or
the advanced [reduceExpression, mapExpression] form.
cluster itself is not settable: theme: 'pin-clustered' switches clustering on.clusterProperties land on each cluster feature's properties, for layer overrides to read
with ['get', '<key>']. The key clusterBaseMapIconIDs is reserved for the module's own.const places = await PlacesModule.create(map, {
theme: 'pin-clustered',
cluster: {
source: {
clusterRadius: 100,
clusterMaxZoom: 14,
clusterMinPoints: 3,
// Total charging points across the cluster
clusterProperties: { connectors: ['+', ['get', 'connectorCount']] }
},
},
layers: {
clusterCount: { layout: { 'text-field': ['get', 'connectors'] } }
}
});
Configuration for the
pin-clusteredtheme.Remarks
Ignored by every other PlacesTheme.
Example