Class: GoMeasure

GoMeasure

A class representing a measure tool to draw and measure geometries on an OpenLayers map.

new GoMeasure(idMeasure, olMap, measureGeometrytype, callbackStart, callbackEnd, userStyle, defaultTooltip)

Interactions/Analysis/interact/Measure/GoMeasure.ts, line 47

Creates an instance of GoMeasure.

Name Type Description
idMeasure string

Identifier for the measure tool instance.

olMap OlMap

An OpenLayers map object.

measureGeometrytype GOGeometryType

The type of geometry to be measured.

callbackStart function

A function to execute when measurement starts.

callbackEnd function optional

A function to execute when measurement ends.

userStyle styleFromUser optional

A user-defined style for the measured geometry.

defaultTooltip boolean optional

Flag to enable/disable default tooltip display.

Properties:
Name Type Description
style Style | undefined

Private - The style to be applied to the measuring tool.

stylemeasureDraw Style | undefined

Private - The style to be applied to the measuring tool while drawing.

geometryType GeometryType

Private - The type of geometry to be measured.

draw Draw

The drawing object for the measuring tool.

listener *

Private - An event listener for the measuring tool.

measureTooltipElement *

Private - The HTML element to display the measuring tooltip.

sketch *

Private - The feature being drawn for the measuring tool.

defaultTooltipValue boolean | undefined

Private - The default value of the tooltip.

measureTooltip *

Private - The tooltip for the measuring tool.

selectFeatureDrawnStart *

Private - The starting point of the feature being drawn for the measuring tool.

selectFeatureDrawnEnd *

Private - The end point of the feature being drawn for the measuring tool.

measureLayer VectorLayer.<VectorSource> | VectorImageLayer.<VectorSource>

Private - The layer to which the measured feature will be added.

map OlMap

Private - The OpenLayers map instance to which the measuring tool will be added.

callbackEndOwn function

Private - The callback function to be called when measuring is completed.

callbackStartOwn function

Private - The callback function to be called when measuring starts.

mapCallback Map.<string, Map.<string, function()>>

Private - A map of callbacks to be called for different events.

Extends

  • undefined

Methods

RemoveDraw(){void}

Interactions/Analysis/interact/Measure/GoMeasure.ts, line 229

Stop Draw interaction and Remove this from Map

Returns:
Type Description
void Return nothing

changeStyle(userStyle)

Interactions/Analysis/interact/Measure/GoMeasure.ts, line 220

Change the style of the layer

Name Type Description
userStyle module:types~userStyle

The style we want to put on the polygon's drawing layer

getDraw(){Draw}

Interactions/Analysis/interact/Measure/GoMeasure.ts, line 185

Get draw interaction

Returns:
Type Description
Draw Return the draw interaction

getMeasureFeature(){Array.<any>}

Interactions/Analysis/interact/Measure/GoMeasure.ts, line 203

Get Feature from Measure, Only can get Feature when draw end, and don't start new one.

Returns:
Type Description
Array.<any> Return the Feature from Measure

getOverlayTooltip(){any}

Interactions/Analysis/interact/Measure/GoMeasure.ts, line 297

This function allow to get the measure tooltip

Returns:
Type Description
any Return the measure tooltip.

getmeasureLayer(){VectorLayer.<VectorSource>|VectorImageLayer.<VectorSource>}

Interactions/Analysis/interact/Measure/GoMeasure.ts, line 194

Get measureLayer

Returns:
Type Description
VectorLayer.<VectorSource> | VectorImageLayer.<VectorSource> Return the measureLayer

setActivate(active)

Interactions/Analysis/interact/Measure/GoMeasure.ts, line 211

Active or desactive the interaction

Name Type Description
active boolean

True to activate, false to desactivate