Constructor
new Measure(store, target, toggleTools)
Create a measure control
Parameters:
| Name | Type | Description |
|---|---|---|
store |
object | NSPIT store |
target |
HTMLElement | DOM element for measure control |
toggleTools |
object | Activate - deactivate other tools |
Methods
activateTool(active, type)
Activate measure tool
Parameters:
| Name | Type | Description |
|---|---|---|
active |
boolean | Whether measure tool is active |
type |
string | Geometry type for measuring |
convertMeasurementResults()
Convert measure result to units
copyResultToClipboard()
Copy measure result to clipboard
eraseMeasurementResults()
Erase measure results
fillUnits(units)
Add units to measure menu
Parameters:
| Name | Type | Description |
|---|---|---|
units |
string | Measure units |
formatArea(polygon)
Format polygon area in selected units
Parameters:
| Name | Type | Description |
|---|---|---|
polygon |
object | Polygon geometry |
formatCoordinates(coordinates)
Format point coordinates in selected units
Parameters:
| Name | Type | Description |
|---|---|---|
coordinates |
array | Coordinates of point |
formatLength(line)
Format line length in selected units
Parameters:
| Name | Type | Description |
|---|---|---|
line |
object | Line geometry |