isard 1.16.0 → 2.0.0

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.
Files changed (103) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/README.md +4 -4
  3. package/dist/basemap/vectortiles/placed.js +7 -4
  4. package/dist/basemap/vectortiles/placed.js.map +1 -1
  5. package/dist/basemap/vectortiles/tiles.d.ts +1 -1
  6. package/dist/basemap/vectortiles/tiles.js.map +1 -1
  7. package/dist/basemap/workerpool.d.ts +1 -1
  8. package/dist/basemap/workerpool.js.map +1 -1
  9. package/dist/decoder.worker.js +4 -5
  10. package/dist/decoder.worker.js.map +6 -6
  11. package/dist/decoding/decoders.d.ts +1 -1
  12. package/dist/decoding/decoders.js.map +1 -1
  13. package/dist/decoding/loader.d.ts +6 -3
  14. package/dist/decoding/loader.js +7 -5
  15. package/dist/decoding/loader.js.map +1 -1
  16. package/dist/decoding/protocol.d.ts +3 -2
  17. package/dist/decoding/protocol.js.map +1 -1
  18. package/dist/engine-loader.d.ts +20 -18
  19. package/dist/engine-loader.js +45 -42
  20. package/dist/engine-loader.js.map +1 -1
  21. package/dist/index.d.ts +3 -3
  22. package/dist/index.js.map +1 -1
  23. package/dist/isard_grid_bg.wasm +0 -0
  24. package/dist/isard_tess_bg.wasm +0 -0
  25. package/dist/isard_tiles3d_bg.wasm +0 -0
  26. package/dist/isard_webgl2_bg.wasm +0 -0
  27. package/dist/isard_webgpu_bg.wasm +0 -0
  28. package/dist/layers/custom.d.ts +35 -29
  29. package/dist/layers/custom.js +60 -46
  30. package/dist/layers/custom.js.map +1 -1
  31. package/dist/layers/extrusions.js.map +1 -1
  32. package/dist/layers/features.js.map +1 -1
  33. package/dist/layers/flow.js.map +1 -1
  34. package/dist/layers/glyphs.d.ts +1 -1
  35. package/dist/layers/glyphs.js.map +1 -1
  36. package/dist/layers/ground.d.ts +20 -13
  37. package/dist/layers/ground.js +29 -8
  38. package/dist/layers/ground.js.map +1 -1
  39. package/dist/layers/icons.d.ts +1 -1
  40. package/dist/layers/icons.js.map +1 -1
  41. package/dist/layers/layers.d.ts +1 -2
  42. package/dist/layers/layers.js +2 -11
  43. package/dist/layers/layers.js.map +1 -1
  44. package/dist/layers/models.js +0 -4
  45. package/dist/layers/models.js.map +1 -1
  46. package/dist/layers/network.d.ts +1 -1
  47. package/dist/layers/network.js.map +1 -1
  48. package/dist/layers/panoramas.d.ts +1 -0
  49. package/dist/layers/panoramas.js +3 -2
  50. package/dist/layers/panoramas.js.map +1 -1
  51. package/dist/layers/pointclouds.d.ts +1 -1
  52. package/dist/layers/pointclouds.js +0 -4
  53. package/dist/layers/pointclouds.js.map +1 -1
  54. package/dist/layers/raster.js.map +1 -1
  55. package/dist/layers/symbols.js.map +1 -1
  56. package/dist/layers/tiles3d.d.ts +1 -1
  57. package/dist/layers/tiles3d.js +0 -4
  58. package/dist/layers/tiles3d.js.map +1 -1
  59. package/dist/layers/vectors.d.ts +4 -5
  60. package/dist/layers/vectors.js +7 -15
  61. package/dist/layers/vectors.js.map +1 -1
  62. package/dist/map/engine-settings.d.ts +1 -1
  63. package/dist/map/engine-settings.js.map +1 -1
  64. package/dist/map/engines.d.ts +11 -26
  65. package/dist/map/engines.js +10 -48
  66. package/dist/map/engines.js.map +1 -1
  67. package/dist/map/frame-loop.d.ts +1 -3
  68. package/dist/map/frame-loop.js +3 -3
  69. package/dist/map/frame-loop.js.map +1 -1
  70. package/dist/map/hover-pick.d.ts +9 -3
  71. package/dist/map/hover-pick.js +29 -6
  72. package/dist/map/hover-pick.js.map +1 -1
  73. package/dist/map/layer-stack.d.ts +2 -2
  74. package/dist/map/layer-stack.js +1 -3
  75. package/dist/map/layer-stack.js.map +1 -1
  76. package/dist/map/symbol-atlases.d.ts +5 -4
  77. package/dist/map/symbol-atlases.js +8 -13
  78. package/dist/map/symbol-atlases.js.map +1 -1
  79. package/dist/map/viewshed.d.ts +1 -1
  80. package/dist/map/viewshed.js.map +1 -1
  81. package/dist/map.d.ts +26 -20
  82. package/dist/map.js +93 -78
  83. package/dist/map.js.map +1 -1
  84. package/dist/react/IsardMap.d.ts +1 -1
  85. package/dist/react/IsardMap.js.map +1 -1
  86. package/dist/react/index.d.ts +1 -1
  87. package/dist/react/index.js.map +1 -1
  88. package/dist/types.d.ts +29 -18
  89. package/dist/types.js.map +1 -1
  90. package/dist/ui/interaction.d.ts +1 -1
  91. package/dist/ui/interaction.js.map +1 -1
  92. package/dist/util/animation.d.ts +1 -1
  93. package/dist/util/animation.js.map +1 -1
  94. package/dist/wasm/isard_tiles3d.d.ts +181 -0
  95. package/dist/wasm/isard_tiles3d.js +387 -0
  96. package/dist/wasm/{isard_core.d.ts → isard_webgl2.d.ts} +373 -182
  97. package/dist/wasm/{isard_core.js → isard_webgl2.js} +2155 -413
  98. package/dist/wasm/{isard.d.ts → isard_webgpu.d.ts} +176 -353
  99. package/dist/wasm/{isard.js → isard_webgpu.js} +1361 -1104
  100. package/package.json +4 -3
  101. package/vite.js +5 -4
  102. package/dist/isard_bg.wasm +0 -0
  103. package/dist/isard_core_bg.wasm +0 -0
@@ -1,6 +1,25 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
 
4
+ /** A feature picked: its layer and its index there (the edge of a network, the feature of a layer) */
5
+ export interface PickHit {
6
+ layer: number;
7
+ index: number;
8
+ }
9
+
10
+ /** The answer to `requestPick`, from `pollPick` */
11
+ export interface PickResult {
12
+ /** The screen point asked about (CSS pixels) */
13
+ x: number;
14
+ y: number;
15
+ /** The feature there, if any */
16
+ hit?: PickHit;
17
+ /** The position there, on the relief; undefined above the horizon */
18
+ lonLat?: [lon: number, lat: number];
19
+ }
20
+
21
+
22
+
4
23
  /** Camera, with the conventions of MapLibre */
