Skip to content

cullLabels

cullLabels(candidates, options): LabelBox[]

Defined in: labels/cull.ts:174

Reduce label candidates to a renderable subset: drop anchors outside the viewport (+padding), then greedily place highest-priority first, skipping any that collide with an already-placed box. Collision uses each label’s true oriented footprint (see labelGeometry), so rotated labels pack by the space they actually occupy on screen rather than their un-rotated dimensions. This keeps the DOM at a few hundred nodes regardless of how many features exist (the “geometry on GPU, only visible labels in DOM” approach).

readonly LabelBox[]

CullOptions

LabelBox[]