Skip to content

five-on-it / apps/client/src/ui/map-labels / declutter

Function: declutter() ​

declutter(candidates, measure, width, height): PlacedLabel[]

Defined in: apps/client/src/ui/map-labels.ts:166

The labels that fit, by priority (the districts, the markers' boxes, the streets, the garages; in their given order within a kind): each placed unless its box would stick out of the map or overlap one placed before it. measure gives a text's width (px).

Parameters ​

candidates ​

readonly LabelCandidate[]

measure ​

(text) => number

width ​

number

height ​

number

Returns ​

PlacedLabel[]