MultipleDistanceMeasurement

new IonSdkMeasurements.MultipleDistanceMeasurement(options)

Manages multiple distance measurements, allowing users to create and maintain multiple distance measurements simultaneously.
Name Type Description
options Object An object with the following properties:
Name Type Default Description
scene Scene The scene
units MeasureUnits The selected units of measurement
locale String optional The BCP 47 language tag string customizing language-sensitive number formatting. If undefined, the runtime's default locale is used. See the Intl page on MDN
points PointPrimitiveCollection A collection for adding the point primitives
labels LabelCollection A collection for adding the labels
primitives PrimitiveCollection A collection for adding primitives
showComponentLines Boolean false optional Whether or not to show the x and y component lines

Members

readonly activeMeasurement : DistanceMeasurement

Gets the currently active (being drawn) measurement.

readonly count : Number

Gets the number of completed measurements.

readonly icon : String

Gets the icon for the measurement manager.

readonly id : String

Gets the id for the measurement manager.

readonly instructions : Array.<String>

Gets the instruction text for the measurement manager.

measurementCompleted : Event

An event that is fired when a measurement is completed.

readonly measurements : Array.<DistanceMeasurement>

Gets the array of all distance measurements.

measurementsCleared : Event

An event that is fired when all measurements are cleared.

measurementStarted : Event

An event that is fired when a measurement is started.

selectedUnits : MeasureUnits

Gets and sets the selected units of measurement.

readonly thumbnail : String

Gets the thumbnail for the measurement manager.

readonly type : String

Gets the type for the measurement manager.

Methods

clearAllAndDeactivate()

Clears all measurements and deactivates the manager without restarting. This is useful when completely clearing measurements via UI.

clearAllMeasurements()

Removes all completed measurements.

destroy()

Destroys the measurement manager and all its measurements.

handleClick(clickPosition)

Handles click events for the measurement manager.
Name Type Description
clickPosition Cartesian2 The click position

handleDoubleClick(clickPosition)

Handles double click events for the measurement manager.
Name Type Description
clickPosition Cartesian2 The click position

handleLeftDown(mousePosition)

Handles left down mouse events for the measurement manager.
Name Type Description
mousePosition Cartesian2 The mouse position

handleLeftUp(mousePosition)

Handles left up mouse events for the measurement manager.
Name Type Description
mousePosition Cartesian2 The mouse position

handleMouseMove(mousePosition)

Handles mouse move events for the measurement manager.
Name Type Description
mousePosition Cartesian2 The mouse position

isDestroyed()Boolean

Returns:
true if the object has been destroyed, false otherwise.

removeMeasurement(measurement)

Removes a specific measurement from the collection.
Name Type Description
measurement DistanceMeasurement The measurement to remove

reset()

Resets the measurement manager, clearing the active measurement but keeping completed ones.

setupEnhancedEscapeKeyHandler(deactivationCallback)

Sets up an escape key handler for the completed and in-progress distance measurements. Priority behavior: 1. If a distance measurement is being drawn, cancel it 2. If completed distance measurements exist, remove the most recent one 3. If none remain, call the deactivation callback
Name Type Description
deactivationCallback function optional Optional callback when no distance measurements remain

stopCurrentMeasurement()

Stops the current active measurement without completing it.
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.