@watergis/maplibre-gl-terradraw
    Preparing search index...

    Type Alias TextModeOptions

    Constructor options for TerraDrawTextMode.

    new TerraDrawTextMode({
    editable: true,
    placeholder: 'Add a label…',
    styles: { textColor: '#333333', textSize: 14 },
    onTextCommit: (id, text) => console.log(id, text),
    });
    type TextModeOptions = {
        domStyles?: DOMStyles;
        draggable?: boolean;
        editable?: boolean;
        onTextCommit?: (featureId: TerraDrawExtend.FeatureId, text: string) => void;
        placeholder?: string;
        styles?: Partial<TextModeStyling>;
    }
    Index
    domStyles?: DOMStyles

    Override the default CSS styles applied to the textarea popup DOM elements. Each property is merged over the corresponding defaults from defaultTextAreaStyleOptions / defaultSubmitButtonStyleOptions.

    draggable?: boolean

    Not used. Draggability is controlled by the TerraDrawSelectMode flags.text.feature.draggable setting.

    editable?: boolean

    When true, clicking/tapping near an existing label opens the textarea pre-filled with the current text so the user can edit it in place. Defaults to false.

    onTextCommit?: (featureId: TerraDrawExtend.FeatureId, text: string) => void

    Called after every successful commit — both new placements and edits.

    Type Declaration

      • (featureId: TerraDrawExtend.FeatureId, text: string): void
      • Parameters

        • featureId: TerraDrawExtend.FeatureId

          The TerraDraw feature ID of the committed Point feature.

        • text: string

          The trimmed text string that was committed.

        Returns void

    placeholder?: string

    Placeholder text shown in the textarea popup before the user types. Defaults to "Enter label...".

    styles?: Partial<TextModeStyling>

    MapLibre symbol-layer style overrides applied to committed text features. Merged over the defaults supplied by MaplibreTerradrawControl.