SDK JS
    Preparing search index...

    Interface ModelInstancesLayerOptions

    Options for ModelInstancesLayer. id, model and a non-empty instances are required; everything else defaults. model is the single shared geometry drawn once per instance, and ModelInstancesLayerOptions.datum decides what each instance's position[2] means — the default 'basemap' re-seats every instance on the terrain under it as the DEM streams in.

    interface ModelInstancesLayerOptions {
        auth?: RequestAuthorizer;
        datum?: VerticalDatum;
        id: string;
        instances: readonly GeodeticInstance[];
        model: 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 a model URL from a secured host.

    How each instance's position[2] is referenced. Default 'basemap'.

    • 'basemap' — height counts from the MAP SURFACE: 0 sits on the ground, on the flat map and on 3D terrain alike. The layer samples the terrain PER INSTANCE and re-seats as the DEM streams in, so a spread of models follows a slope instead of hanging off one elevation.
    • 'ellipsoid' — absolute WGS84 ellipsoidal height, terrain-independent.
    • 'orthometric' — absolute MSL height; the layer adds the geoid undulation N so it lands on ellipsoidal ground (needs a loaded EGM96 grid, else equivalent to 'ellipsoid').

    Matches the 3D-Tiles / I3S layers' datum contract (see Tiles3DMeshLayerOptions.datum) rather than inventing a fourth convention.

    id: string

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

    instances: readonly GeodeticInstance[]

    Where to place the model — each with position ([lng, lat, height], degrees/metres) and an optional per-instance scale + heading.

    model: string | ArrayBuffer | NormalizedMesh

    The shared model: a glTF/GLB URL (fetched), raw GLB bytes, or a pre-built NormalizedMesh (e.g. a generated primitive). Drawn once per instance.

    onError?: (error: unknown) => void

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

    onLoaded?: () => void

    Fired once the model has been resolved + uploaded and the instances are rendering.

    opacity?: number

    Initial opacity 0–1 (default 1).

    requestInit?: RequestInit

    Static auth/headers escape hatch for the model URL fetch. Superseded by auth when both are set.

    seams?: GeometrySeams

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

    visible?: boolean

    Initial visibility (default true).