Rasterex APINPM Package/docs/components/annotation/modern

Modern Annotations

Enable Modern annotation appearance for the current Canvas viewer.

Enable Modern Annotations

Mount the viewer and await viewer.ready(). Check that viewer.getInfo().capabilities includes measurementAppearance before showing the appearance control.

Set the mode to modern and update the control after Canvas confirms the mode. Show the error if the request fails.

typescript
await viewer.ready();

if (viewer.getInfo().capabilities?.includes("measurementAppearance")) {
  const { mode } = await viewer.styles.setMeasurementAppearance({ mode: "modern" });
  console.log("Active appearance", mode);
}
Enable Modern Annotations

Restore Legacy Appearance

Legacy is the default for a new viewer. The selected mode applies to the current viewer across document changes. Switching appearance preserves existing annotation records and their GUIDs.

typescript
await viewer.styles.setMeasurementAppearance({ mode: "legacy" });
Restore Legacy Appearance

Compare Count Markers

Modern displays fixed-size numbered disks in the sample Count group. Legacy displays the native marker symbols, which scale with the drawing. The same Count tools and group IDs work in both modes.