MeasureControl Plugin control constructor options

interface MeasureControlOptions {
    lineLayerLabelSpec?: SymbolLayerSpecification;
    lineLayerNodeSpec?: CircleLayerSpecification;
    modeOptions?: ModeOptions;
    modes?: (
        | "render"
        | "linestring"
        | "polygon"
        | "rectangle"
        | "circle"
        | "freehand"
        | "angled-rectangle"
        | "sensor"
        | "sector"
        | "select"
        | "delete-selection"
        | "delete"
        | "download"
    )[];
    open?: boolean;
    polygonLayerSpec?: SymbolLayerSpecification;
}

Properties

lineLayerLabelSpec?: SymbolLayerSpecification

Maplibre symbol layer specification (on line nodes) for line distance layer

lineLayerNodeSpec?: CircleLayerSpecification

Maplibre circle layer specification for visualizing node style of line distance layer

modeOptions?: ModeOptions

Overwrite Terra Draw mode options if you specified.

modes?: (
    | "render"
    | "linestring"
    | "polygon"
    | "rectangle"
    | "circle"
    | "freehand"
    | "angled-rectangle"
    | "sensor"
    | "sector"
    | "select"
    | "delete-selection"
    | "delete"
    | "download"
)[]

Terradraw modes added to the control. The mode will be added in the same order of the array. Default is all modes in the below order: ['render','linestring','polygon', 'rectangle','angled-rectangle','circle', 'freehand','sector','sensor', 'delete']

You can change the order of modes, or can get rid of some modes which you don't need for your app.

open?: boolean

Open editor as default if true. Default is false

polygonLayerSpec?: SymbolLayerSpecification

Maplibre symbol layer specification (centroid) for polygon area layer