GeoLeaf Core API - v3.19.0
    Preparing search index...

    Interface LabelUserConfig

    The inline labelConfig accepted by enableLabels(). When the call prepares labels, it is stored with the layer's label state and read at every render, until another enableLabels() call or a re-initialisation of the layer's labels (the loader, a style change) replaces that state. The core makes such a call itself when a layer whose declaration says visibleByDefault: true is shown again: its labels are prepared anew with an empty configuration, and what an earlier call passed here is no longer read.

    What is read from it depends on the layer:

    • a layer that DECLARES no label configuration — neither its style's label object nor its definition's labels block: this object is the whole configuration. enabled: true and labelId (the feature property displayed) are required; font.sizePt, color, opacity, buffer and offset shape the text;
    • a layer that declares one: the declaration decides whether labels exist and how they look. Only two things are still read here — labelId, when the declaration names no field, and minZoom/maxZoom, when the layer's current style sets no labelScale.

    minZoom and maxZoom apply only together. styleFile is refused.

    interface LabelUserConfig {
        enabled?: boolean;
        labelId?: string;
        styleFile?: string;
        font?: LabelFontConfig;
        color?: string;
        opacity?: number;
        buffer?: LabelBufferConfig;
        offset?: LabelOffsetConfig;
        minZoom?: number;
        maxZoom?: number;
        [key: string]: unknown;
    }

    Indexable

    • [key: string]: unknown
    Index
    enabled?: boolean
    labelId?: string
    styleFile?: string
    font?: LabelFontConfig
    color?: string
    opacity?: number
    buffer?: LabelBufferConfig
    offset?: LabelOffsetConfig
    minZoom?: number
    maxZoom?: number