Class: MeasureAzimut

ngeo.interaction.MeasureAzimut

Interaction dedicated to measure length.

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

Constructor

new MeasureAzimut(unitPrefixFormat, numberFormat, [options]opt)

Parameters:
Name Type Attributes Description
unitPrefixFormat !ngeox.unitPrefix

The format function

numberFormat !ngeox.number

The format function

[options] !ngeox.interaction.MeasureOptions= <optional>

Options

Fires:
  • ngeox.event:MeasureEvent

Extends

Members

continueMsg: Element

Message to show after the first point is clicked.

Overrides:

(protected) decimals: number|undefined

Defines the number of decimals to keep in the measurement. If not defined, then the default behaviour occurs depending on the measure type.

Inherited From:

numberFormat: ngeox.number

The format function

(protected) precision: number|undefined

Defines the number of precision to keep in the measurement. If not defined, then the default behaviour occurs depending on the measure type.

Inherited From:

(protected) sketchFeature: ol.Feature

The sketch feature.

Inherited From:

startMsg: Element

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

Inherited From:

unitPrefixFormat: ngeox.unitPrefix

The format function

Methods

(static) getAzimut(line)

Compute azimut from a 2 points line.

Parameters:
Name Type Description
line ol.geom.LineString

LineString.

Returns:
number

Azimut value.

(static) getFormattedAzimut(line, decimals, format)

Format measure output of azimut.

Parameters:
Name Type Description
line !ol.geom.LineString

LineString.

decimals number|undefined

Decimals.

format !ngeox.number

The format function.

Returns:
string

Formatted measure.

(static) getFormattedAzimutRadius(line, projection, decimals, precision, formatLength, formatAzimut)

Format measure output of azimut and radius.

Parameters:
Name Type Description
line !ol.geom.LineString

LineString.

projection !ol.proj.Projection

Projection of the polygon coords.

decimals number|undefined

Decimals.

precision number|undefined

Precision.

formatLength !ngeox.unitPrefix

The format function.

formatAzimut !ngeox.number

The format function.

Returns:
string

Formatted measure.

(protected) createDrawInteraction(style, source)

Creates the draw interaction.

Parameters:
Name Type Description
style ol.style.Style|Array.|ol.StyleFunction|undefined

The sketchStyle used for the drawing interaction.

source ol.source.Vector

Vector source.

Overrides:
Returns:

getDrawInteraction()

Inherited From:
Returns:

getTooltipElement()

Get a reference to the tooltip element.

Inherited From:
Returns:
Element

Tooltip Element.

(protected) handleMeasure(callback)

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

Parameters:
Name Type Description
callback function(string, ?ol.Coordinate)

The function to be called.

Overrides:

setMap()

Inherited From: