An abstract class defining a measurement.
| Name | Type | Description | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
An object with the following properties:
|
Members
Gets the icon.
Gets the id.
readonly instructions : Array.<String>
packages/ion-sdk-measurements/Source/Measure/Measurement.js 75
Gets the instruction text.
readonly mode : DrawingMode
packages/ion-sdk-measurements/Source/Measure/Measurement.js 110
Gets the current drawing mode.
selectedUnits : MeasureUnits
packages/ion-sdk-measurements/Source/Measure/Measurement.js 93
Gets and sets the selected units of measurement.
Gets the thumbnail.
Gets the type.
Methods
Destroys the widget.
Handles click events while performing a measurement.
| Name | Type | Description |
|---|---|---|
clickPosition |
Cartesian2 | The click position |
Handles double click events while performing a measurement.
Handles key down events by invoking the handler registered for the pressed
key via
Measurement#setKeyHandler.
| Name | Type | Description |
|---|---|---|
key |
String | The KeyboardEvent.key value of the pressed key |
Handles left down mouse events while performing a measurement.
| Name | Type | Description |
|---|---|---|
mousePosition |
Cartesian2 | The mouse position |
Handles left up mouse events while performing a measurement.
| Name | Type | Description |
|---|---|---|
mousePosition |
Cartesian2 | The mouse position |
handleMouseMove(mousePosition, shift)
packages/ion-sdk-measurements/Source/Measure/Measurement.js 139
Handles mouse move events while performing a measurement.
| Name | Type | Description |
|---|---|---|
mousePosition |
Cartesian2 | The mouse position |
shift |
boolean | optional True if the shift key was pressed |
Checks if a key handler is set for the specified key.
| Name | Type | Description |
|---|---|---|
key |
String | The keyboard key to check |
Returns:
true if a handler is set for the key, false otherwise.
Returns:
true if the object has been destroyed, false otherwise.
Removes all registered key handlers.
Removes the key handler for the specified key. The key is a KeyboardEvent.key
value (e.g. "Escape", "Delete", "z") and is case-sensitive.
| Name | Type | Description |
|---|---|---|
key |
String | The keyboard key to remove the handler for |
Resets the widget.
Sets a key handler for the specified key. The key must be a non-empty string
matching a KeyboardEvent.key value
(e.g. "Escape", "Delete", "z"). The value is case-sensitive.
| Name | Type | Description |
|---|---|---|
key |
String | The keyboard key (e.g., "Escape", "Delete") |
handler |
function | The function invoked when the key is pressed |
Throws:
-
DeveloperError : key must be a non-empty string and a valid KeyboardEvent.key value.
-
DeveloperError : handler must be a callback function.
