Skip to content

classifyLegendEntries

classifyLegendEntries(record, options?): ClassifyLegendEntry[]

Defined in: packages/core/src/classify/compile.ts:620

Legend lines for a record: a heading, one line per class (or category), then “Other” and “No data” when they can occur.

ParameterTypeDescription
recordClassifyRecord-
options{ color?: string; layerType?: string; locale?: string; strings?: Strings; title?: string; }-
options.color?stringSwatch colour when the record does not classify colour (radius only): the layer’s own literal colour.
options.layerType?string-
options.locale?stringNumber locale when format: names none (the page’s language).
options.strings?StringsThe document’s UI strings (“No data” and “Other” are maplibre-yaml.Classify.NoData / .Other).
options.title?stringThe heading (the layer’s label, else the field).

ClassifyLegendEntry[]

no lines while a method: waits for its data.