Interaction dedicated to measure length.

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

### Hierarchy

- Measure
  - default

## Index

### Constructors

- constructor

### Properties

- continueMsg
- displayHelpTooltip_
- format
- helpTooltipElement_
- helpTooltipOverlay_
- sketchFeature
- source
- spherical
- startMsg
- tolerance

### Methods

- computeLineSegmentIntersection
- createDrawInteraction
- getDrawInteraction
- getTooltipElement
- handleMeasure
- linestringGeometryFunction
- setMap

## Constructors

### constructor

- new default(format: unitPrefix, gettextCatalog: gettextCatalog, options?: MeasureOptions): default

- Overrides ngeoInteractionMeasure.constructor

  - Defined in src/interaction/MeasureLength.js:42

  #### Parameters

  - ##### format: unitPrefix

    The format function

  - ##### gettextCatalog: gettextCatalog

    Gettext catalog.

  - ##### options: MeasureOptions = {}

  #### Returns default

## Properties

### continueMsg

continueMsg: Element | HTMLSpanElement

Inherited from ngeoInteractionMeasure.continueMsg

- Defined in src/interaction/MeasureLength.js:56

### displayHelpTooltip_

displayHelpTooltip_: boolean

Inherited from ngeoInteractionMeasure.displayHelpTooltip_

- Defined in src/interaction/Measure.js:155

Whether or not to display any tooltip

### format

format: unitPrefix

- Defined in src/interaction/MeasureLength.js:75

The format function

### helpTooltipElement_

helpTooltipElement_: HTMLElement

Inherited from ngeoInteractionMeasure.helpTooltipElement_

- Defined in src/interaction/Measure.js:85

The help tooltip element.

### helpTooltipOverlay_

helpTooltipOverlay_: Overlay

Inherited from ngeoInteractionMeasure.helpTooltipOverlay_

- Defined in src/interaction/Measure.js:92

Overlay to show the help messages.

### sketchFeature

sketchFeature: Feature<Geometry>

Inherited from ngeoInteractionMeasure.sketchFeature

- Defined in src/interaction/Measure.js:123

The sketch feature.

### source

source: VectorSource<any>

- Defined in src/interaction/MeasureLength.js:89

The snapping source

### spherical

spherical: boolean

- Defined in src/interaction/MeasureLength.js:68

### startMsg

startMsg: Element

Inherited from ngeoInteractionMeasure.startMsg

- Defined in src/interaction/Measure.js:169

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

### tolerance

tolerance: number

- Defined in src/interaction/MeasureLength.js:82

The snapping tolerance in pixels.

## Methods

### computeLineSegmentIntersection

- computeLineSegmentIntersection(line1: number[][], line2: number[][]): number[]

- - Defined in src/interaction/MeasureLength.js:231

  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

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

- Overrides ngeoInteractionMeasure.createDrawInteraction

  - Defined in src/interaction/MeasureLength.js:98

  #### Parameters

  - ##### style: StyleLike

    The sketchStyle used for the drawing interaction.

  - ##### source: VectorSource<LineString>

    Vector source.

  #### Returns Draw | default

  The interaction

### getDrawInteraction

- getDrawInteraction(): Draw | DrawAzimut | default

- Inherited from ngeoInteractionMeasure.getDrawInteraction

  - Defined in src/interaction/Measure.js:261

  #### Returns Draw | DrawAzimut | default

  The draw interaction.

### getTooltipElement

- getTooltipElement(): Element

- Inherited from ngeoInteractionMeasure.getTooltipElement

  - Defined in src/interaction/Measure.js:513

  Get a reference to the tooltip element.

  #### Returns Element

  Tooltip Element.

### handleMeasure

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

- Overrides ngeoInteractionMeasure.handleMeasure

  - Defined in src/interaction/MeasureLength.js:209

  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

### linestringGeometryFunction

- linestringGeometryFunction(coordinates: number[][], opt_geometry: SimpleGeometry): SimpleGeometry

- - Defined in src/interaction/MeasureLength.js:119

  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

- setMap(map: PluggableMap): void

- Inherited from ngeoInteractionMeasure.setMap

  - Defined in src/interaction/Measure.js:281

  #### Parameters

  - ##### map: PluggableMap

    Map.

  #### Returns void

Generated using TypeDoc