A widget for making ephemeral measurements.
| Name | Type | Description | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
An object with the following properties:
|
Members
Gets and sets whether the measurement toolbar is expanded.
-
Default Value:
false
Gets and sets whether the instructions are visible.
-
Default Value:
false
readonly measurements : Array.<Measurement>
packages/ion-sdk-measurements/Source/Measure/MeasureViewModel.js 216
Gets the array of available measurement types.
readonly scene : Scene
packages/ion-sdk-measurements/Source/Measure/MeasureViewModel.js 205
Gets the scene.
selectedMeasurement : Measurement
packages/ion-sdk-measurements/Source/Measure/MeasureViewModel.js 153
Gets or sets the currently selected measurement. This property is observable.
-
Default Value:
undefined
readonly snapping : MeasurementSnapping
packages/ion-sdk-measurements/Source/Measure/MeasureViewModel.js 227
Gets the snapping settings shared by every tool. Changes apply immediately.
units : MeasureUnits
packages/ion-sdk-measurements/Source/Measure/MeasureViewModel.js 237
Gets the selected unit of measurement.
Methods
Destroys the widget view model.
Returns:
true if the object has been destroyed, false otherwise.
onMeasurementStateChange(callback) → function
packages/ion-sdk-measurements/Source/Measure/MeasureViewModel.js 318
Registers a callback that is invoked whenever the measurement state changes,
so an external UI can stay in sync. The callback receives no arguments and
fires on: a measurement's
handleClick, handleDoubleClick,
and handleKeyDown (if defined), the
MultipleDistanceMeasurement measurementCompleted and
measurementsCleared events, and MeasureViewModel#reset.
| Name | Type | Description |
|---|---|---|
callback |
function | The function to call when the measurement state changes. |
Returns:
A function that removes the registered callback. Call it to
unsubscribe when the listener is no longer needed to avoid stale callbacks
and memory leaks.
Resets the widget.
Toggles the state of the toolbar.
Toggles the visibility of the instructions panel.
