Optionaltitle?: DataDrivenPropertyValueSpecification<string>Text of the label: a string, or a MapLibre expression that evaluates to one.
Unset fields keep the defaults: the feature's title as text, size 15, bold font, and
theme-adaptive colours — '#333333' text with a '#FFFFFF' halo on light map styles, the
reverse on dark.
// Simple text
const label: GeometryLabelConfig = {
title: ['get', 'name']
};
// Conditional text, larger and in white
const conditionalLabel: GeometryLabelConfig = {
title: ['case', ['has', 'title'], ['get', 'title'], ['get', 'id']],
size: 18,
color: '#FFFFFF',
haloColor: '#000000',
};
// The title, restyled
const largeLabel: GeometryLabelConfig = { size: 18 };
The label drawn at the center of each geometry: its text, and how it looks.