> For the complete documentation index, see [llms.txt](https://gis-hub.gitbook.io/solid-map-gl/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gis-hub.gitbook.io/solid-map-gl/components/layer3d.md).

# Layer3D

## Props

| Name         | Type                                    | Description                                                                                                      |
| ------------ | --------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| origin       | object \[x: number, y:number, z:number] | The origin of the 3D model                                                                                       |
| babylon      | boolean                                 | Flag to indicate using [BabylonJS](https://www.babylonjs.com/) otherwise [ThreeJS](https://threejs.org/) library |
| defaultLight | boolean                                 | Add default light to scene                                                                                       |
| onAdd        | function                                | Function to create the scene after layer is added                                                                |
| onRender     | function                                | Function to implement functionality on each render cycle                                                         |

*\*required*

## Example

```jsx
import { Component, createSignal } from "solid-js";
import MapGL, { Viewport, Layer3D } from "solid-map-gl";
import 'mapbox-gl/dist/mapbox-gl.css';
import { SceneLoader } from '@babylonjs/core/Loading';
import '@babylonjs/loaders';

const [viewport, setViewport] = createSignal({
  center: [148.9819, -35.3981],
  zoom: 18,
  pitch: 60,
} as Viewport);

const App: Component = () => (
  <MapGL
    options={{ style: 'mb:light', antialias: true }}
    viewport={viewport()}
    onViewportChange={(evt: Viewport) => setViewport(evt)}
  >
    <Layer3D
      babylon
      defaultLight
      origin={[148.9819, -35.39847]}
      onAdd={(scene) => {
        SceneLoader.LoadAssetContainerAsync(
          'https://docs.mapbox.com/mapbox-gl-js/assets/34M_17/',
          '34M_17.gltf',
          scene
        ).then((modelContainer: any) => modelContainer.addAllToScene());
      }}
    />
  </MapGL>
);
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gis-hub.gitbook.io/solid-map-gl/components/layer3d.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
