isard 0.4.0 → 0.5.1

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 (44) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/README.md +6 -2
  3. package/dist/decoder.worker.js +4 -4
  4. package/dist/decoder.worker.js.map +7 -6
  5. package/dist/decoders.d.ts +3 -2
  6. package/dist/decoders.js +28 -5
  7. package/dist/decoders.js.map +1 -1
  8. package/dist/engine-loader.d.ts +6 -3
  9. package/dist/engine-loader.js +10 -3
  10. package/dist/engine-loader.js.map +1 -1
  11. package/dist/formats.d.ts +11 -0
  12. package/dist/formats.js +12 -0
  13. package/dist/formats.js.map +1 -0
  14. package/dist/index.d.ts +3 -1
  15. package/dist/index.js +1 -0
  16. package/dist/index.js.map +1 -1
  17. package/dist/isard_bg.wasm +0 -0
  18. package/dist/isard_core_bg.wasm +0 -0
  19. package/dist/isard_points_bg.wasm +0 -0
  20. package/dist/layers.js +2 -2
  21. package/dist/layers.js.map +1 -1
  22. package/dist/loader.d.ts +9 -3
  23. package/dist/loader.js +22 -3
  24. package/dist/loader.js.map +1 -1
  25. package/dist/map.d.ts +8 -0
  26. package/dist/map.js +10 -2
  27. package/dist/map.js.map +1 -1
  28. package/dist/pointclouds.d.ts +98 -0
  29. package/dist/pointclouds.js +232 -0
  30. package/dist/pointclouds.js.map +1 -0
  31. package/dist/projections.d.ts +13 -0
  32. package/dist/projections.js +13 -0
  33. package/dist/projections.js.map +1 -0
  34. package/dist/protocol.d.ts +17 -0
  35. package/dist/protocol.js.map +1 -1
  36. package/dist/types.d.ts +8 -2
  37. package/dist/types.js.map +1 -1
  38. package/dist/wasm/isard.d.ts +124 -12
  39. package/dist/wasm/isard.js +127 -8
  40. package/dist/wasm/isard_core.d.ts +0 -3
  41. package/dist/wasm/isard_core.js +0 -1
  42. package/dist/wasm/isard_points.d.ts +43 -0
  43. package/dist/wasm/isard_points.js +212 -0
  44. package/package.json +17 -1
@@ -19,6 +19,8 @@ export interface EncodedTile {
19
19
  /** ECEF origin of the vertices (metres) */
20
20
  anchor: Float64Array<ArrayBuffer>;
21
21
  primitives: EncodedPrimitive[];
22
+ /** Its points (`.pnts`, glTF points), 20 bytes a vertex: x, y, z (f32) around the anchor, RGB, a normal */
23
+ points: Uint8Array<ArrayBuffer>[];
22
24
  }
23
25
 
24
26
  /** A texture transcoded for the GPU (KTX2 / Basis Universal): a WebGL internal format and its mip levels */
@@ -41,7 +43,10 @@ export interface DecodedPrimitive {
41
43
  color?: Float32Array<ArrayBuffer>;
42
44
  }
43
45
 
