Applies a layer's declared label configuration, if it has one.
Called by the loader as each layer comes up. A layer without a label block is left
alone — this is not the way to enable labels on a layer that declares none, use
LabelsApi.enableLabels with an inline config for that.
Layer to initialise.
Turns labels on for a layer, optionally with an inline configuration.
⚠️ The return type is Promise<void> | void, not always a promise: the call only
becomes asynchronous when it has a styleFile to fetch. await it anyway — that is
the only form that is correct in both cases.
Layer to label.
OptionallabelConfig: LabelUserConfigInline configuration; omitted, the layer's declared label block
is used. property names the feature field to display, and template supersedes it
with a function over the whole properties object.
OptionalshowImmediately: booleanRender at once instead of waiting for the next zoom
evaluation. Defaults to false.
Turns labels off for a layer and removes the rendered ones.
The configuration is kept, so LabelsApi.toggleLabels can bring them back without re-supplying it.
Layer whose labels are removed.
Whether a layer carries a label configuration at all.
Distinct from LabelsApi.areLabelsEnabled: a layer can be configured and currently off. This is the test that decides whether a label button is worth rendering.
Layer to inspect.
true when a configuration exists.
Public + internal surface of the
Labelssingleton. Used to type thethisreceiver /selfparameters inlabels.tsand theLabels | nulllite stub.