Maplibre GL Terra Draw Measure Control

Hierarchy (View Summary)

Constructors

Properties

controlContainer?: HTMLElement
defaultMode: string = 'render'
events: {
    [key: string]: [
        (
            event?: {
                feature?: GeoJSONStoreFeatures[];
                mode?:
                    | "render"
                    | "point"
                    | "linestring"
                    | "polygon"
                    | "rectangle"
                    | "circle"
                    | "freehand"
                    | "angled-rectangle"
                    | "sensor"
                    | "sector"
                    | "select"
                    | "delete-selection"
                    | "delete"
                    | "download";
            },
        ) => void,
    ];
} = {}
isExpanded: boolean = false
map?: Map$1
modeButtons: { [key: string]: HTMLButtonElement } = {}
options: TerradrawControlOptions = defaultControlOptions
terradraw?: TerraDraw

Methods

  • Add Terra Draw drawing mode button

    Parameters

    • mode:
          | "render"
          | "point"
          | "linestring"
          | "polygon"
          | "rectangle"
          | "circle"
          | "freehand"
          | "angled-rectangle"
          | "sensor"
          | "sector"
          | "select"
          | "delete-selection"
          | "delete"
          | "download"

      Terra Draw mode name

    Returns void

  • get GeoJSON features

    Parameters

    • onlySelected: boolean = false

      If true, returns only selected features. Default is false.

    Returns undefined | { features: GeoJSONStoreFeatures[]; type: string }

    FeatureCollection in GeoJSON format