Clusters

Cluster GeoJSON points into scalable circle layers.

<MapClusterLayer data={pointsData} />

Installation

pnpm add @notion-kit/map

API Reference

MapClusterLayer

Creates a clustered GeoJSON source for point data and renders cluster circles, cluster counts, and unclustered point circles.

PropTypeDefaultDescription
data*string | FeatureCollection<Point, P>-GeoJSON data or a URL to fetch GeoJSON from.
clusterMaxZoomnumber14Maximum zoom level for clustering.
clusterRadiusnumber50Cluster radius in pixels.
clusterColors[string, string, string]["#22c55e", "#eab308", "#ef4444"]Colors for small, medium, large clusters.
clusterThresholds[number, number][100, 750]Point count thresholds for cluster steps.
pointColorstring"#3b82f6"Color for unclustered points.
onPointClick(feature, coordinates) => void-Called when an unclustered point is clicked.
onClusterClick(clusterId, coordinates, pointCount) => void-Overrides the default cluster zoom behavior.