Georeferencing API
    Preparing search index...

    Interface ControllerOptions

    Host services and initial state for one editor. The controller does not own the map or persist data itself.

    interface ControllerOptions {
        digitizing?: boolean;
        drawingBounds?: Extent;
        engine: Engine;
        exports?: readonly ExportFormat[];
        guard?: (context: GuardContext) => Promise<"save" | "discard" | "cancel">;
        initialDocument?: Document;
        onActiveToolChange?: (tool: Tool) => void;
        onChange?: (document: Document) => void;
        onError?: (
            error: {
                code: string;
                message: string;
                operationId?: string;
                recoverable: boolean;
            },
        ) => void;
        onSave?: (snapshot: Readonly<SaveEnvelope>) => Promise<void>;
        onSaveDraft?: (
            snapshot: Readonly<{ document: Document; requestId: string }>,
        ) => Promise<void>;
        previewMode?: PreviewMode;
        workingCrs: string;
    }
    Index
    digitizing?: boolean

    Enable drawing after explicit alignment confirmation.

    false

    drawingBounds?: Extent

    Optional longitude/latitude extent enforced when saving accepted features; separate from WFS and raster bounds.

    engine: Engine

    Host-supplied engine. Controller disposal cancels its jobs but does not dispose a potentially shared engine.

    exports?: readonly ExportFormat[]

    Explicit opt-in export formats. No file exporters are enabled by default.

    guard?: (context: GuardContext) => Promise<"save" | "discard" | "cancel">

    Resolve Save/Discard/Cancel before a destructive image transition. Missing guards default to cancel when work is dirty.

    initialDocument?: Document

    Validated and cloned session metadata. Use restoreSession to load matching image bytes before alignment operations.

    onActiveToolChange?: (tool: Tool) => void

    Observe tool changes to coordinate host-owned interactions with the editor.

    onChange?: (document: Document) => void

    Receives each committed frozen document for host draft synchronization. This is not a save acknowledgement.

    onError?: (
        error: {
            code: string;
            message: string;
            operationId?: string;
            recoverable: boolean;
        },
    ) => void

    Structured error notification. Aborts are cancellation and are not reported as errors.

    onSave?: (snapshot: Readonly<SaveEnvelope>) => Promise<void>

    Persist an immutable accepted-feature snapshot. Resolve after success; reject to preserve a retryable unsaved draft.

    onSaveDraft?: (
        snapshot: Readonly<{ document: Document; requestId: string }>,
    ) => Promise<void>

    Persist unfinished work independently of accepted-feature eligibility. Image bytes are not included; the host arranges asset persistence.

    previewMode?: PreviewMode

    Initial preview policy. Manual waits for refit; automatic updates after eligible edits.

    "automatic"

    workingCrs: string

    Explicit initial working CRS; initialDocument supplies its own CRS when provided.