@tomtom-org/maps-sdk-plugin-landmarks-3d 0.0.4 → 0.0.6
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/LICENSE.txt +37 -461
- package/README.md +1 -1
- package/THIRD_PARTY.txt +178 -0
- package/dist/THIRD_PARTY.txt +167 -1
- package/dist/index.d.ts +355 -343
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/third-party.json +23 -0
- package/package.json +13 -9
package/dist/index.d.ts
CHANGED
|
@@ -1,343 +1,355 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
*
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
*
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
*
|
|
288
|
-
*
|
|
289
|
-
* @group Landmarks 3D
|
|
290
|
-
*/
|
|
291
|
-
export declare class
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
|
|
1
|
+
import { TomTomMap } from "@tomtom-org/maps-sdk/map";
|
|
2
|
+
import { CustomLayerInterface, CustomRenderMethodInput, Map } from "maplibre-gl";
|
|
3
|
+
import { AmbientLight, Camera, DirectionalLight, Group, Mesh, Scene, ShaderMaterial, Texture, WebGLRenderer } from "three";
|
|
4
|
+
//#region src/displayMode.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* How 3D landmarks are shaded relative to the base map. Every mode renders the
|
|
7
|
+
* landmarks as maplibre-style fill-extrusion buildings:
|
|
8
|
+
* - `inherited`: mirrors the colour, opacity and vertical gradient of the basemap 3D building layer (default).
|
|
9
|
+
* - `dark`: uses the 3D building look of the SDK's standard dark style.
|
|
10
|
+
* - `light`: uses the 3D building look of the SDK's standard light style.
|
|
11
|
+
*
|
|
12
|
+
* @group Landmarks 3D
|
|
13
|
+
*/
|
|
14
|
+
type Landmarks3DDisplayMode = 'inherited' | 'dark' | 'light';
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/FillExtrusionMaterial.d.ts
|
|
17
|
+
/**
|
|
18
|
+
* Alpha mask carried over from a landmark mesh's as-authored texture.
|
|
19
|
+
*
|
|
20
|
+
* Landmark meshes are coarse hulls (e.g. a wall is one rectangle) whose realistic
|
|
21
|
+
* silhouette is carved out by the texture's alpha channel. Untextured shading must keep
|
|
22
|
+
* sampling that alpha and discard the carved-away fragments, otherwise the raw hull
|
|
23
|
+
* shape gets coloured in.
|
|
24
|
+
*
|
|
25
|
+
* @group Landmarks 3D
|
|
26
|
+
*/
|
|
27
|
+
type FillExtrusionAlphaMask = {
|
|
28
|
+
/** Texture whose alpha channel carves the mesh silhouette (the mesh's base colour map). */
|
|
29
|
+
map: Texture;
|
|
30
|
+
/** Fragments with alpha below this are discarded. */
|
|
31
|
+
cutoff: number;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Material that shades untextured landmark meshes exactly like maplibre-gl shades
|
|
35
|
+
* `fill-extrusion` buildings, so they blend in with the basemap building layer.
|
|
36
|
+
*
|
|
37
|
+
* Colour and opacity premultiply like maplibre's `v_color *= u_opacity`, paired with
|
|
38
|
+
* (ONE, ONE_MINUS_SRC_ALPHA) blending. Backfaces are culled like maplibre's extrusion
|
|
39
|
+
* rendering, except for alpha-masked meshes whose cutout surfaces must stay visible from
|
|
40
|
+
* both sides; pair with {@link FillExtrusionDepthMaterial} as a depth prepass so that
|
|
41
|
+
* translucent landmarks blend with the basemap exactly once per pixel.
|
|
42
|
+
*
|
|
43
|
+
* @group Landmarks 3D
|
|
44
|
+
*/
|
|
45
|
+
declare class FillExtrusionMaterial extends ShaderMaterial {
|
|
46
|
+
constructor(alphaMask?: FillExtrusionAlphaMask);
|
|
47
|
+
/**
|
|
48
|
+
* Copies the shading uniforms (colour, light, layer opacity, vertical gradient) from another
|
|
49
|
+
* instance, bringing a freshly created alpha-masked variant up to date with the shared material.
|
|
50
|
+
*/
|
|
51
|
+
copyShadingFrom(source: FillExtrusionMaterial): void;
|
|
52
|
+
/**
|
|
53
|
+
* Sets the building colour from a CSS colour string, stored as raw sRGB
|
|
54
|
+
* components — maplibre shades paint colours in sRGB space, not linear.
|
|
55
|
+
*/
|
|
56
|
+
setDiffuseColor(cssColor: string): void;
|
|
57
|
+
setLayerOpacity(opacity: number): void;
|
|
58
|
+
/** Enables or disables maplibre's `fill-extrusion-vertical-gradient` wall darkening. */
|
|
59
|
+
setVerticalGradient(enabled: boolean): void;
|
|
60
|
+
/**
|
|
61
|
+
* Mirrors maplibre's fill-extrusion light uniforms: the style light position is
|
|
62
|
+
* rotated by the map bearing for viewport-anchored lights and the light vector is
|
|
63
|
+
* deliberately left unnormalised, exactly like maplibre's `u_lightpos`.
|
|
64
|
+
*
|
|
65
|
+
* @param position - The style light position, in maplibre's y-south axes.
|
|
66
|
+
* @param bearingInRadians - Map bearing to rotate by; pass `0` for map-anchored lights.
|
|
67
|
+
* @param intensity - The style light intensity.
|
|
68
|
+
* @param color - The style light colour.
|
|
69
|
+
*/
|
|
70
|
+
setLight(position: {
|
|
71
|
+
x: number;
|
|
72
|
+
y: number;
|
|
73
|
+
z: number;
|
|
74
|
+
}, bearingInRadians: number, intensity: number, color: {
|
|
75
|
+
r: number;
|
|
76
|
+
g: number;
|
|
77
|
+
b: number;
|
|
78
|
+
}): void;
|
|
79
|
+
}
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/types/modelsSpecifications.d.ts
|
|
82
|
+
/**
|
|
83
|
+
* Style-like specification for a {@link ModelsLayer}, mirroring the shape of a
|
|
84
|
+
* MapLibre layer definition so 3D model layers can be configured declaratively.
|
|
85
|
+
*
|
|
86
|
+
* @group Landmarks 3D
|
|
87
|
+
*/
|
|
88
|
+
interface ModelsLayerSpecification {
|
|
89
|
+
id: string;
|
|
90
|
+
type: 'models';
|
|
91
|
+
source: string;
|
|
92
|
+
before?: string;
|
|
93
|
+
minzoom?: number;
|
|
94
|
+
maxzoom?: number;
|
|
95
|
+
paint?: {
|
|
96
|
+
'models-base-color'?: string;
|
|
97
|
+
};
|
|
98
|
+
layout?: {
|
|
99
|
+
visibility?: 'visible' | 'none';
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Style-like specification for a {@link ModelsSource}: a tiled source of
|
|
104
|
+
* glTF/GLB models, mirroring the shape of a MapLibre raster/vector source definition.
|
|
105
|
+
*
|
|
106
|
+
* @group Landmarks 3D
|
|
107
|
+
*/
|
|
108
|
+
interface ModelsSourceSpecification {
|
|
109
|
+
type: 'models';
|
|
110
|
+
tiles: Array<string>;
|
|
111
|
+
bounds?: [number, number, number, number];
|
|
112
|
+
scheme?: 'xyz' | 'tms';
|
|
113
|
+
minzoom?: number;
|
|
114
|
+
maxzoom?: number;
|
|
115
|
+
attribution?: string;
|
|
116
|
+
/**
|
|
117
|
+
* Base path of the Basis Universal transcoder used to decode KTX2 textures.
|
|
118
|
+
* Defaults to the three.js examples CDN path on unpkg; point this at a
|
|
119
|
+
* self-hosted copy when external CDNs are not an option (e.g. strict CSP).
|
|
120
|
+
*/
|
|
121
|
+
transcoderPath?: string;
|
|
122
|
+
/**
|
|
123
|
+
* Send `credentials: 'include'` with each tile request so a session cookie
|
|
124
|
+
* (e.g. the demos proxy's) travels with it. Leave off for direct
|
|
125
|
+
* `api.tomtom.com` access, where credentialed CORS would fail.
|
|
126
|
+
* @defaultValue `false`
|
|
127
|
+
*/
|
|
128
|
+
withCredentials?: boolean;
|
|
129
|
+
}
|
|
130
|
+
//#endregion
|
|
131
|
+
//#region src/ModelsSource.d.ts
|
|
132
|
+
/**
|
|
133
|
+
* Source of tiled glTF/GLB models for a {@link ModelsLayer}.
|
|
134
|
+
*
|
|
135
|
+
* Tracks the tiles covering the current viewport, fetches each tile's models once
|
|
136
|
+
* and keeps them in a Three.js {@link Group} that the owning layer renders.
|
|
137
|
+
*
|
|
138
|
+
* @group Landmarks 3D
|
|
139
|
+
*/
|
|
140
|
+
export declare class ModelsSource {
|
|
141
|
+
type: "models";
|
|
142
|
+
id: string;
|
|
143
|
+
minzoom: number;
|
|
144
|
+
maxzoom: number;
|
|
145
|
+
map: Map;
|
|
146
|
+
tiles: Array<string>;
|
|
147
|
+
scene: Group;
|
|
148
|
+
loadedTiles: Set<string>;
|
|
149
|
+
/**
|
|
150
|
+
* EPSG:3857 origin subtracted from all mesh positions: absolute coordinates (~6·10⁶ m) exceed
|
|
151
|
+
* float32 precision (~0.5 m), which makes landmark edges tremble while zooming. `null` until the
|
|
152
|
+
* first tile with meshes loads.
|
|
153
|
+
*/
|
|
154
|
+
sceneOrigin: {
|
|
155
|
+
x: number;
|
|
156
|
+
y: number;
|
|
157
|
+
} | null;
|
|
158
|
+
/** Optional consumer callback fired once per successful tile load. */
|
|
159
|
+
onTileLoaded?: (scene: Group, key: string) => void;
|
|
160
|
+
private readonly ktx2Loader;
|
|
161
|
+
private readonly gltfLoader;
|
|
162
|
+
private readonly specification;
|
|
163
|
+
private readonly withCredentials;
|
|
164
|
+
constructor(id: string, options: ModelsSourceSpecification);
|
|
165
|
+
onAdd(map: Map, renderer: WebGLRenderer): void;
|
|
166
|
+
updateTiles(): void;
|
|
167
|
+
private showCoveringTilesOnly;
|
|
168
|
+
private coveringTiles;
|
|
169
|
+
private loadTile;
|
|
170
|
+
private rebaseToSceneOrigin;
|
|
171
|
+
private fetchTile;
|
|
172
|
+
}
|
|
173
|
+
//#endregion
|
|
174
|
+
//#region src/ModelsLayer.d.ts
|
|
175
|
+
/**
|
|
176
|
+
* MapLibre custom layer that renders tiled glTF/GLB models with Three.js.
|
|
177
|
+
*
|
|
178
|
+
* The layer owns a {@link ModelsSource} that streams model tiles for the current
|
|
179
|
+
* viewport, renders them as maplibre-style fill-extrusion buildings, and keeps its
|
|
180
|
+
* lighting in sync with the map style light.
|
|
181
|
+
*
|
|
182
|
+
* @group Landmarks 3D
|
|
183
|
+
*/
|
|
184
|
+
export declare class ModelsLayer implements CustomLayerInterface {
|
|
185
|
+
id: string;
|
|
186
|
+
type: "custom";
|
|
187
|
+
renderingMode: "3d";
|
|
188
|
+
renderer: WebGLRenderer;
|
|
189
|
+
scene: Scene;
|
|
190
|
+
camera: Camera;
|
|
191
|
+
tiles: Group;
|
|
192
|
+
directionalLight: DirectionalLight;
|
|
193
|
+
ambientLight: AmbientLight;
|
|
194
|
+
map: Map;
|
|
195
|
+
source: ModelsSource;
|
|
196
|
+
minzoom: number;
|
|
197
|
+
maxzoom: number;
|
|
198
|
+
visible: boolean;
|
|
199
|
+
diffuseColor: string;
|
|
200
|
+
private readonly fillExtrusionMaterial;
|
|
201
|
+
private readonly depthPrepassMaterial;
|
|
202
|
+
private readonly maskedFillExtrusionMaterials;
|
|
203
|
+
constructor(options: ModelsLayerSpecification, source: ModelsSourceSpecification);
|
|
204
|
+
updateProperties(options: ModelsLayerSpecification): void;
|
|
205
|
+
setDirectionalLight(radius: number, phi: number, theta: number): void;
|
|
206
|
+
onAdd(map: Map, gl: WebGLRenderingContext | WebGL2RenderingContext): void;
|
|
207
|
+
render(_gl: WebGLRenderingContext | WebGL2RenderingContext, options: CustomRenderMethodInput): void;
|
|
208
|
+
private groundLandmarksOnTerrain;
|
|
209
|
+
private groundMeshOnTerrain;
|
|
210
|
+
private terrainSamplePoints;
|
|
211
|
+
private alignCameraToMap;
|
|
212
|
+
private get sceneOrigin();
|
|
213
|
+
private needsTranslucentPrepass;
|
|
214
|
+
private renderDepthPrepass;
|
|
215
|
+
setOpacity(value: number): void;
|
|
216
|
+
/** Mirrors the basemap's fill-extrusion-vertical-gradient on the landmark shading. */
|
|
217
|
+
setVerticalGradient(enabled: boolean): void;
|
|
218
|
+
getMaterial(mesh: Mesh): FillExtrusionMaterial;
|
|
219
|
+
private maskedFillExtrusionVariant;
|
|
220
|
+
private forEachFillExtrusionMaterial;
|
|
221
|
+
private syncLighting;
|
|
222
|
+
private applyMaterials;
|
|
223
|
+
}
|
|
224
|
+
//#endregion
|
|
225
|
+
//#region src/Landmarks3D.d.ts
|
|
226
|
+
/**
|
|
227
|
+
* Configuration for the {@link Landmarks3D} plugin.
|
|
228
|
+
*
|
|
229
|
+
* @group Landmarks 3D
|
|
230
|
+
*/
|
|
231
|
+
type Landmarks3DOptions = {
|
|
232
|
+
/**
|
|
233
|
+
* Initial display mode for the landmarks. Can also be changed at runtime with
|
|
234
|
+
* {@link Landmarks3D.setDisplayMode}.
|
|
235
|
+
* @defaultValue `'inherited'`
|
|
236
|
+
*/
|
|
237
|
+
displayMode?: Landmarks3DDisplayMode;
|
|
238
|
+
/**
|
|
239
|
+
* Whether the landmarks are initially visible. Can also be changed at runtime with
|
|
240
|
+
* {@link Landmarks3D.setVisible}.
|
|
241
|
+
* @defaultValue `true`
|
|
242
|
+
*/
|
|
243
|
+
visible?: boolean;
|
|
244
|
+
/**
|
|
245
|
+
* Minimum zoom at which landmarks are rendered.
|
|
246
|
+
* @defaultValue The basemap 3D building layer's minimum zoom, so landmarks appear together
|
|
247
|
+
* with it (falls back to `10` when that layer is absent).
|
|
248
|
+
*/
|
|
249
|
+
minZoom?: number;
|
|
250
|
+
/**
|
|
251
|
+
* Maximum zoom at which landmarks are rendered.
|
|
252
|
+
* @defaultValue The basemap 3D building layer's maximum zoom, so landmarks disappear together
|
|
253
|
+
* with it (falls back to `22` when that layer is absent).
|
|
254
|
+
*/
|
|
255
|
+
maxZoom?: number;
|
|
256
|
+
/**
|
|
257
|
+
* Send `credentials: 'include'` with each tile request so a proxy session
|
|
258
|
+
* cookie travels with it. By default this tracks the SDK's proxy config, so
|
|
259
|
+
* tiles behave like every other SDK request; set it explicitly only to
|
|
260
|
+
* override that.
|
|
261
|
+
* @defaultValue Auto-detected — `true` when the SDK is configured for a
|
|
262
|
+
* credentialed proxy (no `apiKey` + non-default `commonBaseURL`).
|
|
263
|
+
*/
|
|
264
|
+
withCredentials?: boolean;
|
|
265
|
+
};
|
|
266
|
+
/**
|
|
267
|
+
* Renders TomTom Orbis 3D Landmarks (high-detail building meshes) on a {@link TomTomMap}.
|
|
268
|
+
*
|
|
269
|
+
* The plugin streams GLB tiles from the Orbis 3D Landmarks API (Private Preview),
|
|
270
|
+
* renders them with Three.js via a MapLibre custom layer, filters overlapping
|
|
271
|
+
* extruded basemap buildings out of the style, and keeps everything restored
|
|
272
|
+
* across map style changes.
|
|
273
|
+
*
|
|
274
|
+
* @remarks
|
|
275
|
+
* Requires an API key with Orbis 3D Landmarks entitlements and a map style that
|
|
276
|
+
* shows extruded 3D buildings for the exclusion filter and `inherited` mode to
|
|
277
|
+
* have an effect.
|
|
278
|
+
*
|
|
279
|
+
* @example
|
|
280
|
+
* ```typescript
|
|
281
|
+
* import { Landmarks3D } from '@tomtom-org/maps-sdk-plugin-landmarks-3d';
|
|
282
|
+
*
|
|
283
|
+
* // assume `map` is your initialized TomTomMap instance
|
|
284
|
+
* const landmarks = new Landmarks3D(map);
|
|
285
|
+
*
|
|
286
|
+
* await landmarks.setDisplayMode('inherited');
|
|
287
|
+
* ```
|
|
288
|
+
*
|
|
289
|
+
* @group Landmarks 3D
|
|
290
|
+
*/
|
|
291
|
+
export declare class Landmarks3D {
|
|
292
|
+
private readonly map;
|
|
293
|
+
private readonly layerID;
|
|
294
|
+
private readonly basemapBuildingLayerID;
|
|
295
|
+
private readonly modelsLayer;
|
|
296
|
+
private readonly layerMinZoom?;
|
|
297
|
+
private readonly layerMaxZoom?;
|
|
298
|
+
private displayMode;
|
|
299
|
+
/**
|
|
300
|
+
* Creates the plugin bound to a TomTom map and starts rendering landmarks
|
|
301
|
+
* as soon as the map is ready.
|
|
302
|
+
*
|
|
303
|
+
* @param map - The TomTom map instance to render landmarks on.
|
|
304
|
+
* @param options - Optional configuration.
|
|
305
|
+
*/
|
|
306
|
+
constructor(map: TomTomMap, options?: Landmarks3DOptions);
|
|
307
|
+
private installWhenReady;
|
|
308
|
+
/**
|
|
309
|
+
* The underlying MapLibre custom layer, for advanced use beyond this facade.
|
|
310
|
+
*/
|
|
311
|
+
get layer(): ModelsLayer;
|
|
312
|
+
/**
|
|
313
|
+
* The currently applied display mode.
|
|
314
|
+
*/
|
|
315
|
+
getDisplayMode(): Landmarks3DDisplayMode;
|
|
316
|
+
/**
|
|
317
|
+
* Changes how landmarks are rendered relative to the base map.
|
|
318
|
+
*
|
|
319
|
+
* @param mode - The display mode to apply.
|
|
320
|
+
* @returns A promise that resolves once the mode has been applied.
|
|
321
|
+
*/
|
|
322
|
+
setDisplayMode(mode: Landmarks3DDisplayMode): Promise<void>;
|
|
323
|
+
/**
|
|
324
|
+
* Whether the landmarks are currently visible.
|
|
325
|
+
*/
|
|
326
|
+
isVisible(): boolean;
|
|
327
|
+
/**
|
|
328
|
+
* Shows or hides the landmarks layer.
|
|
329
|
+
*
|
|
330
|
+
* @param visible - `true` to show landmarks, `false` to hide them.
|
|
331
|
+
* @returns A promise that resolves once the visibility has been applied.
|
|
332
|
+
*/
|
|
333
|
+
setVisible(visible: boolean): Promise<void>;
|
|
334
|
+
private install;
|
|
335
|
+
private landmarkInsertBeforeID;
|
|
336
|
+
private alignZoomRangeWithBasemapBuildings;
|
|
337
|
+
private excludeLandmarkBuildingsFromBasemap;
|
|
338
|
+
private readBasemapBuildingMaterial;
|
|
339
|
+
private resolveCurrentMaterialState;
|
|
340
|
+
private applyDisplayMode;
|
|
341
|
+
}
|
|
342
|
+
//#endregion
|
|
343
|
+
//#region src/landmarksTileURL.d.ts
|
|
344
|
+
/**
|
|
345
|
+
* Builds the TomTom Orbis 3D Landmarks tile URL template.
|
|
346
|
+
*
|
|
347
|
+
* @remarks
|
|
348
|
+
* The API serves meshopt-compressed GLB tiles with KTX2/Basis textures and requires
|
|
349
|
+
* an API key with Orbis 3D Landmarks entitlements (still in Private Preview).
|
|
350
|
+
*
|
|
351
|
+
* @group Landmarks 3D
|
|
352
|
+
*/
|
|
353
|
+
export declare const buildLandmarksTileURL: () => string;
|
|
354
|
+
//#endregion
|
|
355
|
+
export type { Landmarks3DDisplayMode, Landmarks3DOptions, ModelsLayerSpecification, ModelsSourceSpecification };
|