Message APINPM Package/docs/workflows/facility-management/overview

Facility Management Workflow

Build a floor-plan facility workflow with the Rasterex NPM package: trace spaces, capture created annotation IDs, and manage room metadata from the host UI.

Workflow Goal

Facility Management links floor-plan regions to operational metadata: room tag, department, area, floor, capacity, cleaning cadence, inspections, assets, open issues, and notes.

Use NPM APIs for the implementation: viewer.tools.set(...) activates polygon hatch drawing, viewer.annotations.on("created", ...) captures the boundary annotation, viewer.annotations.select(...) focuses saved spaces, and viewer.tools.clear() exits drawing mode.

Workflow Order

Follow this sequence so every saved room is tied to a Canvas annotation.

  • 1Mount the Viewer and open the facility floor plan with viewer.documents.open(...).
  • 2Start space mapping with viewer.tools.set({ action: "SHAPE_POLYGON", enabled: true, style }).
  • 3Wait for viewer.annotations.on("created", ...) before opening the metadata dialog.
  • 4Store the created annotation guid or uniqueId as the space annotation ID.
  • 5Save room metadata against that annotation ID.
  • 6Selecting a room calls viewer.annotations.select(...) to focus the hatch boundary.
  • 7Updating a room changes host metadata only; the Canvas hatch remains linked by annotation ID.