Angular service

service source

Methods

activateMeasuring (mode)

Start measuring interaction in app

Parameters

NameTypeDescription
mode Boolean

Optional parameter, Geometry type of measurement ('area' for polygon, 'line' for linestring) Line is default

addInteraction (type)

Initialize draw interaction on Ol.map and event handlers for handling start and end of drawing

Parameters

NameTypeDescription
type Boolean

Geometry type

addMultiple (val1, val2)

Add two measure results for multiple shape mode to display joined result

Parameters

NameTypeDescription
val1 object

Output of new object

val2 object

Old value

changeMeasureParams (type)

Change geometry type of measurement without deleting of old ones

Parameters

NameTypeDescription
type String

Geometry type of measurement ('area' for polygon, 'line' for linestring)

clearMeasurement

Clear all measurements and restart measuring

deactivateMeasuring

Stop measuring interaction in app

formatArea (polygon) -> object

Compute and format polygon area with correct units (m2/km2)

Parameters

NameTypeDescription
polygon ol.geom.Polygon

Returns

TypeDescription
object

area of polygon with used units

formatLength (line) -> object

Compute and format line length with correct units (m/km)

Parameters

NameTypeDescription
line ol.geom.LineString

Returns

TypeDescription
object

numeric length of line with used units

mouseMoveHandler (evt)

Callback for mouse move event, compute live measurement results

Parameters

NameTypeDescription
evt Object

Callback param for mouse move event

switchMultipleMode (mode)

Enable/disable multiple shape mode for measuring (switch without parameter)

Parameters

NameTypeDescription
mode Boolean

Optional parameter if multiple shape mode should be enabled