This is documentation of an archived release.
For documentation on the current version, please check Knowledge Base.

Storing Measurements

The SDK allows access to measurements.

Capturing a Completed Measurement

The first step to capturing a completed measurement, is capturing changes to the measurement state.

To be notified of any changes to the measurement change, you can attach a listener to the onMeasureStateChanged signal. In this event handler, you can use the getMeasureState() function to retrieve the current measurement state. This function returns a MeasureState instance.

Tracking measurement changes is done using the onMeasurementChange Signal. Add an event listener to be notified whenever something changes to the measurement state.

The Viewer SDK offers several Measurement related Signals that you can listen to.

  • onMeasureUpdated : dispatched when the user updates a Measurement.
  • onMeasureCompleted : dispatched when the user completes a Measurement.

The user starts making a Measurement by clicking one of the measurement buttons in the Measurement Sidebar. This action brings the viewer in Measurement mode. Any View can be used to make registrations.

As the user makes registrations, the onMeasureUpdated signal is dispatched.

On completion, the onMeasureCompleted signal is dispatched. The user completes the Measurement by making the last registration (for a Measurement mode with a fixed number of registrations) or by making a registration using a double click.

Each measurement mode has its own focus or goal.

Using MeasureState

The onMeasureUpdate and onMeasureComplete Signals have a payload object of type MeasureState that describes the current measurement state :

  • The list of registrations
  • The measurement mode
  • The measurement information properties.

Rendering

To render a MeasureState object on the map, you must implement a dedicated rendering method for each measurement mode. In a future update we are committed to provide an SDK function to retrieve MapObject instances that can be used to render the measurement on a Reference Map. You as an SDK developer won't need to support every measurement mode we may decide to add in a future update.

 
Last modified:: 2022/07/29 07:53