Interaction dedicated to measure length.

See our live example: ../examples/measure.html

Hierarchy

  • Measure
    • default

Constructors

Properties

continueMsg: Element | HTMLSpanElement
displayHelpTooltip_: boolean

Whether or not to display any tooltip

format: unitPrefix

The format function

helpTooltipElement_: HTMLElement

The help tooltip element.

helpTooltipOverlay_: Overlay

Overlay to show the help messages.

sketchFeature: Feature<Geometry>

The sketch feature.

source: VectorSource<any>

The snapping source

spherical: boolean
startMsg: Element

The message to show when user is about to start drawing.

tolerance: number

The snapping tolerance in pixels.

Methods

  • Compute the intersection between 2 segments.

    Returns

    The intersection point, undefined if there is no intersection point or lines are coincident.

    Parameters

    • line1: number[][]

      The coordinates of the first line.

    • line2: number[][]

      The coordinates of the second line.

    Returns number[]

  • Returns

    The interaction

    Parameters

    • style: StyleLike

      The sketchStyle used for the drawing interaction.

    • source: VectorSource<LineString>

      Vector source.

    Returns Draw | default

  • Returns

    The draw interaction.

    Returns DrawAzimut | Draw | default

  • Get a reference to the tooltip element.

    Returns

    Tooltip Element.

    Returns Element

  • Function implemented in inherited classes to compute measurement, determine where to place the tooltip and determine which help message to display.

    Parameters

    • callback: ((arg0: string, arg1: Coordinate) => void)

      The function to be called.

        • (arg0: string, arg1: Coordinate): void
        • Parameters

          • arg0: string
          • arg1: Coordinate

          Returns void

    Returns void

  • Create a linestringGeometryFunction that will create a line string with segments snapped to π/4 angle. Use this with the draw interaction and type: 'LineString'.

    Returns

    Geometry.

    Parameters

    • coordinates: number[][]

      Coordinates.

    • Optional opt_geometry: SimpleGeometry

      Geometry.

    Returns SimpleGeometry

Generated using TypeDoc