---
title: "SplatModel | Geosplats sdk"
description: "Documentation for MapTiler GeoSplats SDK"
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs-qmgv.pages.dev/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# Class SplatModel

Represents a photorealistic 3D visualization (SplatModel) that can be positioned on the map.

#### Hierarchy ([View Summary](https://docs-qmgv.pages.dev/geosplats-sdk/api/hierarchy/#SplatModel))

-   [Evented](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/)<[SplatModelEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/types/SplatModelEvent/)\>
    -   SplatModel

##### Index

### Constructors[](#constructors)

[constructor](#constructor)

### Properties[](#properties)

[loaded](#loaded)

### Methods[](#methods)

[fit](#fit) [getAltitude](#getaltitude) [getCenter](#getcenter) [getModel](#getmodel) [getOptions](#getoptions) [getRotationDegrees](#getrotationdegrees) [getScale](#getscale) [hide](#hide) [off](#off) [on](#on) [once](#once) [setAltitude](#setaltitude) [setBoundingBox](#setboundingbox) [setCameraCollisions](#setcameracollisions) [setCenter](#setcenter) [setDraggable](#setdraggable) [setOpacity](#setopacity) [setRotationDegree](#setrotationdegree) [setScale](#setscale) [setTerrainBlending](#setterrainblending) [show](#show) [snapToTerrain](#snaptoterrain)

## Constructors[](#constructors-1)

### constructor[](#constructor)

-   new SplatModel(options: [SplatModelOptions](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelOptions/)): SplatModel[](#constructorsplatmodel)
    
    Creates a new SplatModel instance.
    
    #### Parameters
    
    -   options: [SplatModelOptions](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelOptions/)
        
        The options for the SplatModel.
        
    
    #### Returns SplatModel
    
    #### Example[](#example)
    
    ```typescript
    const splatModel = new SplatModel({
      model: "7d943f61-56fc-44fe-aa9e-db4afa115813",
      center: [14.418269, 50.095494]
    });
    ```
    
    Overrides [Evented](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/).[constructor](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#constructor)
    

## Properties[](#properties-1)

### `Protected`loaded[](#loaded)

loaded: boolean = false

Inherited from [Evented](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/).[loaded](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#loaded)

## Methods[](#methods-1)

### fit[](#fit)

-   fit(  
        cameraParams?: Omit<[CameraParams](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/CameraParams/), "zoom" | "position"\> | null,  
    ): [LngLat](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/LngLat/) | null[](#fit-1)
    
    Moves the camera such that the model is centered in the viewport. Sets pitch to 60 degrees while keeping current yaw.
    
    #### Parameters
    
    -   cameraParams: Omit<[CameraParams](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/CameraParams/), "zoom" | "position"\> | null = null
    
    #### Returns [LngLat](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/LngLat/) | null
    
    The center of the SplatModel as LngLat, or null if not initialized.
    

### getAltitude[](#getaltitude)

-   getAltitude(): number[](#getaltitude-1)
    
    Returns the current altitude of the model in meters.
    
    #### Returns number
    
    The altitude in meters, or NaN if not initialized.
    

### getCenter[](#getcenter)

-   getCenter(): [LngLat](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/LngLat/) | null[](#getcenter-1)
    
    Returns the current center of the model as LngLat.
    
    #### Returns [LngLat](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/LngLat/) | null
    
    The center position, or null if not available.
    

### getModel[](#getmodel)

-   getModel(): string[](#getmodel-1)
    
    Returns the model identifier (URL or UUID).
    
    #### Returns string
    
    The model string.
    

### getOptions[](#getoptions)

-   getOptions(): [SplatModelOptions](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelOptions/)[](#getoptions-1)
    
    Returns the options used to create this SplatModel.
    
    #### Returns [SplatModelOptions](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelOptions/)
    
    The SplatModel options.
    

### getRotationDegrees[](#getrotationdegrees)

-   getRotationDegrees(): [SplatModelRotationDegree](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelRotationDegree/) | null[](#getrotationdegrees-1)
    
    Returns the current rotation of the model in degrees.
    
    #### Returns [SplatModelRotationDegree](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelRotationDegree/) | null
    
    The rotation object { xRot, yRot, zRot }, or null if not initialized.
    

### getScale[](#getscale)

-   getScale(): number[](#getscale-1)
    
    Returns the model's scale.
    
    #### Returns number
    
    The scale factor, or NaN if not initialized.
    

### hide[](#hide)

-   hide(): void[](#hide-1)
    
    Hides the SplatModel, disables listeners, and sets opacity to 0.
    
    #### Returns void
    

### off[](#off)

-   off<  
        [EventType](#offeventtype) extends  
            | "load"  
            | "error"  
            | "remove"  
            | "update"  
            | "mouseover"  
            | "mouseout"  
            | "click"  
            | "dragstart"  
            | "dragend",  
    \>(  
        eventType: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#offeventtype),  
        handler: (  
            event:  
                | Extract<[SplatModelLoadEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelLoadEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#offeventtype) }\>  
                | Extract<[SplatModelErrorEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelErrorEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#offeventtype) }\>  
                | Extract<[SplatModelRemoveEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelRemoveEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#offeventtype) }\>  
                | Extract<[SplatModelUpdateEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelUpdateEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#offeventtype) }\>  
                | Extract<[SplatModelMouseOverEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelMouseOverEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#offeventtype) }\>  
                | Extract<[SplatModelMouseOutEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelMouseOutEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#offeventtype) }\>  
                | Extract<[SplatModelClickEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelClickEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#offeventtype) }\>  
                | Extract<[SplatModelDragStartEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelDragStartEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#offeventtype) }\>  
                | Extract<[SplatModelDragEndEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelDragEndEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#offeventtype) }\>,  
        ) \=> void,  
    ): void[](#off-1)
    
    Removes a listener for a specific event type.
    
    #### Type Parameters
    
    -   EventType extends  
            | "load"  
            | "error"  
            | "remove"  
            | "update"  
            | "mouseover"  
            | "mouseout"  
            | "click"  
            | "dragstart"  
            | "dragend"
    
    #### Parameters
    
    -   eventType: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#offeventtype)
        
        The type of event to remove the listener from.
        
    -   handler: (  
            event:  
                | Extract<[SplatModelLoadEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelLoadEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#offeventtype) }\>  
                | Extract<[SplatModelErrorEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelErrorEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#offeventtype) }\>  
                | Extract<[SplatModelRemoveEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelRemoveEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#offeventtype) }\>  
                | Extract<[SplatModelUpdateEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelUpdateEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#offeventtype) }\>  
                | Extract<[SplatModelMouseOverEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelMouseOverEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#offeventtype) }\>  
                | Extract<[SplatModelMouseOutEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelMouseOutEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#offeventtype) }\>  
                | Extract<[SplatModelClickEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelClickEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#offeventtype) }\>  
                | Extract<[SplatModelDragStartEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelDragStartEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#offeventtype) }\>  
                | Extract<[SplatModelDragEndEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelDragEndEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#offeventtype) }\>,  
        ) \=> void
        
        The listener function to remove.
        
    
    #### Returns void
    
    Inherited from [Evented](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/).[off](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#off)
    

### on[](#on)

-   on<  
        [EventType](#oneventtype) extends  
            | "load"  
            | "error"  
            | "remove"  
            | "update"  
            | "mouseover"  
            | "mouseout"  
            | "click"  
            | "dragstart"  
            | "dragend",  
    \>(  
        eventType: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#oneventtype),  
        handler: (  
            event:  
                | Extract<[SplatModelLoadEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelLoadEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#oneventtype) }\>  
                | Extract<[SplatModelErrorEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelErrorEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#oneventtype) }\>  
                | Extract<[SplatModelRemoveEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelRemoveEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#oneventtype) }\>  
                | Extract<[SplatModelUpdateEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelUpdateEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#oneventtype) }\>  
                | Extract<[SplatModelMouseOverEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelMouseOverEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#oneventtype) }\>  
                | Extract<[SplatModelMouseOutEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelMouseOutEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#oneventtype) }\>  
                | Extract<[SplatModelClickEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelClickEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#oneventtype) }\>  
                | Extract<[SplatModelDragStartEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelDragStartEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#oneventtype) }\>  
                | Extract<[SplatModelDragEndEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelDragEndEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#oneventtype) }\>,  
        ) \=> void,  
    ): void[](#on-1)
    
    Adds a listener for a specific event type.
    
    #### Type Parameters
    
    -   EventType extends  
            | "load"  
            | "error"  
            | "remove"  
            | "update"  
            | "mouseover"  
            | "mouseout"  
            | "click"  
            | "dragstart"  
            | "dragend"
    
    #### Parameters
    
    -   eventType: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#oneventtype)
        
        The type of event to listen for.
        
    -   handler: (  
            event:  
                | Extract<[SplatModelLoadEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelLoadEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#oneventtype) }\>  
                | Extract<[SplatModelErrorEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelErrorEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#oneventtype) }\>  
                | Extract<[SplatModelRemoveEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelRemoveEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#oneventtype) }\>  
                | Extract<[SplatModelUpdateEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelUpdateEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#oneventtype) }\>  
                | Extract<[SplatModelMouseOverEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelMouseOverEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#oneventtype) }\>  
                | Extract<[SplatModelMouseOutEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelMouseOutEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#oneventtype) }\>  
                | Extract<[SplatModelClickEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelClickEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#oneventtype) }\>  
                | Extract<[SplatModelDragStartEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelDragStartEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#oneventtype) }\>  
                | Extract<[SplatModelDragEndEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelDragEndEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#oneventtype) }\>,  
        ) \=> void
        
        The function to call when the event is fired.
        
    
    #### Returns void
    
    #### Example[](#example-1)
    
    ```typescript
    map.on('load', () => {
      console.log('Map loaded!');
    });
    ```
    
    Inherited from [Evented](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/).[on](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#on)
    

### once[](#once)

-   once<  
        [EventType](#onceeventtype) extends  
            | "load"  
            | "error"  
            | "remove"  
            | "update"  
            | "mouseover"  
            | "mouseout"  
            | "click"  
            | "dragstart"  
            | "dragend",  
    \>(  
        eventType: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#onceeventtype),  
        handler: (  
            event:  
                | Extract<[SplatModelLoadEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelLoadEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#onceeventtype) }\>  
                | Extract<[SplatModelErrorEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelErrorEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#onceeventtype) }\>  
                | Extract<[SplatModelRemoveEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelRemoveEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#onceeventtype) }\>  
                | Extract<[SplatModelUpdateEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelUpdateEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#onceeventtype) }\>  
                | Extract<[SplatModelMouseOverEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelMouseOverEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#onceeventtype) }\>  
                | Extract<[SplatModelMouseOutEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelMouseOutEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#onceeventtype) }\>  
                | Extract<[SplatModelClickEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelClickEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#onceeventtype) }\>  
                | Extract<[SplatModelDragStartEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelDragStartEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#onceeventtype) }\>  
                | Extract<[SplatModelDragEndEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelDragEndEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#onceeventtype) }\>,  
        ) \=> void,  
    ): void[](#once-1)
    
    Adds a listener for a specific event type that will be called only once.
    
    #### Type Parameters
    
    -   EventType extends  
            | "load"  
            | "error"  
            | "remove"  
            | "update"  
            | "mouseover"  
            | "mouseout"  
            | "click"  
            | "dragstart"  
            | "dragend"
    
    #### Parameters
    
    -   eventType: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#onceeventtype)
        
        The type of event to listen for.
        
    -   handler: (  
            event:  
                | Extract<[SplatModelLoadEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelLoadEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#onceeventtype) }\>  
                | Extract<[SplatModelErrorEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelErrorEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#onceeventtype) }\>  
                | Extract<[SplatModelRemoveEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelRemoveEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#onceeventtype) }\>  
                | Extract<[SplatModelUpdateEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelUpdateEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#onceeventtype) }\>  
                | Extract<[SplatModelMouseOverEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelMouseOverEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#onceeventtype) }\>  
                | Extract<[SplatModelMouseOutEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelMouseOutEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#onceeventtype) }\>  
                | Extract<[SplatModelClickEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelClickEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#onceeventtype) }\>  
                | Extract<[SplatModelDragStartEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelDragStartEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#onceeventtype) }\>  
                | Extract<[SplatModelDragEndEvent](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelDragEndEvent/), { type: [EventType](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#onceeventtype) }\>,  
        ) \=> void
        
        The function to call when the event is fired.
        
    
    #### Returns void
    
    #### Example[](#example-2)
    
    ```typescript
    map.once('splatmodel:load', () => {
      console.log('First SplatModel loaded!');
    });
    ```
    
    Inherited from [Evented](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/).[once](https://docs-qmgv.pages.dev/geosplats-sdk/api/classes/Evented/#once)
    

### setAltitude[](#setaltitude)

-   setAltitude(altitude: number): void[](#setaltitude-1)
    
    Sets the altitude of the model in meters.
    
    #### Parameters
    
    -   altitude: number
        
        The new altitude in meters.
        
    
    #### Returns void
    

### setBoundingBox[](#setboundingbox)

-   setBoundingBox(visible: boolean, color?: [Color](https://docs-qmgv.pages.dev/geosplats-sdk/api/types/Color/) | null): void[](#setboundingbox-1)
    
    Sets the visibility and color of the model's bounding box.
    
    #### Parameters
    
    -   visible: boolean
        
        Whether the bounding box should be visible.
        
    -   color: [Color](https://docs-qmgv.pages.dev/geosplats-sdk/api/types/Color/) | null = null
        
        The color of the bounding box. Can be a string ("red", "#ff0000"), RGB(A) array, or object.
        
    
    #### Returns void
    
    #### Example[](#example-3)
    
    ```typescript
    splatModel.setBoundingBox(true, "yellow");
    splatModel.setBoundingBox(true, [255, 204, 0, 0.4]);
    ```
    

### setCameraCollisions[](#setcameracollisions)

-   setCameraCollisions(enabled: boolean): void[](#setcameracollisions-1)
    
    Sets whether the camera movement is restricted by model.
    
    #### Parameters
    
    -   enabled: boolean
        
        Whether the camera movement is restricted by model, false by default.
        
    
    #### Returns void
    

### setCenter[](#setcenter)

-   setCenter(center: [LngLatLike](https://docs-qmgv.pages.dev/geosplats-sdk/api/types/LngLatLike/)): void[](#setcenter-1)
    
    Sets the center of the model.
    
    #### Parameters
    
    -   center: [LngLatLike](https://docs-qmgv.pages.dev/geosplats-sdk/api/types/LngLatLike/)
        
        The new center position.
        
    
    #### Returns void
    

### setDraggable[](#setdraggable)

-   setDraggable(draggable: boolean): void[](#setdraggable-1)
    
    Sets whether the model is draggable.
    
    #### Parameters
    
    -   draggable: boolean
        
        Whether the model should be draggable.
        
    
    #### Returns void
    

### setOpacity[](#setopacity)

-   setOpacity(opacity: number): void[](#setopacity-1)
    
    Sets the opacity of the model.
    
    #### Parameters
    
    -   opacity: number
        
        The new opacity value (clamped between 0 and 1).
        
    
    #### Returns void
    

### setRotationDegree[](#setrotationdegree)

-   setRotationDegree(splatModelRotationDegree: [SplatModelRotationDegree](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelRotationDegree/)): void[](#setrotationdegree-1)
    
    Sets the rotation of the model in degrees.
    
    #### Parameters
    
    -   splatModelRotationDegree: [SplatModelRotationDegree](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/SplatModelRotationDegree/)
        
        The new rotation object { xRot, yRot, zRot }.
        
    
    #### Returns void
    

### setScale[](#setscale)

-   setScale(scale: number): void[](#setscale-1)
    
    Sets the scale of the model.
    
    #### Parameters
    
    -   scale: number
        
        The new scale factor.
        
    
    #### Returns void
    

### setTerrainBlending[](#setterrainblending)

-   setTerrainBlending(  
        enabled: boolean,  
        params?: [TerrainBlendingParams](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/TerrainBlendingParams/) | null,  
    ): void[](#setterrainblending-1)
    
    Sets whether terrain blending is enabled.
    
    #### Parameters
    
    -   enabled: boolean
        
        Whether the terrain blending is enabled.
        
    -   params: [TerrainBlendingParams](https://docs-qmgv.pages.dev/geosplats-sdk/api/interfaces/TerrainBlendingParams/) | null = null
        
        Terrain blending params.
        
    
    #### Returns void
    

### show[](#show)

-   show(): void[](#show-1)
    
    Shows the SplatModel and re-enables listeners.
    
    #### Returns void
    

### snapToTerrain[](#snaptoterrain)

-   snapToTerrain(callback: (elevation: number) \=> void): number[](#snaptoterrain-1)
    
    Snaps the model to the terrain and returns the new altitude.
    
    #### Parameters
    
    -   callback: (elevation: number) \=> void
        
        Function called with the snapped elevation.
        
    
    #### Returns number
