SDK JS
    Preparing search index...

    Interface MultiModelInstancesLayerOptions

    Options for MultiModelInstancesLayer. id, a non-empty models library and a non-empty instances list are required; everything else defaults. The pairing that matters is models + each instance's modelIndex: the index selects which library entry is drawn at that point, and an absent or out-of-range index falls back to model 0.

    interface MultiModelInstancesLayerOptions {
        auth?: RequestAuthorizer;
        id: string;
        instances: readonly MultiModelInstance[];
        models: readonly (string | ArrayBuffer | NormalizedMesh)[];
        onError?: (error: unknown) => void;
        onLoaded?: () => void;
        opacity?: number;
        requestInit?: RequestInit;
        seams?: GeometrySeams;
        visible?: boolean;
    }
    Index

    Properties

    auth?: RequestAuthorizer

    Request authorizer for fetching models URLs from a secured host.

    id: string

    MapLibre layer id (must be unique within the map).

    instances: readonly MultiModelInstance[]

    Where to place the models — each a MultiModelInstance (position, modelIndex, and an optional per-instance scale + heading).

    models: readonly (string | ArrayBuffer | NormalizedMesh)[]

    The model library: each a glTF/GLB URL, raw GLB bytes, or a pre-built NormalizedMesh. Each instance's modelIndex selects one of these.

    onError?: (error: unknown) => void

    Fired if a model fails to load (bad URL, non-OK HTTP, empty models/instances).

    onLoaded?: () => void

    Fired once all models are resolved + uploaded and the instances are rendering.

    opacity?: number

    Initial opacity 0–1 (default 1).

    requestInit?: RequestInit

    Static auth/headers escape hatch for models URL fetches. Superseded by auth when both are set.

    seams?: GeometrySeams

    Geometry codec seams (Draco/meshopt) if a model GLB is compressed.

    visible?: boolean

    Initial visibility (default true).