44
- /** A Draco-compressed primitive of a tile (`KHR_draco_mesh_compression`), to decode with the Draco module */
46
+ /**
47
+ * A Draco-compressed primitive of a tile (`KHR_draco_mesh_compression`), or its points
48
+ * (`3DTILES_draco_point_compression`), to decode with the Draco module
49
+ */
45
50
  export interface DracoRequest {
46
51
  mesh: number;
47
52
  primitive: number;
@@ -49,15 +54,21 @@ export interface DracoRequest {
49
54
  /** Draco attribute ids */
50
55
  position: number;
51
56
  uv?: number;
57
+ color?: number;
58
+ normal?: number;
59
+ /** A point cloud: no triangles */
60
+ points?: boolean;
52
61
  }
53
62
 
54
- /** The Draco module's output for a request: positions and uv as stored, triangles */
63
+ /** The Draco module's output for a request: positions, uv, colors and normals as stored, triangles (not for points) */
55
64
  export interface DracoGeometry {
56
65
  mesh: number;
57
66
  primitive: number;
58
67
  positions: Float32Array;
59
68
  uvs?: Float32Array;
60
- indices: Uint32Array;
69
+ indices?: Uint32Array;
70
+ colors?: Float32Array;
71
+ normals?: Float32Array;
61
72
  }
62
73
 
63
74
  /** Compressed texture formats supported by the GPU */
@@ -72,6 +83,8 @@ export interface TextureFormats {
72
83
  export interface DecodedTile {
73
84
  anchor: Float64Array<ArrayBuffer>;
74
85
  primitives: DecodedPrimitive[];
86
+ /** Its points' vertices (`EncodedTile.points`) */
87
+ points?: Uint8Array<ArrayBuffer>[];
75
88
  }
76
89
 
77
90
  /** What the engine expects from a pool of decoding workers (`Engine.setTileLoader`) */
@@ -89,6 +102,22 @@ export interface TileLoaderLike {
89
102
  priority?: 'high' | 'low',
90
103
  ): Promise<DecodedTile>;
91
104
  abort(id: number): void;
105
+ /**
106
+ * The points of a COPC node: its LAZ chunk (`size` bytes at `offset` of the file at `url`, a range request), the
107
+ * data of the file's LAZ VLR, its layout (format, record length, scale, offset), the grid positioning its points
108
+ * and its point count; resolves with its vertices (20 bytes each, see `EncodedTile.points`)
109
+ */
110
+ loadPoints?(
111
+ id: number,
112
+ url: string,
113
+ offset: number,
114
+ size: number,
115
+ laz: Uint8Array,
116
+ layout: Float64Array,
117
+ grid: Float64Array,
118
+ count: number,
119
+ priority?: 'high' | 'low',
120
+ ): Promise<Uint8Array<ArrayBuffer>>;
92
121
  }
93
122
 
94
123
 
@@ -150,6 +179,63 @@ export interface Tiles3dStats {
150
179
 
151
180
 
152
181
 
182
+ /** Counters of a point cloud layer */
183
+ export interface PointCloudStats {
184
+ /** Points drawn in the last frame */
185
+ points: number;
186
+ /** Nodes drawn in the last frame */
187
+ nodes: number;
188
+ /** Nodes held on the GPU */
189
+ loaded: number;
190
+ /** Downloads under way */
191
+ inFlight: number;
192
+ /** GPU memory of the points, MB */
193
+ gpuMb: number;
194
+ /** Nodes known in the hierarchy (its pages loaded so far) */
195
+ known: number;
196
+ }
197
+
198
+ /** What a point cloud says of itself once its head is read */
199
+ export interface PointCloudInfo {
200
+ /** Points in the file */
201
+ points: number;
202
+ /** LAS point format (6 to 8: 7 and 8 with colors) */
203
+ format: number;
204
+ /** The WKT of its CRS, if the file has one */
205
+ wkt?: string;
206
+ /** The center of its cube: longitude, latitude */
207
+ center: [lon: number, lat: number];
208
+ /** Its altitudes, lowest and highest (metres) */
209
+ altitudes: [min: number, max: number];
210
+ }
211
+
212
+ /** A point picked in a point cloud */
213
+ export interface PointCloudPoint {
214
+ lonLat: [lon: number, lat: number];
215
+ /** Metres above the ellipsoid */
216
+ height: number;
217
+ /** Its z in the file's vertical datum (metres) */
218
+ altitude: number;
219
+ classification: number;
220
+ intensity: number;
221
+ returnNumber: number;
222
+ numberOfReturns: number;
223
+ /** 8-bit color, files with colors only */
224
+ rgb?: [r: number, g: number, b: number];
225
+ }
226
+
227
+ /** The CRS of a point cloud, as the page resolves it from the file's WKT (`addPointCloud`) */
228
+ export interface PointCloudCrs {
229
+ /** x, y pairs of the CRS to longitudes, latitudes (degrees) */
230
+ inverse(xy: Float64Array): Float64Array;
231
+ /** The altitudes are above the geoid (IGN69): raised by the RAF20 geoid height */
232
+ geoid: boolean;
233
+ /** Metres of a unit of z */
234
+ verticalScale: number;
235
+ }
236
+
237
+
238
+
153
239
  /** Pieces of a network layer: its edges cut along their lines, sorted by square; only the squares in view are drawn */
154
240
  export interface NetworkStats {
155
241
  pieces: number;
@@ -219,6 +305,12 @@ export class Engine {
219
305
  * cost of travelling it from A to B then from B to A; without, values are interpolated along the edges.
220
306
  */
221
307
  addNetwork(mercator: Float64Array, edges: Uint32Array, line_start: Uint32Array | null | undefined, line_points: Float64Array | null | undefined, costs: Float32Array | null | undefined, style: Float32Array): number;
308
+ /**
309
+ * A COPC point cloud from its URL (HTTP range requests). `resolve(wkt)` gives the CRS of the file from its WKT
310
+ * (undefined if it has none): its inverse projection, whether its altitudes are above the geoid, the metres of
311
+ * a unit of z; it may throw (an unknown CRS), the layer then stays empty
312
+ */
313
+ addPointCloud(url: string, resolve: (wkt: string | undefined) => PointCloudCrs): number;
222
314
  /**
223
315
  * Raster tiles in Web Mercator; `url` holds {z}, {x} and {y}. `size`: side of the tiles' textures (256 by
224
316
  * default); `loader`: draws each tile instead of fetching `url`, `(z, x, y, signal) => Promise<ImageBitmap |
@@ -282,6 +374,19 @@ export class Engine {
282
374
  * Reads the pixels back at once (the GPU finishes its work first): for clicks; `requestPick` for the hover
283
375
  */
284
376
  pick(x: number, y: number, radius?: number | null, only?: Uint32Array | null): PickHit | undefined;
377
+ /**
378
+ * What a point cloud says of itself, undefined before its head is read
379
+ */
380
+ pointCloudInfo(id: number): PointCloudInfo | undefined;
381
+ /**
382
+ * The point of a point cloud picked by `pick` or `pollPick` (its index there), read back from the GPU; undefined
383
+ * once it is no longer drawn
384
+ */
385
+ pointCloudPoint(id: number, index: number): PointCloudPoint | undefined;
386
+ /**
387
+ * Counters of a point cloud layer, undefined if there is none with this id
388
+ */
389
+ pointCloudStats(id: number): PointCloudStats | undefined;
285
390
  /**
286
391
  * The answer to the last `requestPick` once the GPU has delivered it (then forgotten), undefined while it is not
287
392
  * there yet (or nothing was asked, or the context was lost)
@@ -297,9 +402,6 @@ export class Engine {
297
402
  project(lon: number, lat: number): [x: number, y: number] | undefined;
298
403
  removeExtrusionBatch(id: number, key: number): void;
299
404
  removeLayer(id: number): void;
300
- /**
301
- * Draws a frame; returns true while tiles are still loading (a new frame will be asked through `redraw`)
302
- */
303
405
  render(): boolean;
304
406
  /**
305
407
  * Asks what is under a screen point without waiting for the GPU (as `pick`, with the position there): the
@@ -454,6 +556,11 @@ export class Engine {
454
556
  * One value per node; negative = unreached
455
557
  */
456
558
  setNetworkValues(id: number, values: Float32Array): void;
559
+ /**
560
+ * The style of a point cloud: 14 numbers (see `Style::parse`), the colors of the 256 classes (RGBA,
561
+ * alpha 0 hides a class) and the ramp of the altitudes (256 RGBA texels)
562
+ */
563
+ setPointCloudStyle(id: number, style: Float64Array, palette: Uint8Array, ramp: Uint8Array): void;
457
564
  setRasterStyle(id: number, opacity: number, saturation: number): void;
458
565
  /**
459
566
  * Space behind the globe (stars, atmosphere halo), in the globe projection
@@ -488,9 +595,9 @@ export class Engine {
488
595
  */
489
596
  setTileLoader(loader: TileLoaderLike | null): void;
490
597
  /**
491
- * Screen-space error threshold and opacity of a 3D Tiles layer
598
+ * Screen-space error threshold, opacity and size of the points (CSS pixels, 2 if not given) of a 3D Tiles layer
492
599
  */
493
- setTiles3dStyle(id: number, max_error: number, opacity: number): void;
600
+ setTiles3dStyle(id: number, max_error: number, opacity: number, point_size?: number | null): void;
494
601
  setZoomRange(min: number, max: number): void;
495
602
  /**
496
603
  * Tile counters of the raster layers, for diagnostics
@@ -524,9 +631,9 @@ export class Engine {
524
631
  }
525
632
 
526
633
  /**
527
- * Decodes a `.b3dm` / `.glb` tile: `{ anchor: Float64Array(3), primitives: [{ vertices: Float32Array (x, y, z, u,
528
- * v per vertex, relative to the anchor), indices: Uint32Array, image?: Uint8Array, mime?: string, color?:
529
- * Float32Array (the material's base color, when not white) }] }`.
634
+ * Decodes a `.b3dm` / `.pnts` / `.glb` tile: `{ anchor: Float64Array(3), primitives: [{ vertices: Float32Array (x,
635
+ * y, z, u, v per vertex, relative to the anchor), indices: Uint32Array, image?: Uint8Array, mime?: string, color?:
636
+ * Float32Array (the material's base color, when not white) }], points: [Uint8Array] (the points' vertices) }`.
530
637
  * `transform`: the tile's world transform (16 numbers, column-major).
531
638
  * `draco`: the decoded geometries of its Draco primitives (`dracoRequests`), if any.
532
639
  */
@@ -552,6 +659,7 @@ export interface InitOutput {
552
659
  readonly engine_addLines: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number];
553
660
  readonly engine_addModels: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
554
661
  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];
662
+ readonly engine_addPointCloud: (a: number, b: number, c: number, d: any) => [number, number, number];
555
663
  readonly engine_addRaster: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number, number];
556
664
  readonly engine_addSymbols: (a: number) => [number, number, number];
557
665
  readonly engine_addTiles3d: (a: number, b: number, c: number, d: number) => [number, number, number];
@@ -566,6 +674,9 @@ export interface InitOutput {
566
674
  readonly engine_new: (a: any, b: any) => [number, number, number];
567
675
  readonly engine_pan: (a: number, b: number, c: number, d: number, e: number) => void;
568
676
  readonly engine_pick: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => any;
677
+ readonly engine_pointCloudInfo: (a: number, b: number) => any;
678
+ readonly engine_pointCloudPoint: (a: number, b: number, c: number) => any;
679
+ readonly engine_pointCloudStats: (a: number, b: number) => any;
569
680
  readonly engine_pollPick: (a: number) => any;
570
681
  readonly engine_preload: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
571
682
  readonly engine_project: (a: number, b: number, c: number) => any;
@@ -608,13 +719,14 @@ export interface InitOutput {
608
719
  readonly engine_setNetworkScales: (a: number, b: number, c: number, d: number) => void;
609
720
  readonly engine_setNetworkStyle: (a: number, b: number, c: number, d: number) => void;
610
721
  readonly engine_setNetworkValues: (a: number, b: number, c: number, d: number) => void;
722
+ readonly engine_setPointCloudStyle: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
611
723
  readonly engine_setRasterStyle: (a: number, b: number, c: number, d: number) => void;
612
724
  readonly engine_setSky: (a: number, b: number) => void;
613
725
  readonly engine_setSymbolLayer: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
614
726
  readonly engine_setSymbols: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => [number, number];
615
727
  readonly engine_setTerrain: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number];
616
728
  readonly engine_setTileLoader: (a: number, b: any) => void;
617
- readonly engine_setTiles3dStyle: (a: number, b: number, c: number, d: number) => void;
729
+ readonly engine_setTiles3dStyle: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
618
730
  readonly engine_setZoomRange: (a: number, b: number, c: number) => void;
619
731
  readonly engine_stats: (a: number) => any;
620
732
  readonly engine_textureFormats: (a: number) => any;
@@ -175,6 +175,23 @@ export class Engine {
175
175
  }
176
176
  return ret[0] >>> 0;
177
177
  }
178
+ /**
179
+ * A COPC point cloud from its URL (HTTP range requests). `resolve(wkt)` gives the CRS of the file from its WKT
180
+ * (undefined if it has none): its inverse projection, whether its altitudes are above the geoid, the metres of
181
+ * a unit of z; it may throw (an unknown CRS), the layer then stays empty
182
+ * @param {string} url
183
+ * @param {(wkt: string | undefined) => PointCloudCrs} resolve
184
+ * @returns {number}
185
+ */
186
+ addPointCloud(url, resolve) {
187
+ const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
188
+ const len0 = WASM_VECTOR_LEN;
189
+ const ret = wasm.engine_addPointCloud(this.__wbg_ptr, ptr0, len0, resolve);
190
+ if (ret[2]) {
191
+ throw takeFromExternrefTable0(ret[1]);
192
+ }
193
+ return ret[0] >>> 0;
194
+ }
178
195
  /**
179
196
  * Raster tiles in Web Mercator; `url` holds {z}, {x} and {y}. `size`: side of the tiles' textures (256 by
180
197
  * default); `loader`: draws each tile instead of fetching `url`, `(z, x, y, signal) => Promise<ImageBitmap |
@@ -344,6 +361,35 @@ export class Engine {
344
361
  const ret = wasm.engine_pick(this.__wbg_ptr, x, y, !isLikeNone(radius), isLikeNone(radius) ? 0 : radius, ptr0, len0);
345
362
  return ret;
346
363
  }
364
+ /**
365
+ * What a point cloud says of itself, undefined before its head is read
366
+ * @param {number} id
367
+ * @returns {PointCloudInfo | undefined}
368
+ */
369
+ pointCloudInfo(id) {
370
+ const ret = wasm.engine_pointCloudInfo(this.__wbg_ptr, id);
371
+ return ret;
372
+ }
373
+ /**
374
+ * The point of a point cloud picked by `pick` or `pollPick` (its index there), read back from the GPU; undefined
375
+ * once it is no longer drawn
376
+ * @param {number} id
377
+ * @param {number} index
378
+ * @returns {PointCloudPoint | undefined}
379
+ */
380
+ pointCloudPoint(id, index) {
381
+ const ret = wasm.engine_pointCloudPoint(this.__wbg_ptr, id, index);
382
+ return ret;
383
+ }
384
+ /**
385
+ * Counters of a point cloud layer, undefined if there is none with this id
386
+ * @param {number} id
387
+ * @returns {PointCloudStats | undefined}
388
+ */
389
+ pointCloudStats(id) {
390
+ const ret = wasm.engine_pointCloudStats(this.__wbg_ptr, id);
391
+ return ret;
392
+ }
347
393
  /**
348
394
  * The answer to the last `requestPick` once the GPU has delivered it (then forgotten), undefined while it is not
349
395
  * there yet (or nothing was asked, or the context was lost)
@@ -388,7 +434,6 @@ export class Engine {
388
434
  wasm.engine_removeLayer(this.__wbg_ptr, id);
389
435
  }
390
436
  /**
391
- * Draws a frame; returns true while tiles are still loading (a new frame will be asked through `redraw`)
392
437
  * @returns {boolean}
393
438
  */
394
439
  render() {
@@ -835,6 +880,23 @@ export class Engine {
835
880
  const len0 = WASM_VECTOR_LEN;
836
881
  wasm.engine_setNetworkValues(this.__wbg_ptr, id, ptr0, len0);
837
882
  }
883
+ /**
884
+ * The style of a point cloud: 14 numbers (see `Style::parse`), the colors of the 256 classes (RGBA,
885
+ * alpha 0 hides a class) and the ramp of the altitudes (256 RGBA texels)
886
+ * @param {number} id
887
+ * @param {Float64Array} style
888
+ * @param {Uint8Array} palette
889
+ * @param {Uint8Array} ramp
890
+ */
891
+ setPointCloudStyle(id, style, palette, ramp) {
892
+ const ptr0 = passArrayF64ToWasm0(style, wasm.__wbindgen_malloc);
893
+ const len0 = WASM_VECTOR_LEN;
894
+ const ptr1 = passArray8ToWasm0(palette, wasm.__wbindgen_malloc);
895
+ const len1 = WASM_VECTOR_LEN;
896
+ const ptr2 = passArray8ToWasm0(ramp, wasm.__wbindgen_malloc);
897
+ const len2 = WASM_VECTOR_LEN;
898
+ wasm.engine_setPointCloudStyle(this.__wbg_ptr, id, ptr0, len0, ptr1, len1, ptr2, len2);
899
+ }
838
900
  /**
839
901
  * @param {number} id
840
902
  * @param {number} opacity
@@ -924,13 +986,14 @@ export class Engine {
924
986
  wasm.engine_setTileLoader(this.__wbg_ptr, loader);
925
987
  }
926
988
  /**
927
- * Screen-space error threshold and opacity of a 3D Tiles layer
989
+ * Screen-space error threshold, opacity and size of the points (CSS pixels, 2 if not given) of a 3D Tiles layer
928
990
  * @param {number} id
929
991
  * @param {number} max_error
930
992
  * @param {number} opacity
993
+ * @param {number | null} [point_size]
931
994
  */
932
- setTiles3dStyle(id, max_error, opacity) {
933
- wasm.engine_setTiles3dStyle(this.__wbg_ptr, id, max_error, opacity);
995
+ setTiles3dStyle(id, max_error, opacity, point_size) {
996
+ wasm.engine_setTiles3dStyle(this.__wbg_ptr, id, max_error, opacity, !isLikeNone(point_size), isLikeNone(point_size) ? 0 : point_size);
934
997
  }
935
998
  /**
936
999
  * @param {number} min
@@ -1037,9 +1100,9 @@ export class Engine {
1037
1100
  if (Symbol.dispose) Engine.prototype[Symbol.dispose] = Engine.prototype.free;
1038
1101
 
1039
1102
  /**
1040
- * Decodes a `.b3dm` / `.glb` tile: `{ anchor: Float64Array(3), primitives: [{ vertices: Float32Array (x, y, z, u,
1041
- * v per vertex, relative to the anchor), indices: Uint32Array, image?: Uint8Array, mime?: string, color?:
1042
- * Float32Array (the material's base color, when not white) }] }`.
1103
+ * Decodes a `.b3dm` / `.pnts` / `.glb` tile: `{ anchor: Float64Array(3), primitives: [{ vertices: Float32Array (x,
1104
+ * y, z, u, v per vertex, relative to the anchor), indices: Uint32Array, image?: Uint8Array, mime?: string, color?:
1105
+ * Float32Array (the material's base color, when not white) }], points: [Uint8Array] (the points' vertices) }`.
1043
1106
  * `transform`: the tile's world transform (16 numbers, column-major).
1044
1107
  * `draco`: the decoded geometries of its Draco primitives (`dracoRequests`), if any.
1045
1108
  * @param {Uint8Array} bytes
@@ -1089,6 +1152,10 @@ function __wbg_get_imports() {
1089
1152
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1090
1153
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1091
1154
  },
1155
+ __wbg___wbindgen_is_falsy_16bd49b68658263e: function(arg0) {
1156
+ const ret = !arg0;
1157
+ return ret;
1158
+ },
1092
1159
  __wbg___wbindgen_is_function_1f9d30630b8b1d3d: function(arg0) {
1093
1160
  const ret = typeof(arg0) === 'function';
1094
1161
  return ret;
@@ -1251,6 +1318,12 @@ function __wbg_get_imports() {
1251
1318
  __wbg_clearColor_796427e8ac60fe14: function(arg0, arg1, arg2, arg3, arg4) {
1252
1319
  arg0.clearColor(arg1, arg2, arg3, arg4);
1253
1320
  },
1321
+ __wbg_clearDepth_4840a5497ae51286: function(arg0, arg1) {
1322
+ arg0.clearDepth(arg1);
1323
+ },
1324
+ __wbg_clearDepth_5a119c24c5d193bc: function(arg0, arg1) {
1325
+ arg0.clearDepth(arg1);
1326
+ },
1254
1327
  __wbg_clearStencil_1b8b8c727f598eec: function(arg0, arg1) {
1255
1328
  arg0.clearStencil(arg1);
1256
1329
  },
@@ -1598,6 +1671,13 @@ function __wbg_get_imports() {
1598
1671
  const ret = Reflect.get(arg0, arg1);
1599
1672
  return ret;
1600
1673
  }, arguments); },
1674
+ __wbg_get_f75619e20cb68514: function() { return handleError(function (arg0, arg1, arg2, arg3) {
1675
+ const ret = arg1.get(getStringFromWasm0(arg2, arg3));
1676
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1677
+ var len1 = WASM_VECTOR_LEN;
1678
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1679
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1680
+ }, arguments); },
1601
1681
  __wbg_get_index_f4750150bb3083b3: function(arg0, arg1) {
1602
1682
  const ret = arg0[arg1 >>> 0];
1603
1683
  return ret;
@@ -1606,6 +1686,10 @@ function __wbg_get_imports() {
1606
1686
  const ret = arg0[arg1 >>> 0];
1607
1687
  return ret;
1608
1688
  },
1689
+ __wbg_headers_eba93595f8944c2f: function(arg0) {
1690
+ const ret = arg0.headers;
1691
+ return ret;
1692
+ },
1609
1693
  __wbg_height_9dca4d43c3e4b84b: function(arg0) {
1610
1694
  const ret = arg0.height;
1611
1695
  return ret;
@@ -1630,6 +1714,16 @@ function __wbg_get_imports() {
1630
1714
  const ret = result;
1631
1715
  return ret;
1632
1716
  },
1717
+ __wbg_instanceof_Error_80a725f81f2e102d: function(arg0) {
1718
+ let result;
1719
+ try {
1720
+ result = arg0 instanceof Error;
1721
+ } catch (_) {
1722
+ result = false;
1723
+ }
1724
+ const ret = result;
1725
+ return ret;
1726
+ },
1633
1727
  __wbg_instanceof_Float32Array_595afb0f28b828c9: function(arg0) {
1634
1728
  let result;
1635
1729
  try {
@@ -1758,6 +1852,10 @@ function __wbg_get_imports() {
1758
1852
  __wbg_linkProgram_acdc299c43d734a0: function(arg0, arg1) {
1759
1853
  arg0.linkProgram(arg1);
1760
1854
  },
1855
+ __wbg_message_5f8387f0c32b90a7: function(arg0) {
1856
+ const ret = arg0.message;
1857
+ return ret;
1858
+ },
1761
1859
  __wbg_name_91a697e9ff1634bf: function(arg0, arg1) {
1762
1860
  const ret = arg1.name;
1763
1861
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -1795,6 +1893,10 @@ function __wbg_get_imports() {
1795
1893
  const ret = new Object();
1796
1894
  return ret;
1797
1895
  },
1896
+ __wbg_new_83ca405eae412a62: function() { return handleError(function () {
1897
+ const ret = new Headers();
1898
+ return ret;
1899
+ }, arguments); },
1798
1900
  __wbg_new_ee2291f50781bf1d: function() {
1799
1901
  const ret = new Array();
1800
1902
  return ret;
@@ -1843,6 +1945,10 @@ function __wbg_get_imports() {
1843
1945
  const ret = Array.of(arg0);
1844
1946
  return ret;
1845
1947
  },
1948
+ __wbg_of_dde0b9d3265685ee: function(arg0, arg1, arg2) {
1949
+ const ret = Array.of(arg0, arg1, arg2);
1950
+ return ret;
1951
+ },
1846
1952
  __wbg_of_fea2613674ee0d0f: function(arg0, arg1, arg2, arg3, arg4) {
1847
1953
  const ret = Array.of(arg0, arg1, arg2, arg3, arg4);
1848
1954
  return ret;
@@ -1870,6 +1976,9 @@ function __wbg_get_imports() {
1870
1976
  __wbg_prototypesetcall_bc27214492979395: function(arg0, arg1, arg2) {
1871
1977
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
1872
1978
  },
1979
+ __wbg_prototypesetcall_d49a4fab5ca427bc: function(arg0, arg1, arg2) {
1980
+ Float64Array.prototype.set.call(getArrayF64FromWasm0(arg0, arg1), arg2);
1981
+ },
1873
1982
  __wbg_push_2baf45db356cf468: function(arg0, arg1) {
1874
1983
  const ret = arg0.push(arg1);
1875
1984
  return ret;
@@ -1914,6 +2023,9 @@ function __wbg_get_imports() {
1914
2023
  const ret = Reflect.set(arg0, arg1, arg2);
1915
2024
  return ret;
1916
2025
  }, arguments); },
2026
+ __wbg_set_af5932e3f78b5648: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2027
+ arg0.set(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
2028
+ }, arguments); },
1917
2029
  __wbg_set_alpha_6dea851a46253adf: function(arg0, arg1) {
1918
2030
  arg0.alpha = arg1 !== 0;
1919
2031
  },
@@ -1929,6 +2041,9 @@ function __wbg_get_imports() {
1929
2041
  __wbg_set_depth_8b49de49803d4e60: function(arg0, arg1) {
1930
2042
  arg0.depth = arg1 !== 0;
1931
2043
  },
2044
+ __wbg_set_headers_40ad33dcf016613f: function(arg0, arg1) {
2045
+ arg0.headers = arg1;
2046
+ },
1932
2047
  __wbg_set_power_preference_6ef22d4c8baf517f: function(arg0, arg1) {
1933
2048
  arg0.powerPreference = __wbindgen_enum_WebGlPowerPreference[arg1];
1934
2049
  },
@@ -2008,6 +2123,10 @@ function __wbg_get_imports() {
2008
2123
  __wbg_stencilOp_2697194654fee819: function(arg0, arg1, arg2, arg3) {
2009
2124
  arg0.stencilOp(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0);
2010
2125
  },
2126
+ __wbg_subarray_002b94d5e13d1411: function(arg0, arg1, arg2) {
2127
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
2128
+ return ret;
2129
+ },
2011
2130
  __wbg_texImage2D_1b3349107ad0faae: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
2012
2131
  arg0.texImage2D(arg1 >>> 0, arg2, arg3, arg4 >>> 0, arg5 >>> 0, arg6);
2013
2132
  }, arguments); },
@@ -2205,7 +2324,7 @@ function __wbg_get_imports() {
2205
2324
  return ret;
2206
2325
  },
2207
2326
  __wbindgen_generic_0000000000000001: function(arg0, arg1) {
2208
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 168, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
2327
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 190, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
2209
2328
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_2e566c63402fe7fa___convert__closures_____invoke___wasm_bindgen_2e566c63402fe7fa___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_2e566c63402fe7fa___JsError___true_);
2210
2329
  return ret;
2211
2330
  },
@@ -176,9 +176,6 @@ export class Engine {
176
176
  project(lon: number, lat: number): [x: number, y: number] | undefined;
177
177
  removeExtrusionBatch(id: number, key: number): void;
178
178
  removeLayer(id: number): void;
179
- /**
180
- * Draws a frame; returns true while tiles are still loading (a new frame will be asked through `redraw`)
181
- */
182
179
  render(): boolean;
183
180
  /**
184
181
  * Asks what is under a screen point without waiting for the GPU (as `pick`, with the position there): the
@@ -352,7 +352,6 @@ export class Engine {
352
352
  wasm.engine_removeLayer(this.__wbg_ptr, id);
353
353
  }
354
354
  /**
355
- * Draws a frame; returns true while tiles are still loading (a new frame will be asked through `redraw`)
356
355
  * @returns {boolean}
357
356
  */
358
357
  render() {
@@ -0,0 +1,43 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ /**
5
+ * The vertices (`STRIDE` bytes each, see `points`) of a COPC chunk of `count` points. `laz`: the data of the LAZ
6
+ * VLR; `layout`: format, record length, scale and offset of the header; `grid`: the positions of the node's square
7
+ * (`Grid::numbers`)
8
+ */
9
+ export function decodeCopc(chunk: Uint8Array, laz: Uint8Array, layout: Float64Array, grid: Float64Array, count: number): Uint8Array;
10
+
11
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
12
+
13
+ export interface InitOutput {
14
+ readonly memory: WebAssembly.Memory;
15
+ readonly decodeCopc: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number, number, number];
16
+ readonly __wbindgen_externrefs: WebAssembly.Table;
17
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
18
+ readonly __externref_table_dealloc: (a: number) => void;
19
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
20
+ readonly __wbindgen_start: () => void;
21
+ }
22
+
23
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
24
+
25
+ /**
26
+ * Instantiates the given `module`, which can either be bytes or
27
+ * a precompiled `WebAssembly.Module`.
28
+ *
29
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
30
+ *
31
+ * @returns {InitOutput}
32
+ */
33
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
34
+
35
+ /**
36
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
37
+ * for everything else, calls `WebAssembly.instantiate` directly.
38
+ *
39
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
40
+ *
41
+ * @returns {Promise<InitOutput>}
42
+ */
43
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;