@mapcomponents/three 1.7.2 → 1.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/README.md +54 -0
- package/dist/assets/3D/godzilla_simple.glb +0 -0
- package/dist/assets/splats/output.splat +0 -0
- package/dist/components/MlThreeGizmo.d.ts +12 -0
- package/dist/components/MlThreeGizmo.d.ts.map +1 -0
- package/dist/components/MlThreeModelLayer/MlThreeModelLayer.cy.d.ts +2 -0
- package/dist/components/MlThreeModelLayer/MlThreeModelLayer.cy.d.ts.map +1 -0
- package/dist/components/MlThreeModelLayer/MlThreeModelLayer.d.ts +12 -0
- package/dist/components/MlThreeModelLayer/MlThreeModelLayer.d.ts.map +1 -0
- package/dist/components/MlThreeObjectControls.d.ts +41 -0
- package/dist/components/MlThreeObjectControls.d.ts.map +1 -0
- package/dist/components/MlThreeSplatLayer/MlThreeSplatLayer.cy.d.ts +2 -0
- package/dist/components/MlThreeSplatLayer/MlThreeSplatLayer.cy.d.ts.map +1 -0
- package/dist/components/MlThreeSplatLayer/MlThreeSplatLayer.d.ts +12 -0
- package/dist/components/MlThreeSplatLayer/MlThreeSplatLayer.d.ts.map +1 -0
- package/dist/contexts/ThreeContext.d.ts +15 -0
- package/dist/contexts/ThreeContext.d.ts.map +1 -0
- package/dist/contexts/ThreeProvider.d.ts +18 -0
- package/dist/contexts/ThreeProvider.d.ts.map +1 -0
- package/dist/cypress/support/commands.d.ts +1 -0
- package/dist/cypress/support/commands.d.ts.map +1 -0
- package/dist/cypress/support/component.d.ts +9 -0
- package/dist/cypress/support/component.d.ts.map +1 -0
- package/dist/decorators/ThreejsContextDecorator.d.ts +3 -0
- package/dist/decorators/ThreejsContextDecorator.d.ts.map +1 -0
- package/dist/hooks/useThreeModel.d.ts +34 -0
- package/dist/hooks/useThreeModel.d.ts.map +1 -0
- package/dist/html2canvas.esm-CUkZERmf.js +22 -0
- package/dist/html2canvas.esm-Dmi1NfiH.mjs +4871 -0
- package/dist/index-CnnmRv4J.mjs +90875 -0
- package/dist/index-DbqgNSpy.js +5442 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.es-BPSzkkDP.mjs +6674 -0
- package/dist/index.es-ajYPKLNS.js +18 -0
- package/dist/index.js +1 -0
- package/dist/index.mjs +10 -0
- package/dist/lib/ThreejsSceneHelper.d.ts +16 -0
- package/dist/lib/ThreejsSceneHelper.d.ts.map +1 -0
- package/dist/lib/ThreejsSceneRenderer.d.ts +18 -0
- package/dist/lib/ThreejsSceneRenderer.d.ts.map +1 -0
- package/dist/lib/ThreejsUtils.d.ts +14 -0
- package/dist/lib/ThreejsUtils.d.ts.map +1 -0
- package/dist/lib/splats/GaussianSplattingMesh.d.ts +104 -0
- package/dist/lib/splats/GaussianSplattingMesh.d.ts.map +1 -0
- package/dist/lib/splats/GaussianSplattingShaders.d.ts +10 -0
- package/dist/lib/splats/GaussianSplattingShaders.d.ts.map +1 -0
- package/dist/lib/splats/loaders/PlySplatLoader.d.ts +81 -0
- package/dist/lib/splats/loaders/PlySplatLoader.d.ts.map +1 -0
- package/dist/lib/splats/loaders/SplatLoader.d.ts +10 -0
- package/dist/lib/splats/loaders/SplatLoader.d.ts.map +1 -0
- package/dist/lib/utils/coroutine.d.ts +17 -0
- package/dist/lib/utils/coroutine.d.ts.map +1 -0
- package/dist/package.json +26 -0
- package/dist/purify.es-D1I7B1hP.js +2 -0
- package/dist/purify.es-DHbHSKL1.mjs +528 -0
- package/package.json +8 -6
- package/src/components/{MlTransformControls.tsx → MlThreeGizmo.tsx} +4 -4
- package/src/components/MlThreeModelLayer/MlThreeModelLayer.cy.tsx +2 -3
- package/src/components/MlThreeModelLayer/MlThreeModelLayer.stories.tsx +14 -55
- package/src/components/MlThreeModelLayer/MlThreeModelLayer.tsx +30 -133
- package/src/components/MlThreeObjectControls.tsx +289 -0
- package/src/components/MlThreeSplatLayer/MlThreeSplatLayer.cy.tsx +2 -3
- package/src/components/MlThreeSplatLayer/MlThreeSplatLayer.stories.tsx +14 -58
- package/src/components/MlThreeSplatLayer/MlThreeSplatLayer.tsx +26 -138
- package/src/decorators/ThreejsContextDecorator.tsx +1 -1
- package/src/hooks/useThreeModel.tsx +179 -0
- package/src/index.ts +4 -2
- package/vite.config.ts +2 -2
- package/src/components/ThreeObjectControls.tsx +0 -197
- /package/src/{components → contexts}/ThreeContext.tsx +0 -0
- /package/src/{components → contexts}/ThreeProvider.tsx +0 -0
package/dist/README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# @mapcomponents/three
|
|
2
|
+
|
|
3
|
+
This library provides React components to easily integrate [Three.js](https://threejs.org/) 3D content into [MapLibre GL JS](https://maplibre.org/) maps using [@mapcomponents/react-maplibre](https://github.com/mapcomponents/react-map-components-maplibre).
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Install the package and its peer dependencies:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @mapcomponents/three @mapcomponents/react-maplibre
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Getting Started
|
|
14
|
+
|
|
15
|
+
To use `@mapcomponents/three`, you need to wrap your 3D layers with the `ThreeProvider` component. This provider initializes the Three.js scene, camera, and renderer, and registers a custom layer within the MapLibre map.
|
|
16
|
+
|
|
17
|
+
### Basic Usage
|
|
18
|
+
|
|
19
|
+
Here is a simple example of how to render a 3D model on a map:
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
import React from 'react';
|
|
23
|
+
import { MapComponentsProvider, MapLibreMap } from '@mapcomponents/react-maplibre';
|
|
24
|
+
import { ThreeProvider, MlThreeModelLayer } from '@mapcomponents/three';
|
|
25
|
+
|
|
26
|
+
const App = () => {
|
|
27
|
+
return (
|
|
28
|
+
<MapComponentsProvider>
|
|
29
|
+
<ThreeProvider id="three-scene-1">
|
|
30
|
+
<MapLibreMap
|
|
31
|
+
options={{
|
|
32
|
+
style: 'https://demotiles.maplibre.org/style.json',
|
|
33
|
+
center: [13.404954, 52.520008],
|
|
34
|
+
zoom: 15,
|
|
35
|
+
pitch: 60
|
|
36
|
+
}}
|
|
37
|
+
/>
|
|
38
|
+
|
|
39
|
+
<MlThreeModelLayer
|
|
40
|
+
url="https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/Duck/glTF-Binary/Duck.glb"
|
|
41
|
+
mapPosition={[13.404954, 52.520008]}
|
|
42
|
+
scale={10}
|
|
43
|
+
/>
|
|
44
|
+
</ThreeProvider>
|
|
45
|
+
</MapComponentsProvider>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export default App;
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Running unit tests
|
|
53
|
+
|
|
54
|
+
Run `nx test @mapcomponents/three` to execute the unit tests via [Vitest](https://vitest.dev/).
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
export interface MlThreeGizmoProps {
|
|
3
|
+
target?: THREE.Object3D;
|
|
4
|
+
mode?: 'translate' | 'rotate' | 'scale';
|
|
5
|
+
enabled?: boolean;
|
|
6
|
+
space?: 'world' | 'local';
|
|
7
|
+
size?: number;
|
|
8
|
+
onObjectChange?: (object: THREE.Object3D) => void;
|
|
9
|
+
}
|
|
10
|
+
declare const MlThreeGizmo: (props: MlThreeGizmoProps) => null;
|
|
11
|
+
export default MlThreeGizmo;
|
|
12
|
+
//# sourceMappingURL=MlThreeGizmo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MlThreeGizmo.d.ts","sourceRoot":"","sources":["../../src/components/MlThreeGizmo.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,WAAW,iBAAiB;IACjC,MAAM,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC;IACxB,IAAI,CAAC,EAAE,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;IACxC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,KAAK,IAAI,CAAC;CAClD;AAED,QAAA,MAAM,YAAY,GAAI,OAAO,iBAAiB,SA+F7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MlThreeModelLayer.cy.d.ts","sourceRoot":"","sources":["../../../src/components/MlThreeModelLayer/MlThreeModelLayer.cy.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { UseThreeModelProps } from '../../hooks/useThreeModel';
|
|
2
|
+
/**
|
|
3
|
+
* Renders obj or gltf 3D Models on the MapLibreMap
|
|
4
|
+
*
|
|
5
|
+
* @component
|
|
6
|
+
*/
|
|
7
|
+
export type MlThreeModelLayerProps = Omit<UseThreeModelProps, 'loaders'> & {
|
|
8
|
+
mapId?: string;
|
|
9
|
+
};
|
|
10
|
+
declare const MlThreeModelLayer: (props: MlThreeModelLayerProps) => null;
|
|
11
|
+
export default MlThreeModelLayer;
|
|
12
|
+
//# sourceMappingURL=MlThreeModelLayer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MlThreeModelLayer.d.ts","sourceRoot":"","sources":["../../../src/components/MlThreeModelLayer/MlThreeModelLayer.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAiB,kBAAkB,EAAe,MAAM,2BAA2B,CAAC;AAE3F;;;;GAIG;AAEH,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,kBAAkB,EAAE,SAAS,CAAC,GAAG;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,QAAA,MAAM,iBAAiB,GAAI,OAAO,sBAAsB,SAgCvD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface ThreeObjectControlsProps {
|
|
2
|
+
showLayer: boolean;
|
|
3
|
+
setShowLayer: (show: boolean) => void;
|
|
4
|
+
scale: number;
|
|
5
|
+
setScale: (scale: number) => void;
|
|
6
|
+
rotation: {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
z: number;
|
|
10
|
+
};
|
|
11
|
+
setRotation: (rotation: {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
z: number;
|
|
15
|
+
}) => void;
|
|
16
|
+
mapPosition: {
|
|
17
|
+
lng: number;
|
|
18
|
+
lat: number;
|
|
19
|
+
};
|
|
20
|
+
setMapPosition: (position: {
|
|
21
|
+
lng: number;
|
|
22
|
+
lat: number;
|
|
23
|
+
}) => void;
|
|
24
|
+
position: {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
z: number;
|
|
28
|
+
};
|
|
29
|
+
setPosition: (position: {
|
|
30
|
+
x: number;
|
|
31
|
+
y: number;
|
|
32
|
+
z: number;
|
|
33
|
+
}) => void;
|
|
34
|
+
enableTransformControls?: boolean;
|
|
35
|
+
setEnableTransformControls?: (enable: boolean) => void;
|
|
36
|
+
transformMode?: 'translate' | 'rotate' | 'scale';
|
|
37
|
+
setTransformMode?: (mode: 'translate' | 'rotate' | 'scale') => void;
|
|
38
|
+
layerName?: string;
|
|
39
|
+
}
|
|
40
|
+
export declare const MlThreeObjectControls: ({ showLayer, setShowLayer, scale, setScale, rotation, setRotation, mapPosition, setMapPosition, position, setPosition, enableTransformControls, setEnableTransformControls, transformMode, setTransformMode, layerName, }: ThreeObjectControlsProps) => import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
//# sourceMappingURL=MlThreeObjectControls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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ACjD,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,GAAG,QAAQ,GAAG,OAAO,KAAK,IAAI,CAAC;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,qBAAqB,GAAI,2NAgBnC,wBAAwB,4CAkP1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MlThreeSplatLayer.cy.d.ts","sourceRoot":"","sources":["../../../src/components/MlThreeSplatLayer/MlThreeSplatLayer.cy.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { UseThreeModelProps } from '../../hooks/useThreeModel';
|
|
2
|
+
/**
|
|
3
|
+
* Renders splat 3D Models on the MapLibreMap
|
|
4
|
+
*
|
|
5
|
+
* @component
|
|
6
|
+
*/
|
|
7
|
+
export type MlThreeSplatLayerProps = Omit<UseThreeModelProps, 'loaders'> & {
|
|
8
|
+
mapId?: string;
|
|
9
|
+
};
|
|
10
|
+
declare const MlThreeSplatLayer: (props: MlThreeSplatLayerProps) => null;
|
|
11
|
+
export default MlThreeSplatLayer;
|
|
12
|
+
//# sourceMappingURL=MlThreeSplatLayer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MlThreeSplatLayer.d.ts","sourceRoot":"","sources":["../../../src/components/MlThreeSplatLayer/MlThreeSplatLayer.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAiB,kBAAkB,EAAe,MAAM,2BAA2B,CAAC;AAE3F;;;;GAIG;AAEH,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,kBAAkB,EAAE,SAAS,CAAC,GAAG;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,QAAA,MAAM,iBAAiB,GAAI,OAAO,sBAAsB,SA4BvD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Scene, PerspectiveCamera, Group, Matrix4 } from 'three';
|
|
2
|
+
import { Map as MapboxMap } from 'maplibre-gl';
|
|
3
|
+
import { default as ThreejsSceneRenderer } from '../lib/ThreejsSceneRenderer';
|
|
4
|
+
export interface ThreeContextType {
|
|
5
|
+
scene: Scene | undefined;
|
|
6
|
+
camera: PerspectiveCamera | undefined;
|
|
7
|
+
renderer: ThreejsSceneRenderer | undefined;
|
|
8
|
+
map: MapboxMap | undefined;
|
|
9
|
+
sceneRoot: Group | undefined;
|
|
10
|
+
worldMatrix: Matrix4 | undefined;
|
|
11
|
+
worldMatrixInv: Matrix4 | undefined;
|
|
12
|
+
}
|
|
13
|
+
export declare const ThreeContext: import('react').Context<ThreeContextType>;
|
|
14
|
+
export declare const useThree: () => ThreeContextType;
|
|
15
|
+
//# sourceMappingURL=ThreeContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThreeContext.d.ts","sourceRoot":"","sources":["../../src/contexts/ThreeContext.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,GAAG,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,oBAAoB,MAAM,6BAA6B,CAAC;AAE/D,MAAM,WAAW,gBAAgB;IAChC,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;IACzB,MAAM,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACtC,QAAQ,EAAE,oBAAoB,GAAG,SAAS,CAAC;IAC3C,GAAG,EAAE,SAAS,GAAG,SAAS,CAAC;IAC3B,SAAS,EAAE,KAAK,GAAG,SAAS,CAAC;IAC7B,WAAW,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC,cAAc,EAAE,OAAO,GAAG,SAAS,CAAC;CACpC;AAED,eAAO,MAAM,YAAY,2CAQvB,CAAC;AAEH,eAAO,MAAM,QAAQ,wBAAiC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { LngLatLike } from 'maplibre-gl';
|
|
3
|
+
export interface ThreeProviderProps {
|
|
4
|
+
mapId?: string;
|
|
5
|
+
id: string;
|
|
6
|
+
refCenter?: LngLatLike;
|
|
7
|
+
envTexture?: string;
|
|
8
|
+
envIntensity?: number;
|
|
9
|
+
createLight?: boolean;
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Id of an existing layer in the MapLibre instance to help specify the layer order.
|
|
13
|
+
* The Three.js layer will be rendered visually beneath the layer with the specified id.
|
|
14
|
+
*/
|
|
15
|
+
beforeId?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const ThreeProvider: React.FC<ThreeProviderProps>;
|
|
18
|
+
//# sourceMappingURL=ThreeProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThreeProvider.d.ts","sourceRoot":"","sources":["../../src/contexts/ThreeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAG3D,OAAO,EAAE,UAAU,EAAwB,MAAM,aAAa,CAAC;AAM/D,MAAM,WAAW,kBAAkB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA4HtD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/cypress/support/commands.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/cypress/support/component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,YAAY,CAAC;AAEpB,OAAO,CAAC,MAAM,CAAC;IAEd,UAAU,OAAO,CAAC;QACjB,UAAU,SAAS;YAClB,KAAK,EAAE,OAAO,KAAK,CAAC;SACpB;KACD;CACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThreejsContextDecorator.d.ts","sourceRoot":"","sources":["../../src/decorators/ThreejsContextDecorator.tsx"],"names":[],"mappings":"AASA,OAAO,aAAa,CAAC;AAErB,QAAA,MAAM,UAAU,WACP,GAAG,WAAW,GAAG,+CA2BzB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { LngLatLike } from 'maplibre-gl';
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
export interface ThreeModelTransform {
|
|
4
|
+
rotation?: {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
z: number;
|
|
8
|
+
};
|
|
9
|
+
scale?: {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
z: number;
|
|
13
|
+
} | number;
|
|
14
|
+
position?: {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
z: number;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export type ModelLoader = (url: string, onSuccess: (object: THREE.Object3D) => void) => void;
|
|
21
|
+
export interface UseThreeModelProps {
|
|
22
|
+
url: string;
|
|
23
|
+
position: LngLatLike;
|
|
24
|
+
transform?: ThreeModelTransform;
|
|
25
|
+
init?: () => void;
|
|
26
|
+
onDone?: () => void;
|
|
27
|
+
loaders: Record<string, ModelLoader>;
|
|
28
|
+
customLoaders?: Record<string, ModelLoader>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Hook to manage loading, transforming, and rendering a 3D model in the MapLibre/Three.js context.
|
|
32
|
+
*/
|
|
33
|
+
export declare const useThreeModel: (props: UseThreeModelProps) => THREE.Object3D<THREE.Object3DEventMap> | undefined;
|
|
34
|
+
//# sourceMappingURL=useThreeModel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useThreeModel.d.ts","sourceRoot":"","sources":["../../src/hooks/useThreeModel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAIzC,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/C,KAAK,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC;IACrD,QAAQ,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/C;AAED,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,KAAK,IAAI,KAAK,IAAI,CAAC;AAE7F,MAAM,WAAW,kBAAkB;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,UAAU,CAAC;IACrB,SAAS,CAAC,EAAE,mBAAmB,CAAC;IAChC,IAAI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