# Class default

Interaction dedicated to measure length.

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

#### Hierarchy

- Measure
  - default

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

#####
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, gettextCatalog, options?): default

- #### Parameters

  - format: unitPrefix

    The format function

  - gettextCatalog: gettextCatalog

    Gettext catalog.

  - `Optional` options: MeasureOptions = {}

    Options

  #### Returns default

  Overrides ngeoInteractionMeasure.constructor

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

## Properties

### continueMsg

continueMsg: Element | HTMLSpanElement

Inherited from ngeoInteractionMeasure.continueMsg

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

### displayHelpTooltip_

displayHelpTooltip_: boolean

Whether or not to display any tooltip

Inherited from ngeoInteractionMeasure.displayHelpTooltip_

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

### format

format: unitPrefix

The format function

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

### helpTooltipElement_

helpTooltipElement_: HTMLElement

The help tooltip element.

Inherited from ngeoInteractionMeasure.helpTooltipElement_

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

### helpTooltipOverlay_

helpTooltipOverlay_: Overlay

Overlay to show the help messages.

Inherited from ngeoInteractionMeasure.helpTooltipOverlay_

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

### sketchFeature

sketchFeature: Feature<Geometry>

The sketch feature.

Inherited from ngeoInteractionMeasure.sketchFeature

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

### source

source: VectorSource<any>

The snapping source

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

### spherical

spherical: boolean

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

### startMsg

startMsg: Element

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

Inherited from ngeoInteractionMeasure.startMsg

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

### tolerance

tolerance: number

The snapping tolerance in pixels.

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

## Methods

### computeLineSegmentIntersection

- computeLineSegmentIntersection(line1, line2): 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.

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

### createDrawInteraction

- createDrawInteraction(style, source): Draw | default

- #### Parameters

  - style: StyleLike

    The sketchStyle used for the drawing interaction.

  - source: VectorSource<LineString>

    Vector source.

  #### Returns Draw | default

  The interaction

  Overrides ngeoInteractionMeasure.createDrawInteraction

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

### getDrawInteraction

- getDrawInteraction(): DrawAzimut | Draw | default

- #### Returns DrawAzimut | Draw | default

  The draw interaction.

  Inherited from ngeoInteractionMeasure.getDrawInteraction

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

### getTooltipElement

- getTooltipElement(): Element

- Get a reference to the tooltip element.

  #### Returns Element

  Tooltip Element.

  Inherited from ngeoInteractionMeasure.getTooltipElement

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

### handleMeasure

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

    The function to be called.

    - - (arg0, arg1): void

      - #### Parameters

        - arg0: string
        - arg1: Coordinate

        #### Returns void

  Overrides ngeoInteractionMeasure.handleMeasure

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

### linestringGeometryFunction

- linestringGeometryFunction(coordinates, opt_geometry?): 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.

  - `Optional` opt_geometry: SimpleGeometry

    Geometry.

  #### Returns SimpleGeometry

  Geometry.

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

### setMap

- setMap(map): void

- #### Parameters

  - map: Map

    Map.

  #### Returns void

  Inherited from ngeoInteractionMeasure.setMap

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

Generated using TypeDoc