Options
All
  • Public
  • Public/Protected
  • All
Menu

Interaction dedicated to measure length.

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

Hierarchy

  • Measure
    • default

Index

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

  • computeLineSegmentIntersection(line1: number[][], line2: number[][]): number[]
  • Compute the intersection between 2 segments.

    Parameters

    • line1: number[][]

      The coordinates of the first line.

    • line2: number[][]

      The coordinates of the second line.

    Returns number[]

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

  • createDrawInteraction(style: StyleLike, source: VectorSource<LineString>): Draw | default
  • Parameters

    • style: StyleLike

      The sketchStyle used for the drawing interaction.

    • source: VectorSource<LineString>

      Vector source.

    Returns Draw | default

    The interaction

  • getDrawInteraction(): Draw | DrawAzimut | default
  • Returns Draw | DrawAzimut | default

    The draw interaction.

  • getTooltipElement(): Element
  • Get a reference to the tooltip element.

    Returns Element

    Tooltip Element.

  • handleMeasure(callback: ((arg0: string, arg1: Coordinate) => void)): void
  • 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

  • linestringGeometryFunction(coordinates: number[][], opt_geometry: SimpleGeometry): SimpleGeometry
  • Create a linestringGeometryFunction that will create a line string with segments snapped to π/4 angle. Use this with the draw interaction and type: 'LineString'.

    Parameters

    • coordinates: number[][]

      Coordinates.

    • opt_geometry: SimpleGeometry

    Returns SimpleGeometry

    Geometry.

  • setMap(map: PluggableMap): void

Generated using TypeDoc