5
24
  export interface Camera {
6
25
  center: [lon: number, lat: number];
@@ -11,14 +30,6 @@ export interface Camera {
11
30
  bearing: number;
12
31
  }
13
32
 
14
- /** The feature under a screen point */
15
- export interface PickHit {
16
- /** Id of the layer */
17
- layer: number;
18
- /** Index of the feature in the layer (the edge of a network) */
19
- index: number;
20
- }
21
-
22
33
  /** Tile counters of a raster layer */
23
34
  export interface RasterLayerStats {
24
35
  id: number;
@@ -40,6 +51,81 @@ export interface RasterLayerStats {
40
51
 
41
52
 
42
53
 
54
+ /** Counters of a 3D Tiles layer */
55
+ export interface Tiles3dStats {
56
+ /** Tiles drawn in the last frame */
57
+ drawn: number;
58
+ /** Meshes held on the GPU */
59
+ loaded: number;
60
+ /** Downloads of tiles in view */
61
+ inFlight: number;
62
+ /** Downloads of tiles just out of view (siblings of refined tiles), in the background */
63
+ prefetching: number;
64
+ /** GPU memory of the meshes, MB */
65
+ gpuMb: number;
66
+ /** Tiles known in the tree (external tilesets included once loaded) */
67
+ tiles: number;
68
+ }
69
+
70
+
71
+
72
+ /** Counters of a point cloud layer */
73
+ export interface PointCloudStats {
74
+ /** Points drawn in the last frame */
75
+ points: number;
76
+ /** Nodes drawn in the last frame */
77
+ nodes: number;
78
+ /** Nodes held on the GPU */
79
+ loaded: number;
80
+ /** Downloads under way */
81
+ inFlight: number;
82
+ /** GPU memory of the points, MB */
83
+ gpuMb: number;
84
+ /** Nodes known in the hierarchy (its pages loaded so far) */
85
+ known: number;
86
+ }
87
+
88
+ /** What a point cloud says of itself once its head is read */
89
+ export interface PointCloudInfo {
90
+ /** Points in the file */
91
+ points: number;
92
+ /** LAS point format (6 to 8: 7 and 8 with colors) */
93
+ format: number;
94
+ /** The WKT of its CRS, if the file has one */
95
+ wkt?: string;
96
+ /** The center of its cube: longitude, latitude */
97
+ center: [lon: number, lat: number];
98
+ /** Its altitudes, lowest and highest (metres) */
99
+ altitudes: [min: number, max: number];
100
+ }
101
+
102
+ /** A point picked in a point cloud */
103
+ export interface PointCloudPoint {
104
+ lonLat: [lon: number, lat: number];
105
+ /** Metres above the ellipsoid */
106
+ height: number;
107
+ /** Its z in the file's vertical datum (metres) */
108
+ altitude: number;
109
+ classification: number;
110
+ intensity: number;
111
+ returnNumber: number;
112
+ numberOfReturns: number;
113
+ /** 8-bit color, files with colors only */
114
+ rgb?: [r: number, g: number, b: number];
115
+ }
116
+
117
+ /** The CRS of a point cloud, as the page resolves it from the file's WKT (`addPointCloud`) */
118
+ export interface PointCloudCrs {
119
+ /** x, y pairs of the CRS to longitudes, latitudes (degrees) */
120
+ inverse(xy: Float64Array): Float64Array;
121
+ /** The altitudes are above the geoid (IGN69): raised by the RAF20 geoid height */
122
+ geoid: boolean;
123
+ /** Metres of a unit of z */
124
+ verticalScale: number;
125
+ }
126
+
127
+
128
+
43
129
  /** Pieces of a network layer: its edges cut along their lines, sorted by square; only the squares in view are drawn */
44
130
  export interface NetworkStats {
45
131
  pieces: number;
@@ -49,47 +135,47 @@ export interface NetworkStats {
49
135
 
50
136
 
51
137
 
52
- /** The answer to `requestPick`, from `pollPick` */
53
- export interface PickResult {
54
- /** The screen point asked about (CSS pixels) */
55
- x: number;
56
- y: number;
57
- /** The feature there, if any */
58
- hit?: PickHit;
59
- /** The position there, on the relief; undefined above the horizon */
60
- lonLat?: [lon: number, lat: number];
138
+ /** What a custom layer draws into before the frame's pass: the engine's device, the layer's color (cleared, at the
139
+ * canvas's size; premultiplied alpha) and in the '3d' mode its depth (the solid scene's, to test against) */
140
+ export interface CustomTarget {
141
+ device: GPUDevice;
142
+ color: GPUTexture;
143
+ format: 'rgba8unorm';
144
+ depth?: GPUTexture;
145
+ depthFormat: 'depth32float';
146
+ width: number;
147
+ height: number;
61
148
  }
62
149
 
63
150
 
64
151
 
65
152
  /**
66
- * A map on one canvas: its WebGL2 context, camera, ground (raster layers over the relief) and the layers over it.
67
- * Draws only when `render` is called (the JavaScript side calls it after `redraw` asks for a frame)
153
+ * A map on one canvas: its device, its camera, what it draws. Draws only when `render` is called (the JavaScript
154
+ * side calls it after `redraw` asks for a frame)
68
155
  */
69
156
  export class Engine {
157
+ private constructor();
70
158
  free(): void;
71
159
  /**
72
160
  * Circle layer of `feature_count` features: points (Mercator [0, 1], interleaved) and the feature of each
73
161
  *
74
162
  * # Errors
75
163
  *
76
- * Throws (to JavaScript) when a WebGL object cannot be created or a shader fails to compile (the error carries its
77
- * info log), or when `feature_count` features need a table texture past the GPU's `MAX_TEXTURE_SIZE`
164
+ * Throws (to JavaScript) when `feature_count` features need a table past the GPU's largest texture
78
165
  */
79
166
  addCircles(points: Float64Array, feature: Uint32Array, feature_count: number): number;
80
167
  /**
81
- * A layer drawn by the page: `render()` is called at its place in every frame (`customMatrix` gives the
82
- * matrices of that frame meanwhile); `depth`: with the depth buffer of the 3D layers (`3d` mode), else over
83
- * what is drawn before it
168
+ * A layer drawn by the page: `render(target)` is called before every frame's pass with its targets (the device,
169
+ * the color, the depth in `'3d'`: `customMatrix` gives the matrices of that frame meanwhile), what it drew laid over
170
+ * the frame at the layer's place; `depth`: with the depth of the solid scene (`'3d'` mode)
84
171
  */
85
- addCustomLayer(render: () => void, depth: boolean): number;
172
+ addCustomLayer(render: (target: CustomTarget) => void, depth: boolean): number;
86
173
  /**
87
174
  * An empty extrusion layer: its blocks come in batches (`setExtrusionBatch`)
88
175
  *
89
176
  * # Errors
90
177
  *
91
- * Throws (to JavaScript) when a WebGL object cannot be created or a shader fails to compile (the error carries its
92
- * info log)
178
+ * Never in practice: the layer starts empty
93
179
  */
94
180
  addExtrusions(): number;
95
181
  /**
@@ -99,8 +185,7 @@ export class Engine {
99
185
  *
100
186
  * # Errors
101
187
  *
102
- * Throws (to JavaScript) when a WebGL object cannot be created or a shader fails to compile (the error carries its
103
- * info log), or when `feature_count` features need a table texture past the GPU's `MAX_TEXTURE_SIZE`
188
+ * Throws (to JavaScript) when `feature_count` features need a table past the GPU's largest texture
104
189
  */
105
190
  addFills(points: Float64Array, ring_start: Uint32Array, polygon_start: Uint32Array, feature: Uint32Array, feature_count: number): number;
106
191
  /**
@@ -109,52 +194,61 @@ export class Engine {
109
194
  *
110
195
  * # Errors
111
196
  *
112
- * Throws (to JavaScript) when a WebGL object cannot be created, a shader fails to compile or the trails need a
113
- * table texture past the GPU's `MAX_TEXTURE_SIZE`
197
+ * Throws (to JavaScript) when the trails need a table past the GPU's largest texture
114
198
  */
115
199
  addFlow(particles: number, trail: number): number;
116
200
  /**
117
- * Ground layer running `code` (GLSL ES 3.0 defining `vec4 ground(vec2 offset)`, see `render::ground`) over the
118
- * ground; `anchor`: Mercator point the offsets are taken from; bounds: Mercator box it shows in. Compilation errors
119
- * come back with the shader's info log (line numbers of `code`)
201
+ * Ground layer running `code` (WGSL defining `fn ground(offset: vec2f) -> vec4f`, see `render::ground`) over the
202
+ * ground; `names` and `types`: its uniforms (`f32`, `vec2f`, `vec4<u32>`, `mat4x4f`…), read as `u.<name>`;
203
+ * `anchor`: Mercator point the offsets are taken from; bounds: Mercator box it shows in. Compilation errors are
204
+ * reported in the console when the layer is first drawn
120
205
  *
121
206
  * # Errors
122
207
  *
123
- * Throws (to JavaScript) when `code` does not compile or link, with the shader's info log
208
+ * Throws (to JavaScript) on a uniform's name or type WGSL does not take
124
209
  */
125
- addGround(code: string, anchor_x: number, anchor_y: number, min_x: number, min_y: number, max_x: number, max_y: number): number;
210
+ addGround(code: string, names: string[], types: string[], anchor_x: number, anchor_y: number, min_x: number, min_y: number, max_x: number, max_y: number): number;
126
211
  /**
127
212
  * Line layer of `feature_count` features: polylines given by their points (Mercator [0, 1], interleaved), the
128
213
  * first point of each (`start`, one more entry than lines) and the feature each one belongs to
129
214
  *
130
215
  * # Errors
131
216
  *
132
- * Throws (to JavaScript) when a WebGL object cannot be created or a shader fails to compile (the error carries its
133
- * info log), or when the features or the lines need a table texture past the GPU's `MAX_TEXTURE_SIZE`
217
+ * Throws (to JavaScript) when the features or the lines need a table past the GPU's largest texture
134
218
  */
135
219
  addLines(points: Float64Array, start: Uint32Array, feature: Uint32Array, feature_count: number, heights?: Float64Array | null, sea?: boolean | null): number;
220
+ /**
221
+ * A glTF / GLB model (its URL, a `blob:` one for data of the page) drawn at each instance of `instances`
222
+ * (`geo::models::INSTANCE_NUMBERS` numbers each: longitude, latitude, altitude, heading, pitch, roll in degrees,
223
+ * scale); `ground`: altitudes above the relief, else above the ellipsoid. A model that fails to load or decode
224
+ * leaves the layer empty
225
+ */
226
+ addModels(url: string, instances: Float64Array, ground: boolean): number;
136
227
  /**
137
228
  * Network of `mercator.length / 2` nodes (Mercator [0, 1], y towards the south, interleaved: converted by the
138
229
  * JavaScript side, where `Math.tan` and `Math.log` are much faster than in WebAssembly) and `edges.length / 2`
139
- * edges (node index pairs, interleaved). `line_start` and `line_points`: the line of each edge from A to B, points
140
- * `line_start[e] .. line_start[e + 1]` of `line_points` (Mercator, interleaved; straight if fewer than two). `costs`: per edge, the
141
- * cost of travelling it from A to B then from B to A; without, values are interpolated along the edges.
230
+ * edges (node index pairs, interleaved). `line_start` and `line_points`: the line of each edge from A to B,
231
+ * points `line_start[e] .. line_start[e + 1]` of `line_points` (Mercator, interleaved; straight if fewer than
232
+ * two). `costs`: per edge, the cost of travelling it from A to B then from B to A; without, values are
233
+ * interpolated along the edges.
142
234
  *
143
235
  * # Errors
144
236
  *
145
- * Throws (to JavaScript) when `style` is not 25 numbers, `edges` is not node pairs or names a node past
146
- * those of `mercator`, the nodes or edges need a table texture past the GPU's `MAX_TEXTURE_SIZE`, or when
147
- * a WebGL object cannot be created or a shader fails to compile (the error carries its info log)
237
+ * Throws (to JavaScript) when `style` is not 25 numbers, `edges` is not node pairs or names a node past those of
238
+ * `mercator`, or the nodes or edges need a table past the GPU's largest texture
148
239
  */
149
240
  addNetwork(mercator: Float64Array, edges: Uint32Array, line_start: Uint32Array | null | undefined, line_points: Float64Array | null | undefined, costs: Float32Array | null | undefined, style: Float32Array): number;
241
+ /**
242
+ * A COPC point cloud from its URL (HTTP range requests). `resolve(wkt)` gives the CRS of the file from its WKT
243
+ * (undefined if it has none): its inverse projection, whether its altitudes are above the geoid, the metres of
244
+ * a unit of z; it may throw (an unknown CRS), the layer then stays empty
245
+ * The file is read later: a bad file, or a `resolve` that throws, leaves the layer empty
246
+ */
247
+ addPointCloud(url: string, resolve: (wkt: string | undefined) => PointCloudCrs): number;
150
248
  /**
151
249
  * Raster tiles in Web Mercator; `url` holds {z}, {x} and {y}. `size`: side of the tiles' textures (256 by
152
250
  * default); `loader`: draws each tile instead of fetching `url`, `(z, x, y, signal) => Promise<ImageBitmap |
153
251
  * null>`, an image of `size` × `size` (null: nothing there); `ground: false`: draped on 3D layers only
154
- *
155
- * # Errors
156
- *
157
- * Throws (to JavaScript) when the texture holding the layer's tiles cannot be created
158
252
  */
159
253
  addRaster(url: string, min_z: number, max_z: number, opacity: number, saturation: number, size: number | null | undefined, loader: ((z: number, x: number, y: number, signal: AbortSignal) => Promise<ImageBitmap | null>) | undefined, ground?: boolean | null): number;
160
254
  /**
@@ -162,19 +256,30 @@ export class Engine {
162
256
  *
163
257
  * # Errors
164
258
  *
165
- * Throws (to JavaScript) when a WebGL object cannot be created or a shader fails to compile (the error carries its
166
- * info log)
259
+ * Never in practice: its tables start empty
167
260
  */
168
261
  addSymbols(): number;
262
+ /**
263
+ * 3D Tiles (b3dm / glb textured meshes, external tilesets) from the URL of a `tileset.json`. `max_error`:
264
+ * screen-space error (CSS pixels) above which a tile is refined; 16 is the usual value, lower is finer.
265
+ * `geoid`: its heights are altitudes (NGF-IGN69), each tile raised by the RAF20 geoid onto the relief.
266
+ *
267
+ * The tileset is read later: a bad one leaves the layer empty
268
+ */
269
+ addTiles3d(url: string, max_error: number, geoid?: boolean | null): number;
169
270
  /**
170
271
  * An empty layer of vector tiles drawn as geometry: its style layers come with `setVectorSublayers`, its tiles
171
- * with `setVectorTile`
272
+ * with `setVectorTile` or `setVectorTileMesh`
172
273
  *
173
274
  * # Errors
174
275
  *
175
- * Throws (to JavaScript) when a shader fails to compile (the error carries its info log)
276
+ * Never in practice: the layer starts empty
176
277
  */
177
278
  addVectorTiles(): number;
279
+ /**
280
+ * The backend drawing: "browserwebgpu" or "gl"
281
+ */
282
+ backend(): string;
178
283
  /**
179
284
  * Longitudes and latitudes the view covers on the ground, `[west, south, east, north]` (degrees): the screen's
180
285
  * border cast on the ground, or on the far plane where it passes the horizon
@@ -184,6 +289,10 @@ export class Engine {
184
289
  * The camera as set or moved: center (degrees), zoom, pitch and bearing (degrees)
185
290
  */
186
291
  camera(): Camera;
292
+ /**
293
+ * Removes the panorama
294
+ */
295
+ clearPanorama(): void;
187
296
  /**
188
297
  * The turns go around the screen center again
189
298
  */
@@ -197,7 +306,16 @@ export class Engine {
197
306
  */
198
307
  clearViewshed(): void;
199
308
  /**
200
- * Model-view-projection matrix (16 numbers, column-major, for `uniformMatrix4fv`) of the local frame at a
309
+ * The engine of `canvas`, `redraw` called when it needs a new frame; `antialias`: the 3D multisampled (default
310
+ * true). Asynchronous: the device is asked for
311
+ *
312
+ * # Errors
313
+ *
314
+ * Throws (to JavaScript) when the canvas gives no device ("WebGPU is not available" through WebGPU)
315
+ */
316
+ static create(canvas: HTMLCanvasElement, redraw: () => void, antialias?: boolean | null): Promise<Engine>;
317
+ /**
318
+ * Model-view-projection matrix (16 numbers, column-major, WebGPU's clip depth from 0 to 1) of the local frame at a
201
319
  * longitude, latitude (degrees) and altitude (metres): x east, y north, z up, in metres. Undefined outside the
202
320
  * callback of a custom layer. Static: the engine is borrowed while it draws
203
321
  */
@@ -213,23 +331,29 @@ export class Engine {
213
331
  */
214
332
  static geoidHeight(lon: number, lat: number): number;
215
333
  /**
216
- * Position under a screen point (CSS pixels), undefined above the horizon; on the relief itself: from the copy of
217
- * its tiles kept on the CPU, the drawn ground read back from the GPU only where none is there (a read back waits
218
- * for the frame: called during a move, it stalls it)
334
+ * The `GPUDevice` the engine draws with, for the custom layers' objects; undefined on the WebGL2 fallback
335
+ */
336
+ gpuDevice(): GPUDevice | undefined;
337
+ /**
338
+ * Position under a screen point (CSS pixels), undefined above the horizon
219
339
  */
220
340
  ground(x: number, y: number): [lon: number, lat: number] | undefined;
221
341
  /**
222
- * Colors an extrusion layer by the node values of network layer `network` (undefined: by its own values):
223
- * each block takes min(value(A) + cost from A, value(B) + cost from B) from its anchors (`setExtrusionAnchors`),
342
+ * Colors an extrusion layer by the node values of network layer `network` (undefined: by its own values): each
343
+ * block takes min(value(A) + cost from A, value(B) + cost from B) from its anchors (`setExtrusionAnchors`),
224
344
  * through the layer's ramp, up to `max` (above: its own color)
225
345
  */
226
346
  linkExtrusionNetwork(id: number, network: number | null | undefined, max: number): void;
227
347
  /**
228
- * Model-view-projection matrix (16 numbers, column-major) of the local frame at a longitude, latitude (degrees)
229
- * and altitude (metres), x east, y north, z up, in metres, for the last frame drawn (else the camera): the 3D
230
- * overlays of the page (`Panel`) placed with it after each frame
348
+ * Model-view-projection matrix (16 numbers, column-major, WebGL's clip depth) of the local frame at a longitude,
349
+ * latitude (degrees) and altitude (metres), x east, y north, z up, in metres, for the last frame drawn (else the
350
+ * camera): the 3D overlays of the page (`Panel`) placed with it after each frame
231
351
  */
232
352
  localMatrix(lon: number, lat: number, altitude: number): Float32Array;
353
+ /**
354
+ * The largest texture the device takes (pixels a side): the symbol layers' atlases stay within it
355
+ */
356
+ maxTextureSize(): number;
233
357
  /**
234
358
  * Moves a layer to a drawing position (0 = bottom)
235
359
  */
@@ -238,33 +362,29 @@ export class Engine {
238
362
  * Pieces of a network in all and drawn in the last frame (only the squares in view are)
239
363
  */
240
364
  networkStats(id: number): NetworkStats | undefined;
241
- /**
242
- * `redraw` is called when the engine needs a new frame (a tile arrived); `antialias`: multisampled (default true)
243
- *
244
- * # Errors
245
- *
246
- * Throws (to JavaScript) when the canvas gives no WebGL2 context ("WebGL2 is not available"), or when a WebGL
247
- * object of the globe, the sky or the raster pass cannot be created or one of their shaders fails to compile
248
- */
249
- constructor(canvas: HTMLCanvasElement, redraw: () => void, antialias?: boolean | null);
250
365
  /**
251
366
  * Drags the ground from one screen point to another (CSS pixels); in relief, the ground point grabbed stays
252
367
  * under the cursor
253
368
  */
254
369
  pan(x0: number, y0: number, x1: number, y1: number): void;
255
370
  /**
256
- * Feature under a screen point (CSS pixels), or the nearest one within `radius` CSS pixels: its layer and its
257
- * index there (the edge of a network, the feature of a line, circle or fill layer), undefined if none. The
258
- * pickable layers are drawn with each feature colored by its number; then the fills are tested on the ground.
259
- * `only`: the ids of the layers to look in (all if undefined): the others are not drawn and hide nothing.
260
- * Reads the pixels back at once (the GPU finishes its work first): for clicks; `requestPick` for the hover
371
+ * What a point cloud says of itself, undefined before its head is read
372
+ */
373
+ pointCloudInfo(id: number): PointCloudInfo | undefined;
374
+ /**
375
+ * The point of a point cloud picked by `pollPick` (its index there): read back with the answer; undefined for
376
+ * another
377
+ */
378
+ pointCloudPoint(id: number, index: number): PointCloudPoint | undefined;
379
+ /**
380
+ * Counters of a point cloud layer, undefined if there is none with this id
261
381
  */
262
- pick(x: number, y: number, radius?: number | null, only?: Uint32Array | null): PickHit | undefined;
382
+ pointCloudStats(id: number): PointCloudStats | undefined;
263
383
  /**
264
- * The answer to the last `requestPick` once the GPU has delivered it (then forgotten), undefined while it is not
265
- * there yet (or nothing was asked, or the context was lost)
384
+ * The answer to request `id` once the GPU has delivered it (then forgotten), undefined while it is not there yet
385
+ * (or for a request given up)
266
386
  */
267
- pollPick(): PickResult | undefined;
387
+ pollPick(id: number): PickResult | undefined;
268
388
  /**
269
389
  * Loads in advance the tiles of a camera flight's destination; `clearPreload` when the flight ends
270
390
  */
@@ -283,7 +403,7 @@ export class Engine {
283
403
  */
284
404
  removeExtrusionBatch(id: number, key: number): void;
285
405
  /**
286
- * Removes a layer and frees its GPU objects; the other layers forget it (a layer that referred to it)
406
+ * Removes a layer and frees its GPU objects (as it drops)
287
407
  */
288
408
  removeLayer(id: number): void;
289
409
  /**
@@ -291,16 +411,17 @@ export class Engine {
291
411
  */
292
412
  removeVectorTile(id: number, key: number): void;
293
413
  /**
294
- * Draws a frame: the backdrop, the ground and the layers over it bottom to top, then the panorama and the
295
- * viewshed; returns true while tiles are still loading (a new frame will be asked through `redraw`)
414
+ * Draws a frame: the backdrop, the ground; returns true while tiles are still loading (a new frame will be asked
415
+ * through `redraw`)
296
416
  */
297
417
  render(): boolean;
298
418
  /**
299
- * Asks what is under a screen point without waiting for the GPU (as `pick`, with the position there): the
300
- * picking pass is drawn now and read back into a buffer; `pollPick` gives the answer on a later frame. A new
301
- * request replaces the one in flight. Returns false if nothing could be asked (no WebGL2 fence)
419
+ * Asks what is under a screen point (CSS pixels), or nearest to it within `radius` CSS pixels, without waiting
420
+ * for the GPU: the picking pass is drawn now, its pixels read back later; `pollPick` gives the answer. `only`: the
421
+ * ids of the layers to look in (all if undefined): the others are not drawn and hide nothing. The request's
422
+ * number, never 0
302
423
  */
303
- requestPick(x: number, y: number, radius?: number | null, only?: Uint32Array | null): boolean;
424
+ requestPick(x: number, y: number, radius?: number | null, only?: Uint32Array | null): number;
304
425
  /**
305
426
  * Viewport in CSS pixels and device pixel ratio
306
427
  */
@@ -322,8 +443,7 @@ export class Engine {
322
443
  * The body the map is drawn on: its equatorial radius (metres) and flattening (0 for a sphere), the halo of its
323
444
  * atmosphere around the globe (RGB 0-1 and its strength, 4 numbers; `undefined` for an airless body), and the
324
445
  * lowest and highest altitudes of its ground (metres: what its relief may raise into view). WGS 84, the Earth's
325
- * blue halo and the range of its relief worldwide (-450 m to 8900 m) by default; set before the layers and the
326
- * relief, whose shaders may take its size (`ISARD_CIRCUMFERENCE` of the ground layers)
446
+ * blue halo and the range of its relief worldwide (-450 m to 8900 m) by default
327
447
  */
328
448
  setBody(radius: number, flattening: number, halo: Float32Array | null | undefined, lowest: number, highest: number): void;
329
449
  /**
@@ -344,8 +464,7 @@ export class Engine {
344
464
  *
345
465
  * # Errors
346
466
  *
347
- * Throws (to JavaScript) when the batch's features need an anchor texture past the GPU's
348
- * `MAX_TEXTURE_SIZE`, or when it cannot be created
467
+ * Throws (to JavaScript) when the batch's features need a table past the GPU's largest texture
349
468
  */
350
469
  setExtrusionAnchors(id: number, key: number, anchors: Float32Array): void;
351
470
  /**
@@ -354,8 +473,7 @@ export class Engine {
354
473
  *
355
474
  * # Errors
356
475
  *
357
- * Throws (to JavaScript) when a WebGL buffer or vertex array of the batch cannot be created, or when
358
- * `feature_count` features need a table texture past the GPU's `MAX_TEXTURE_SIZE`
476
+ * Throws (to JavaScript) when `feature_count` features need a table past the GPU's largest texture
359
477
  */
360
478
  setExtrusionBatch(id: number, key: number, points: Float64Array, ring_start: Uint32Array, polygon_start: Uint32Array, feature: Uint32Array, feature_count: number, roofs: Uint8Array, roof_heights: Float32Array, metres: number): void;
361
479
  /**
@@ -437,7 +555,7 @@ export class Engine {
437
555
  *
438
556
  * # Errors
439
557
  *
440
- * Throws (to JavaScript) as `setGlyphPages` does: a size that is not positive, or the texture not created
558
+ * Throws (to JavaScript) as `setGlyphPages` does
441
559
  */
442
560
  setGlyphAtlas(width: number, height: number, data?: Uint8Array | null): void;
443
561
  /**
@@ -447,8 +565,8 @@ export class Engine {
447
565
  *
448
566
  * # Errors
449
567
  *
450
- * Throws (to JavaScript) when `width` or `height` is not positive (or their product overflows), `pages`
451
- * is not 1 to 256, or the atlas texture cannot be created
568
+ * Throws (to JavaScript) when `width` or `height` is not positive or past the GPU's largest texture, or `pages`
569
+ * is not 1 to 256
452
570
  */
453
571
  setGlyphPages(width: number, height: number, pages: number): void;
454
572
  /**
@@ -456,23 +574,22 @@ export class Engine {
456
574
  */
457
575
  setGroundBounds(id: number, min_x: number, min_y: number, max_x: number, max_y: number): void;
458
576
  /**
459
- * Creates the texture of sampler `name` (`format`: r8, r8ui, r16ui, r16i, r32ui, r32f, rg16ui, rg32f, rgba8,
460
- * rgba8ui, rgba16ui, rgba32f; `depth` 0 for 2D, else a 2D array of that many layers; `linear` filtering for the
461
- * non-integer formats); `data`: its texels as bytes, or undefined for an empty texture
577
+ * Creates the texture `name` of a ground layer (`format`: r8, r8ui, r16ui, r16i, r32ui, r32f, rg16ui, rg32f,
578
+ * rgba8, rgba8ui, rgba16ui, rgba32f; `depth` 0 for 2D, else a 2D array of that many layers); `data`: its texels
579
+ * as bytes, or undefined for an empty texture
462
580
  *
463
581
  * # Errors
464
582
  *
465
- * Throws (to JavaScript) on an unknown `format`, a size not positive (or overflowing), `data` shorter
466
- * than the texels, more textures than the layer takes, or a texture WebGL cannot create
583
+ * Throws (to JavaScript) on an unknown `format`, a size of 0, `data` shorter than the texels, a name WGSL does not
584
+ * take, or more textures than the layer takes
467
585
  */
468
- setGroundTexture(id: number, name: string, format: string, width: number, height: number, depth: number, linear: boolean, data?: Uint8Array | null): void;
586
+ setGroundTexture(id: number, name: string, format: string, width: number, height: number, depth: number, data?: Uint8Array | null): void;
469
587
  /**
470
- * A uniform of a ground layer's code, as numbers
588
+ * A uniform of a ground layer's code, as numbers (column major for a matrix)
471
589
  *
472
590
  * # Errors
473
591
  *
474
- * Throws (to JavaScript) when the shader has no uniform `name` (one its code does not use is removed
475
- * by the compiler)
592
+ * Throws (to JavaScript) when no uniform `name` was declared, or for a count of numbers not its type's
476
593
  */
477
594
  setGroundUniform(id: number, name: string, values: Float64Array): void;
478
595
  /**
@@ -485,8 +602,7 @@ export class Engine {
485
602
  *
486
603
  * # Errors
487
604
  *
488
- * Throws (to JavaScript) when `width` or `height` is not positive (or their product overflows), or the
489
- * atlas texture cannot be created
605
+ * Throws (to JavaScript) when `width` or `height` is not positive or past the GPU's largest texture
490
606
  */
491
607
  setIconAtlas(width: number, height: number): void;
492
608
  /**
@@ -503,14 +619,28 @@ export class Engine {
503
619
  *
504
620
  * # Errors
505
621
  *
506
- * Throws (to JavaScript) when the lines need a table texture past the GPU's `MAX_TEXTURE_SIZE`, or
507
- * when it cannot be created; the layer then keeps its lines
622
+ * Throws (to JavaScript) when the lines need a table past the GPU's largest texture; the layer then keeps its
623
+ * lines
508
624
  */
509
625
  setLines(id: number, points: Float64Array, start: Uint32Array, feature: Uint32Array, heights?: Float64Array | null, sea?: boolean | null): void;
510
626
  /**
511
627
  * Highest pitch the camera accepts, degrees (up to 85)
512
628
  */
513
629
  setMaxPitch(max: number): void;
630
+ /**
631
+ * Lights at night the part of a model layer's model from `from` metres up (a street lamp's head) in `r, g, b`;
632
+ * `from` not a number: none
633
+ */
634
+ setModelGlow(id: number, from: number, r: number, g: number, b: number): void;
635
+ /**
636
+ * Highlights the feature `feature` of a model layer's model (an IFC model's element) in `r, g, b`; `feature` not a
637
+ * number: none
638
+ */
639
+ setModelHighlight(id: number, feature: number, r: number, g: number, b: number): void;
640
+ /**
641
+ * Replaces the instances of a model layer (as for `addModels`) and the reference of their altitudes
642
+ */
643
+ setModelInstances(id: number, instances: Float64Array, ground: boolean): void;
514
644
  /**
515
645
  * Costs of a network's edges (see `addNetwork`), when the way it is travelled changes; null: interpolated values
516
646
  */
@@ -533,12 +663,33 @@ export class Engine {
533
663
  * One value per node; negative = unreached
534
664
  */
535
665
  setNetworkValues(id: number, values: Float32Array): void;
666
+ /**
667
+ * The image of camera `index` of the panorama (the images sharing the size of the first), which the engine takes
668
+ * (closes once copied)
669
+ */
670
+ setPanoramaImage(index: number, image: ImageBitmap): void;
671
+ /**
672
+ * Shows a panorama: at `lon`, `lat` (degrees) and `height` (metres above the ellipsoid), turned by `rotation`
673
+ * (9 numbers, row-major: its frame to east, north, up), its `cameras` (25 numbers each: rotation from the panorama
674
+ * frame, row-major, 9; position in it, 3; focal x, y; center x, y; skew; image width, height; principal point of
675
+ * the distortion x, y; its coefficients r³, r⁵, r⁷; its limit, pixels), a backdrop sphere of `radius` metres, at
676
+ * `opacity`. Its images come after (`setPanoramaImage`)
677
+ *
678
+ * # Errors
679
+ *
680
+ * Throws (to JavaScript) when `rotation` holds fewer than 9 numbers
681
+ */
682
+ setPanorama(lon: number, lat: number, height: number, rotation: Float64Array, cameras: Float64Array, radius: number, opacity: number): void;
536
683
  /**
537
684
  * Sets the point the next turns and tilts go around (`rotate`): what is drawn under a screen point (CSS
538
- * pixels), a roof or a mesh as the relief. Read back from the last frame (a stall): once, where a drag starts.
539
- * Returns whether something was drawn there; over nothing, the turns go around the center
685
+ * pixels). Returns whether something was drawn there; over nothing, the turns go around the center
540
686
  */
541
687
  setPivot(x: number, y: number): boolean;
688
+ /**
689
+ * The style of a point cloud: 14 numbers (see `Style::parse`), the colors of the 256 classes (RGBA,
690
+ * alpha 0 hides a class) and the ramp of the altitudes (256 RGBA texels)
691
+ */
692
+ setPointCloudStyle(id: number, style: Float64Array, palette: Uint8Array, ramp: Uint8Array): void;
542
693
  /**
543
694
  * Opacity and saturation (0-1) of a raster layer; nothing for another id
544
695
  */
@@ -556,16 +707,11 @@ export class Engine {
556
707
  * The sun casting shadows and the night: its azimuth (degrees clockwise from north) and altitude (degrees above
557
708
  * the horizon), the shadows' opacity (0 to 1; none under the horizon or not a number), how dark the night is (0 to
558
709
  * 1: the frame tinted, the lights of the layers on). Neither shadows nor night: nothing drawn
559
- *
560
- * # Errors
561
- *
562
- * Throws (to JavaScript) when a WebGL object cannot be created or the pass fails to compile
563
710
  */
564
711
  setSun(azimuth: number, altitude: number, opacity: number, night: number): void;
565
712
  /**
566
- * Shows `layers` on one side of a vertical line only, the others beneath on the other side (comparing two states
567
- * of a place): left of `x` (CSS pixels from the left of the canvas), or right of it; `others` on the other side
568
- * only (two meshes of the same place, each on its side, never drawn over each other); a non-finite `x` stops
713
+ * Shows `layers` left of `x` (CSS pixels from the left of the canvas; right of it if `right`), `others` on the
714
+ * other side only; `x` not a number, or no layer: no swipe
569
715
  */
570
716
  setSwipe(x: number, right: boolean, layers: Uint32Array, others: Uint32Array): void;
571
717
  /**
@@ -581,51 +727,68 @@ export class Engine {
581
727
  *
582
728
  * # Errors
583
729
  *
584
- * Throws (to JavaScript) when the labels need a table texture past the GPU's `MAX_TEXTURE_SIZE`, or
585
- * when it cannot be created; the layer then keeps its labels
730
+ * Throws (to JavaScript) when the labels need a table past the GPU's largest texture; the layer then keeps its
731
+ * labels
586
732
  */
587
733
  setSymbols(id: number, anchors: Float64Array, boxes: Float32Array, styles: Float32Array, quads: Float32Array, paths: Float64Array): void;
588
734
  /**
589
735
  * Relief under the raster layers, from raw altitudes (`image/x-bil;bits=32`, 256 × 256, or the same followed by
590
736
  * the validity mask of an `ArcGIS` raw grid): `url` is a template with `{bbox}` (WMS `GetMap` in EPSG:3857, or in
591
737
  * the Mercator metres of another body) or `{z}/{x}/{y}`; `undefined` turns it off. `exaggeration` scales the
592
- * heights (1: true relief); `max_z`: finest level loaded (up to 15, from 6 on the Earth, coarser on bodies of a
593
- * larger relief for their size: `terrain_levels`); `geoid`: altitudes raised by the RAF20 geoid height (heights
594
- * above the ellipsoid, those of 3D Tiles; over France, on the Earth only), else left as served (the default);
595
- * `loader`: gives the
596
- * altitudes of each tile instead of fetching `url` (an encoding decoded by the page: Terrarium, Terrain-RGB)
597
- *
598
- * # Errors
599
- *
600
- * Throws (to JavaScript) when the texture holding the relief's tiles cannot be created
738
+ * heights (1: true relief); `max_z`: finest level loaded; `geoid`: altitudes raised by the RAF20 geoid height
739
+ * (heights above the ellipsoid, those of 3D Tiles; over France, on the Earth only), else left as served (the
740
+ * default); `loader`: gives the altitudes of each tile instead of fetching `url` (an encoding decoded by the
741
+ * page: Terrarium, Terrain-RGB)
601
742
  */
602
743
  setTerrain(url: string | null | undefined, exaggeration: number, max_z: number | null | undefined, geoid: boolean | null | undefined, loader: ((z: number, x: number, y: number, signal: AbortSignal) => Promise<Float32Array | null>) | undefined): void;
744
+ /**
745
+ * Pool of workers that fetch and decode 3D Tiles content off the main thread: an object with
746
+ * `load(id, url, transform, yUp, reload, priority) → Promise<{ anchor, primitives }>` and `abort(id)`. Without
747
+ * it, tiles are decoded on the main thread. Set it before adding 3D Tiles layers.
748
+ */
749
+ setTileLoader(loader: import('./isard_tiles3d.js').TileLoaderLike | null): void;
750
+ /**
751
+ * A raster layer draped on a 3D Tiles layer's roofs, or all its faces (`raster` undefined: none)
752
+ */
753
+ setTiles3dDrape(id: number, raster: number | null | undefined, all_faces: boolean, opacity: number): void;
754
+ /**
755
+ * Whether the walls of a 3D Tiles layer's untextured meshes show their windows: glass by day, some lit at night
756
+ */
757
+ setTiles3dFacades(id: number, facades: boolean): void;
758
+ /**
759
+ * Each feature of a 3D Tiles layer its color (null: the layer's)
760
+ */
761
+ setTiles3dFeatureColors(id: number, colors: ((properties: Record<string, unknown>[] | undefined, count: number) => Uint8Array) | null): void;
762
+ /**
763
+ * Screen-space error threshold, opacity, size of the points (CSS pixels, 2 if not given) and color (RGB 0-1, empty
764
+ * for none: it tints the textures and colors the untextured meshes) of a 3D Tiles layer
765
+ */
766
+ setTiles3dStyle(id: number, max_error: number, opacity: number, point_size: number | null | undefined, color: Float32Array): void;
603
767
  /**
604
768
  * The style layers of a vector tile layer, in drawing order: per layer, its kind (0 fill, 1 line, 2 extrusion, 3
605
- * circle), its zoom range
606
- * (two numbers: shown from the first, included, to the second, excluded), whether it shows (0 or 1), its dashes
607
- * (four numbers: dash, gap, dash, gap, in line widths; 0: solid), its opacity as zoom stops (four zooms then four
608
- * values; missing: opaque), the caps of its lines' ends (0 butt, 1 round, 2 square; missing: round), whether its
609
- * lines glow at night (streets; 0 or 1), the joins of its lines (two numbers: 0 round, 1 miter, 2 bevel, then the
610
- * miter limit in line widths; missing: round), the translation of its fills or lines (three numbers: x and y in CSS
611
- * pixels, x right and y down, then 0 if it turns with the map, 1 if it stays on the screen; missing: none), whether its
612
- * fills have patterns (0 or 1)
769
+ * circle), its zoom range (two numbers: shown from the first, included, to the second, excluded), whether it shows
770
+ * (0 or 1), its dashes (four numbers: dash, gap, dash, gap, in line widths; 0: solid), its opacity as zoom stops
771
+ * (four zooms then four values; missing: opaque), the caps of its lines' ends (0 butt, 1 round, 2 square; missing:
772
+ * round), whether its lines glow at night (streets; 0 or 1), the joins of its lines (two numbers: 0 round, 1
773
+ * miter, 2 bevel, then the miter limit in line widths; missing: round), the translation of its fills or lines
774
+ * (three numbers: x and y in CSS pixels, x right and y down, then 0 if it turns with the map, 1 if it stays on the
775
+ * screen; missing: none), whether its fills have patterns (0 or 1)
613
776
  */
614
777
  setVectorSublayers(id: number, kinds: Uint8Array, zooms: Float64Array, visible: Uint8Array, dashes: Float32Array, opacities: Float32Array, caps: Uint8Array, lit: Uint8Array, joins: Float32Array, translates: Float32Array, patterned: Uint8Array): void;
615
778
  /**
616
779
  * Adds or replaces tile `key` of a vector tile layer ready for the GPU, as the basemap workers make it (the
617
- * tessellation module): its polygons as for `setVectorTile` (picked here; their prisms built here if drawn in
618
- * relief while `prism` is false), the vertices of its fills (`shapes::Vertex` as bytes, each with its feature),
619
- * their triangles, per sublayer its top cap and the rest of its prism (`fill_ranges`: four numbers, first and
620
- * end of each), its line pieces (`pieces::Piece` as bytes), the line table (feature and length of each line),
780
+ * tessellation module): its polygons as for `setVectorTile` (their prisms built here if drawn in relief while
781
+ * `prism` is false), the vertices of its fills (`shapes::Vertex` as bytes, each with its feature), their
782
+ * triangles, per sublayer its top cap and the rest of its prism (`fill_ranges`: four numbers, first and end of
783
+ * each), its line pieces (`vector_tiles::TilePiece` as bytes), the line table (feature and length of each line),
621
784
  * per sublayer its pieces (`line_ranges`: first, end), the blocks of its extrusion sublayers (`shapes::Block` as
622
785
  * bytes), their triangles, per sublayer its blocks' triangles (`block_ranges`: first, end), the extent of its
623
786
  * points (`bounds`: min x, min y, max x, max y), its features' sublayers (one each, as for `setVectorTile`)
624
787
  *
625
788
  * # Errors
626
789
  *
627
- * Throws (to JavaScript) when the vertices, pieces or blocks are cut short, when a WebGL object of the tile cannot be
628
- * created, or when its features or lines need a table texture past the GPU's `MAX_TEXTURE_SIZE`
790
+ * Throws (to JavaScript) when the vertices, pieces or blocks are cut short, or when its features or lines need a
791
+ * table past the GPU's largest texture
629
792
  */
630
793
  setVectorTileMesh(id: number, key: number, points: Float64Array, ring_start: Uint32Array, polygon_start: Uint32Array, polygon_feature: Uint32Array, fill_start: Uint32Array, vertices: Uint8Array, indices: Uint32Array, fill_ranges: Uint32Array, prism: boolean, pieces: Uint8Array, line_table: Float32Array, line_ranges: Uint32Array, blocks: Uint8Array, block_indices: Uint32Array, block_ranges: Uint32Array, bounds: Float64Array, feature_sublayer: Uint16Array): void;
631
794
  /**
@@ -638,19 +801,16 @@ export class Engine {
638
801
  * Adds or replaces tile `key` of a vector tile layer: its polygons as for `addFills` (`fill_start`: the first
639
802
  * polygon of each sublayer, and the end; those of an extrusion sublayer raised into blocks), its lines as for
640
803
  * `addLines` (`line_start`: the first line of each sublayer, and the end), its features' sublayers (one each, the
641
- * features of a sublayer after those of the one before), styled as an
642
- * extrusion layer's (`setFeatureStyle` with the key: a color, then a line's width or a block's height and base);
643
- * `tile`: the corners of the tile they are cut to (west, north, east, south; empty: none), along whose edges no
644
- * wall of a block rises; `roofs` and `roof_heights`: per polygon, the shape and height of its block's roof
645
- * (`shapes::Roofs`: 0 flat, 1 to 5 `RoofShape::number`, 255 generated from its outline; metres, not a number: as
646
- * its slopes make it; empty: flat), the whole outlines of the buildings the tile cuts (`roof_outlines`, interleaved
647
- * Mercator points, `roof_outline_start`: where each polygon's starts, and the end), `roof_metres` the metres per
648
- * Mercator unit at the tile
804
+ * features of a sublayer after those of the one before), styled as an extrusion layer's (`setFeatureStyle` with
805
+ * the key); `tile`: the corners of the tile they are cut to (west, north, east, south; empty: none), along whose
806
+ * edges no wall of a block rises; `roofs` and `roof_heights`: per polygon, the shape and height of its block's
807
+ * roof (`shapes::Roofs`), the whole outlines of the buildings the tile cuts (`roof_outlines`, interleaved Mercator
808
+ * points, `roof_outline_start`: where each polygon's starts, and the end), `roof_metres` the metres per Mercator
809
+ * unit at the tile
649
810
  *
650
811
  * # Errors
651
812
  *
652
- * Throws (to JavaScript) when a WebGL object of the tile cannot be created, or when its features or lines need a
653
- * table texture past the GPU's `MAX_TEXTURE_SIZE`
813
+ * Throws (to JavaScript) when its features or lines need a table past the GPU's largest texture
654
814
  */
655
815
  setVectorTile(id: number, key: number, points: Float64Array, ring_start: Uint32Array, polygon_start: Uint32Array, polygon_feature: Uint32Array, fill_start: Uint32Array, line_points: Float64Array, line_first: Uint32Array, line_feature: Uint32Array, line_start: Uint32Array, feature_sublayer: Uint16Array, tile: Float64Array, roofs: Uint8Array, roof_heights: Float32Array, roof_outlines: Float64Array, roof_outline_start: Uint32Array, roof_metres: number): void;
656
816
  /**
@@ -659,11 +819,6 @@ export class Engine {
659
819
  * only heading, tilt, angles of view across and up (degrees), the heading NaN to look all around. What some
660
820
  * observer sees is tinted with `visible`, what is hidden from all those that reach it with `hidden` (RGB 0-1),
661
821
  * at `opacity`; `outline` (RGB 0-1, or empty) the color of the cones' edges drawn in 3D
662
- *
663
- * # Errors
664
- *
665
- * Throws (to JavaScript) when, on the first call, a WebGL object cannot be created or a shader fails to compile
666
- * (the error carries its info log)
667
822
  */
668
823
  setViewshed(observers: Float64Array, visible: Float32Array, hidden: Float32Array, opacity: number, outline: Float32Array): void;
669
824
  /**
@@ -681,16 +836,31 @@ export class Engine {
681
836
  stepFlow(id: number, seconds: number): boolean;
682
837
  /**
683
838
  * The height above the relief (metres) of the top of what stands at a position (degrees): a roof, a mesh, 0 on
684
- * the bare ground; undefined where nothing of the last frame is there. The scene is drawn from above into a single
685
- * pixel and read back (a stall, cheap: one pixel to fill)
839
+ * the bare ground; undefined where nothing of the last frame is there, or until measured: the scene is drawn
840
+ * looking down at it after a frame and read back a frame or two later (a frame is asked for), the answer kept and
841
+ * measured again every 250 ms at most
686
842
  */
687
843
  surfaceAt(lon: number, lat: number): any;
688
844
  /**
689
845
  * What is drawn under a screen point (CSS pixels): longitude, latitude and its height above the relief (metres),
690
- * on a roof, a wall or a mesh as on the ground; undefined where nothing was drawn. The scene is drawn again and
691
- * read back (a stall): for clicks and drags
846
+ * on a roof, a wall or a mesh as on the ground; undefined where nothing was drawn. From the last copy of the
847
+ * scene's depth (a frame or two old, one pixel in 4 CSS pixels): at once, without waiting for the GPU
692
848
  */
693
849
  surface(x: number, y: number): [lon: number, lat: number, height: number] | undefined;
850
+ /**
851
+ * Compressed texture formats of the GPU, for the KTX2 transcoding
852
+ */
853
+ textureFormats(): import('./isard_tiles3d.js').TextureFormats;
854
+ /**
855
+ * The feature of a picked handle (`pick`'s index on a 3D Tiles layer): `[properties, feature]`, its properties
856
+ * (undefined when its tile has none) and its index in its tile; undefined if the handle is not of the last picking
857
+ * pass
858
+ */
859
+ tiles3dFeature(id: number, index: number): [properties: Record<string, unknown> | undefined, feature: number] | undefined;
860
+ /**
861
+ * Counters of a 3D Tiles layer, undefined if there is none with this id
862
+ */
863
+ tiles3dStats(id: number): Tiles3dStats | undefined;
694
864
  /**
695
865
  * A region of the first page of the glyph atlas: `width` × `height` bytes at (`x`, `y`)
696
866
  */
@@ -704,24 +874,19 @@ export class Engine {
704
874
  *
705
875
  * # Errors
706
876
  *
707
- * Throws (to JavaScript) when there is no texture `name`, or when the region is out of its bounds or
708
- * `data` holds too few bytes
877
+ * Throws (to JavaScript) when there is no texture `name`, or when the region is out of its bounds or `data` holds
878
+ * too few bytes
709
879
  */
710
880
  updateGroundTexture(id: number, name: string, x: number, y: number, layer: number, width: number, height: number, data: Uint8Array): void;
711
881
  /**
712
882
  * A region of the icon atlas: `width` × `height` RGBA texels (premultiplied) at (`x`, `y`)
713
883
  */
714
884
  updateIconAtlas(x: number, y: number, width: number, height: number, data: Uint8Array): void;
715
- /**
716
- * Uploads a part more of the blocks of tile `key` of a vector tile layer (a large tile's, a part at a time over
717
- * several frames); whether some are left. Its blocks are drawn once they are all there
718
- */
719
- uploadVectorTile(id: number, key: number): boolean;
720
885
  /**
721
886
  * Vector tiles (512 CSS pixels across at their level, as `MapLibre`'s) for the view of the last frame (else the
722
887
  * camera's), levels `min_z` to `max_z`, three numbers per tile (z, x, y), the nearest to the eye first: what a
723
- * vector tile layer draws (`addVectorTiles`), coarser far away in a tilted view as the raster layers, and no
724
- * farther than `reach` times the screen center's distance (infinite: to the horizon)
888
+ * vector tile layer draws, coarser far away in a tilted view as the raster layers, and no farther than `reach`
889
+ * times the screen center's distance (infinite: to the horizon)
725
890
  */
726
891
  vectorTilesInView(min_z: number, max_z: number, reach: number): Uint32Array;
727
892
  /**
@@ -745,29 +910,38 @@ export interface InitOutput {
745
910
  readonly engine_addExtrusions: (a: number) => [number, number, number];
746
911
  readonly engine_addFills: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => [number, number, number];
747
912
  readonly engine_addFlow: (a: number, b: number, c: number) => [number, number, number];
748
- readonly engine_addGround: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number, number];
913
+ readonly engine_addGround: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => [number, number, number];
749
914
  readonly engine_addLines: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => [number, number, number];
915
+ readonly engine_addModels: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
750
916
  readonly engine_addNetwork: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => [number, number, number];
751
- readonly engine_addRaster: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => [number, number, number];
917
+ readonly engine_addPointCloud: (a: number, b: number, c: number, d: any) => number;
918
+ readonly engine_addRaster: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => number;
752
919
  readonly engine_addSymbols: (a: number) => [number, number, number];
920
+ readonly engine_addTiles3d: (a: number, b: number, c: number, d: number, e: number) => number;
753
921
  readonly engine_addVectorTiles: (a: number) => [number, number, number];
922
+ readonly engine_backend: (a: number) => [number, number];
754
923
  readonly engine_bounds: (a: number) => [number, number];
755
924
  readonly engine_camera: (a: number) => any;
925
+ readonly engine_clearPanorama: (a: number) => void;
756
926
  readonly engine_clearPivot: (a: number) => void;
757
927
  readonly engine_clearPreload: (a: number) => void;
758
928
  readonly engine_clearViewshed: (a: number) => void;
929
+ readonly engine_create: (a: any, b: any, c: number) => any;
759
930
  readonly engine_customMatrix: (a: number, b: number, c: number) => [number, number];
760
931
  readonly engine_elevationAt: (a: number, b: number, c: number) => [number, number];
761
932
  readonly engine_geoidHeight: (a: number, b: number) => number;
933
+ readonly engine_gpuDevice: (a: number) => any;
762
934
  readonly engine_ground: (a: number, b: number, c: number) => any;
763
935
  readonly engine_linkExtrusionNetwork: (a: number, b: number, c: number, d: number) => void;
764
936
  readonly engine_localMatrix: (a: number, b: number, c: number, d: number) => [number, number];
937
+ readonly engine_maxTextureSize: (a: number) => number;
765
938
  readonly engine_moveLayer: (a: number, b: number, c: number) => void;
766
939
  readonly engine_networkStats: (a: number, b: number) => any;
767
- readonly engine_new: (a: any, b: any, c: number) => [number, number, number];
768
940
  readonly engine_pan: (a: number, b: number, c: number, d: number, e: number) => void;
769
- readonly engine_pick: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => any;
770
- readonly engine_pollPick: (a: number) => any;
941
+ readonly engine_pointCloudInfo: (a: number, b: number) => any;
942
+ readonly engine_pointCloudPoint: (a: number, b: number, c: number) => any;
943
+ readonly engine_pointCloudStats: (a: number, b: number) => any;
944
+ readonly engine_pollPick: (a: number, b: number) => any;
771
945
  readonly engine_preload: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
772
946
  readonly engine_project: (a: number, b: number, c: number, d: number, e: number) => any;
773
947
  readonly engine_promoteFlowNext: (a: number, b: number) => void;
@@ -804,7 +978,7 @@ export interface InitOutput {
804
978
  readonly engine_setGlyphAtlas: (a: number, b: number, c: number, d: number, e: number) => [number, number];
805
979
  readonly engine_setGlyphPages: (a: number, b: number, c: number, d: number) => [number, number];
806
980
  readonly engine_setGroundBounds: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
807
- readonly engine_setGroundTexture: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => [number, number];
981
+ readonly engine_setGroundTexture: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => [number, number];
808
982
  readonly engine_setGroundUniform: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
809
983
  readonly engine_setGroundVisible: (a: number, b: number, c: number) => void;
810
984
  readonly engine_setIconAtlas: (a: number, b: number, c: number) => [number, number];
@@ -812,40 +986,57 @@ export interface InitOutput {
812
986
  readonly engine_setLineDash: (a: number, b: number, c: number, d: number) => void;
813
987
  readonly engine_setLines: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => [number, number];
814
988
  readonly engine_setMaxPitch: (a: number, b: number) => void;
989
+ readonly engine_setModelGlow: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
990
+ readonly engine_setModelHighlight: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
991
+ readonly engine_setModelInstances: (a: number, b: number, c: number, d: number, e: number) => void;
815
992
  readonly engine_setNetworkCosts: (a: number, b: number, c: number, d: number) => void;
816
993
  readonly engine_setNetworkRamp: (a: number, b: number, c: number, d: number) => void;
817
994
  readonly engine_setNetworkScales: (a: number, b: number, c: number, d: number) => void;
818
995
  readonly engine_setNetworkStyle: (a: number, b: number, c: number, d: number) => void;
819
996
  readonly engine_setNetworkValues: (a: number, b: number, c: number, d: number) => void;
997
+ readonly engine_setPanorama: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => [number, number];
998
+ readonly engine_setPanoramaImage: (a: number, b: number, c: any) => void;
820
999
  readonly engine_setPivot: (a: number, b: number, c: number) => number;
1000
+ readonly engine_setPointCloudStyle: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
821
1001
  readonly engine_setRasterStyle: (a: number, b: number, c: number, d: number) => void;
822
1002
  readonly engine_setRequestHeaders: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
823
1003
  readonly engine_setSky: (a: number, b: number) => void;
824
- readonly engine_setSun: (a: number, b: number, c: number, d: number, e: number) => [number, number];
1004
+ readonly engine_setSun: (a: number, b: number, c: number, d: number, e: number) => void;
825
1005
  readonly engine_setSwipe: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
826
1006
  readonly engine_setSymbolLayer: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
827
1007
  readonly engine_setSymbols: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => [number, number];
828
- readonly engine_setTerrain: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number];
1008
+ readonly engine_setTerrain: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
1009
+ readonly engine_setTileLoader: (a: number, b: any) => void;
1010
+ readonly engine_setTiles3dDrape: (a: number, b: number, c: number, d: number, e: number) => void;
1011
+ readonly engine_setTiles3dFacades: (a: number, b: number, c: number) => void;
1012
+ readonly engine_setTiles3dFeatureColors: (a: number, b: number, c: any) => void;
1013
+ readonly engine_setTiles3dStyle: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
829
1014
  readonly engine_setVectorSublayers: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number) => void;
830
1015
  readonly engine_setVectorTile: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number, c1: number, d1: number, e1: number, f1: number, g1: number, h1: number) => [number, number];
831
1016
  readonly engine_setVectorTileMesh: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number, c1: number, d1: number, e1: number, f1: number, g1: number, h1: number, i1: number, j1: number) => [number, number];
832
1017
  readonly engine_setVectorTilePoints: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
833
- readonly engine_setViewshed: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => [number, number];
1018
+ readonly engine_setViewshed: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
834
1019
  readonly engine_setZoomRange: (a: number, b: number, c: number) => void;
835
1020
  readonly engine_stats: (a: number) => any;
836
1021
  readonly engine_stepFlow: (a: number, b: number, c: number) => number;
837
1022
  readonly engine_surface: (a: number, b: number, c: number) => any;
838
1023
  readonly engine_surfaceAt: (a: number, b: number, c: number) => any;
1024
+ readonly engine_textureFormats: (a: number) => any;
1025
+ readonly engine_tiles3dFeature: (a: number, b: number, c: number) => any;
1026
+ readonly engine_tiles3dStats: (a: number, b: number) => any;
839
1027
  readonly engine_updateGlyphAtlas: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
840
1028
  readonly engine_updateGlyphPage: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
841
1029
  readonly engine_updateGroundTexture: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => [number, number];
842
1030
  readonly engine_updateIconAtlas: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
843
- readonly engine_uploadVectorTile: (a: number, b: number, c: number) => number;
844
1031
  readonly engine_vectorTilesInView: (a: number, b: number, c: number, d: number) => [number, number];
845
1032
  readonly engine_wantedTiles: (a: number, b: number) => [number, number];
846
1033
  readonly engine_zoomAt: (a: number, b: number, c: number, d: number) => void;
847
- readonly wasm_bindgen_2e566c63402fe7fa___convert__closures_____invoke___js_sys_b1e1c29ba6b0e6b3___Function_fn_wasm_bindgen_2e566c63402fe7fa___JsValue_____wasm_bindgen_2e566c63402fe7fa___sys__Undefined___js_sys_b1e1c29ba6b0e6b3___Function_fn_wasm_bindgen_2e566c63402fe7fa___JsValue_____wasm_bindgen_2e566c63402fe7fa___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
848
- readonly wasm_bindgen_2e566c63402fe7fa___convert__closures_____invoke___wasm_bindgen_2e566c63402fe7fa___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_2e566c63402fe7fa___JsError___true_: (a: number, b: number, c: any) => [number, number];
1034
+ readonly wasm_bindgen_4346cdda5a9d72ac___convert__closures_____invoke___js_sys_5e75a17f0680aa0e___Function_fn_wasm_bindgen_4346cdda5a9d72ac___JsValue_____wasm_bindgen_4346cdda5a9d72ac___sys__Undefined___js_sys_5e75a17f0680aa0e___Function_fn_wasm_bindgen_4346cdda5a9d72ac___JsValue_____wasm_bindgen_4346cdda5a9d72ac___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
1035
+ readonly wasm_bindgen_4346cdda5a9d72ac___convert__closures_____invoke___wasm_bindgen_4346cdda5a9d72ac___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_4346cdda5a9d72ac___JsError___true_: (a: number, b: number, c: any) => [number, number];
1036
+ readonly wasm_bindgen_4346cdda5a9d72ac___convert__closures_____invoke___wasm_bindgen_4346cdda5a9d72ac___sys__JsNullable_wgpu_ce7204c20056c03e___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_4346cdda5a9d72ac___JsError___true_: (a: number, b: number, c: any) => [number, number];
1037
+ readonly wasm_bindgen_4346cdda5a9d72ac___convert__closures_____invoke___wasm_bindgen_4346cdda5a9d72ac___sys__JsNullable_wgpu_ce7204c20056c03e___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_4346cdda5a9d72ac___JsError___true__130: (a: number, b: number, c: any) => [number, number];
1038
+ readonly wasm_bindgen_4346cdda5a9d72ac___convert__closures_____invoke___wasm_bindgen_4346cdda5a9d72ac___sys__JsNullable_wgpu_ce7204c20056c03e___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_4346cdda5a9d72ac___JsError___true__131: (a: number, b: number, c: any) => [number, number];
1039
+ readonly wasm_bindgen_4346cdda5a9d72ac___convert__closures_____invoke___wgpu_ce7204c20056c03e___backend__webgpu__webgpu_sys__gen_GpuDeviceLostInfo__GpuDeviceLostInfo______true_: (a: number, b: number, c: any) => void;
849
1040
  readonly __wbindgen_malloc: (a: number, b: number) => number;
850
1041
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
851
1042
  readonly __wbindgen_exn_store: (a: number) => void;