Message API/docs/components/measurement/tools

Tools

Activate length, area, and specialized measurement actions.

Tool Activation

Measurement tools are activated by sending a toolControl message with the specific action ID.

Measure Length

const viewerOrigin = '*';
iframe.contentWindow.postMessage({
  type: 'toolControl',
  payload: { group: 'measurement', action: 'MEASURE_LENGTH' }
}, viewerOrigin);

Measure Area

const viewerOrigin = '*';
iframe.contentWindow.postMessage({
  type: 'toolControl',
  payload: { group: 'measurement', action: 'MEASURE_AREA' }
}, viewerOrigin);

Count

const viewerOrigin = '*';
iframe.contentWindow.postMessage({
  type: 'toolControl',
  payload: { group: 'measurement', action: 'COUNT' }
}, viewerOrigin);

Snap Utility

Snap is a non-exclusive tool that can be toggled independently of the active measurement tool.

// Toggle Snap ON
iframe.contentWindow?.postMessage({
  type: 'toolControl',
  payload: { group: 'measurement', action: 'SNAP', enabled: true }
}, viewerOrigin);
Snap Utility

Live Preview

Test measurement tools in real-time.

Interactive Workbench

Live Viewer Preview

Launch the interactive preview to explore the viewer capabilities. Use the dashboard within the modal to test different tools and configurations.

Additional Resources

Continue with related measurement workflows and API references.