@maptiler/3d
Advanced tools
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| <title>MapTiler E2E Load Model Test</title> | ||
| <style> | ||
| #map { | ||
| width: 100vw; | ||
| height: 100vh; | ||
| border: 1px solid red; | ||
| } | ||
| body { | ||
| margin: 0; | ||
| padding: 0; | ||
| } | ||
| </style> | ||
| </head> | ||
| <body> | ||
| <div id="map"></div> | ||
| <script type="module" src="/src/withPitchAndRoll.ts"></script> | ||
| </body> | ||
| </html> |
+11
-0
| # MapTiler 3D Models Changelog | ||
| ### NEXT (3.1.0) | ||
| ## ✨ New Features | ||
| - Dolly system implemented in `Item3D`. 3D items can now have their pitch and roll modified via the `setPitch`, `setRoll`, `modify` methods and by setting UI States. | ||
| ## ⚙️ Other | ||
| None | ||
| ## 🐞 Bug Fixes | ||
| None | ||
| ### 3.0.0 | ||
@@ -4,0 +15,0 @@ |
+36
-1
@@ -5,3 +5,3 @@ import { AnimationAction, AnimationClip, AnimationMixer, Group, Matrix4, Mesh, Object3D } from 'three'; | ||
| import { AnimationLoopOptions, AnimationMode, Item3DMeshUIStates, MeshOptions, Item3DMeshUIStateName, Item3DMeshUIStateProperties, Item3DEventTypes, Item3DTransform, AltitudeReference, SourceOrientation } from './types'; | ||
| import { getItem3DEventTypesSymbol } from './symbols'; | ||
| import { getItem3DEventTypesSymbol, getItem3DDollySymbol } from './symbols'; | ||
| export interface Item3DConstructorOptions { | ||
@@ -14,2 +14,4 @@ id: string; | ||
| heading: number; | ||
| pitch?: number; | ||
| roll?: number; | ||
| sourceOrientation: SourceOrientation; | ||
@@ -48,2 +50,12 @@ altitudeReference: AltitudeReference; | ||
| /** | ||
| * The dolly of the item, this is used to apply pitch, heading and roll. | ||
| * @see {Object3D} https://threejs.org/docs/#api/en/core/Object3D | ||
| */ | ||
| private dolly; | ||
| /** | ||
| * Get the dolly of the item | ||
| * @returns {Object3D | null} The dolly | ||
| */ | ||
| [getItem3DDollySymbol](): Object3D | null; | ||
| /** | ||
| * The lngLat of the item | ||
@@ -74,2 +86,10 @@ * @see {LngLat} https://docs.maptiler.com/sdk-js/api/geography/#lnglat | ||
| /** | ||
| * The pitch of the item, in degrees | ||
| */ | ||
| pitch: number; | ||
| /** | ||
| * The roll of the item, in degrees | ||
| */ | ||
| roll: number; | ||
| /** | ||
| * The source orientation of the item, can be "y-up" or "z-up" | ||
@@ -161,2 +181,3 @@ */ | ||
| constructor(parentLayer: Layer3D, { scale, states, ...options }: Item3DConstructorOptions); | ||
| private createDollyForMesh; | ||
| /** | ||
@@ -301,2 +322,16 @@ * Initialize the default state of the item. | ||
| /** | ||
| * Set the pitch of the item | ||
| * @param pitch - The pitch to set, in degrees | ||
| * @param cueRepaint - Whether to cue a repaint, if false, the repaint will be triggered only when the map is updated | ||
| * @returns {Item3D} The item | ||
| */ | ||
| setPitch(pitchInDegrees: number, cueRepaint?: boolean): this; | ||
| /** | ||
| * Set the roll of the item | ||
| * @param roll - The roll to set, in degrees | ||
| * @param cueRepaint - Whether to cue a repaint, if false, the repaint will be triggered only when the map is updated | ||
| * @returns {Item3D} The item | ||
| */ | ||
| setRoll(rollInDegrees: number, cueRepaint?: boolean): this; | ||
| /** | ||
| * Set the source orientation of the item | ||
@@ -303,0 +338,0 @@ * @param sourceOrientation - The source orientation to set |
@@ -9,1 +9,2 @@ export declare const handleMeshClickMethodSymbol: unique symbol; | ||
| export declare const getItem3DEventTypesSymbol: unique symbol; | ||
| export declare const getItem3DDollySymbol: unique symbol; |
+11
-1
@@ -78,2 +78,10 @@ import { CustomLayerInterface, CustomRenderMethodInput, LngLat, LngLatLike, Point2D } from '@maptiler/sdk'; | ||
| /** | ||
| * Pitch measured in degrees. | ||
| */ | ||
| pitch?: number; | ||
| /** | ||
| * Roll measured in degrees. | ||
| */ | ||
| roll?: number; | ||
| /** | ||
| * Opacity of the mesh | ||
@@ -125,2 +133,4 @@ */ | ||
| heading?: number; | ||
| pitch?: number; | ||
| roll?: number; | ||
| altitude?: number; | ||
@@ -132,3 +142,3 @@ lngLat?: LngLatLike; | ||
| }; | ||
| export declare const item3DStatePropertiesNames: readonly ["opacity", "scale", "transform", "heading", "altitude", "lngLat", "wireframe", "pointSize", "elevation"]; | ||
| export declare const item3DStatePropertiesNames: readonly ["opacity", "scale", "transform", "heading", "pitch", "roll", "altitude", "lngLat", "wireframe", "pointSize", "elevation"]; | ||
| export type Item3DMeshUIStates = { | ||
@@ -135,0 +145,0 @@ [key in Item3DMeshUIStateName]?: Item3DMeshUIStateProperties; |
+1
-0
| import { Matrix4, Object3D, PointLight } from 'three'; | ||
| import { SourceOrientation } from './types'; | ||
| export declare function degreesToRadians(degrees: number): number; | ||
| declare const isPointLight: (object3D: Object3D) => object3D is PointLight; | ||
@@ -4,0 +5,0 @@ /** |
+1
-1
| { | ||
| "name": "@maptiler/3d", | ||
| "version": "3.0.0", | ||
| "version": "3.1.0-rc.1", | ||
| "description": "Add 3D things to your map, plugin for MapTiler SDK", | ||
@@ -5,0 +5,0 @@ "module": "dist/maptiler-3d.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1096907
0.85%34
3.03%4601
2.45%3
50%