isard 0.6.1 → 0.8.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 (66) hide show
  1. package/CHANGELOG.md +100 -0
  2. package/dist/basemap.worker.d.ts +7 -1
  3. package/dist/basemap.worker.js +2 -2
  4. package/dist/basemap.worker.js.map +8 -7
  5. package/dist/decoder.worker.js +4 -4
  6. package/dist/decoder.worker.js.map +6 -5
  7. package/dist/engine-loader.d.ts +1 -1
  8. package/dist/engine-loader.js.map +1 -1
  9. package/dist/geoplateforme.d.ts +4 -3
  10. package/dist/geoplateforme.js +43 -19
  11. package/dist/geoplateforme.js.map +1 -1
  12. package/dist/glyphs.js +2 -1
  13. package/dist/glyphs.js.map +1 -1
  14. package/dist/icons.js +5 -1
  15. package/dist/icons.js.map +1 -1
  16. package/dist/index.d.ts +4 -2
  17. package/dist/index.js +3 -1
  18. package/dist/index.js.map +1 -1
  19. package/dist/interaction.d.ts +2 -0
  20. package/dist/interaction.js +29 -2
  21. package/dist/interaction.js.map +1 -1
  22. package/dist/isard_bg.wasm +0 -0
  23. package/dist/isard_core_bg.wasm +0 -0
  24. package/dist/layers.d.ts +2 -0
  25. package/dist/layers.js +22 -4
  26. package/dist/layers.js.map +1 -1
  27. package/dist/loader.d.ts +2 -0
  28. package/dist/loader.js +10 -0
  29. package/dist/loader.js.map +1 -1
  30. package/dist/map.d.ts +52 -3
  31. package/dist/map.js +171 -6
  32. package/dist/map.js.map +1 -1
  33. package/dist/overlay.d.ts +55 -0
  34. package/dist/overlay.js +185 -7
  35. package/dist/overlay.js.map +1 -1
  36. package/dist/panoramas.d.ts +94 -0
  37. package/dist/panoramas.js +245 -0
  38. package/dist/panoramas.js.map +1 -0
  39. package/dist/pmtiles.js +3 -2
  40. package/dist/pmtiles.js.map +1 -1
  41. package/dist/pointclouds.js +1 -1
  42. package/dist/pointclouds.js.map +1 -1
  43. package/dist/protocol.d.ts +7 -1
  44. package/dist/protocol.js.map +1 -1
  45. package/dist/requests.d.ts +14 -0
  46. package/dist/requests.js +48 -0
  47. package/dist/requests.js.map +1 -0
  48. package/dist/resample.js +2 -1
  49. package/dist/resample.js.map +1 -1
  50. package/dist/style.js +3 -0
  51. package/dist/style.js.map +1 -1
  52. package/dist/terrain.d.ts +0 -5
  53. package/dist/terrain.js +2 -1
  54. package/dist/terrain.js.map +1 -1
  55. package/dist/types.d.ts +36 -4
  56. package/dist/types.js.map +1 -1
  57. package/dist/vectortiles.d.ts +6 -2
  58. package/dist/vectortiles.js +92 -33
  59. package/dist/vectortiles.js.map +1 -1
  60. package/dist/wasm/isard.d.ts +105 -11
  61. package/dist/wasm/isard.js +211 -13
  62. package/dist/wasm/isard_core.d.ts +64 -6
  63. package/dist/wasm/isard_core.js +149 -6
  64. package/dist/wmts.js +2 -1
  65. package/dist/wmts.js.map +1 -1
  66. package/package.json +1 -1
@@ -12,6 +12,8 @@ export interface EncodedPrimitive {
12
12
  mime?: string;
13
13
  /** Base color factor of its material (RGBA 0-1), when not white */
14
14
  color?: Float32Array<ArrayBuffer>;
15
+ /** The feature of each vertex (`EncodedTile.properties` index them), when the tile has features */
16
+ features?: Float32Array<ArrayBuffer>;
15
17
  }
16
18
 
17
19
  /** A tile decoded by `decodeTile` */
@@ -21,6 +23,8 @@ export interface EncodedTile {
21
23
  primitives: EncodedPrimitive[];
22
24
  /** Its points (`.pnts`, glTF points), 20 bytes a vertex: x, y, z (f32) around the anchor, RGB, a normal */
23
25
  points: Uint8Array<ArrayBuffer>[];
26
+ /** The properties of its features, one object per feature */
27
+ properties?: Record<string, unknown>[];
24
28
  }
25
29
 
26
30
  /** A texture transcoded for the GPU (KTX2 / Basis Universal): a WebGL internal format and its mip levels */
@@ -41,6 +45,8 @@ export interface DecodedPrimitive {
41
45
  texture?: CompressedTexture;
42
46
  /** Base color factor of its material (RGBA 0-1), when not white */
43
47
  color?: Float32Array<ArrayBuffer>;
48
+ /** The feature of each vertex, when the tile has features */
49
+ features?: Float32Array<ArrayBuffer>;
44
50
  }
45
51
 
46
52
  /**
@@ -85,6 +91,8 @@ export interface DecodedTile {
85
91
  primitives: DecodedPrimitive[];
86
92
  /** Its points' vertices (`EncodedTile.points`) */
87
93
  points?: Uint8Array<ArrayBuffer>[];
94
+ /** The properties of its features (`EncodedTile.properties`) */
95
+ properties?: Record<string, unknown>[];
88
96
  }
89
97
 
90
98
  /** What the engine expects from a pool of decoding workers (`Engine.setTileLoader`) */
@@ -324,14 +332,19 @@ export class Engine {
324
332
  /**
325
333
  * 3D Tiles (b3dm / glb textured meshes, external tilesets) from the URL of a `tileset.json`. `max_error`:
326
334
  * screen-space error (CSS pixels) above which a tile is refined; 16 is the usual value, lower is finer.
335
+ * `geoid`: its heights are altitudes (NGF-IGN69), each tile raised by the RAF20 geoid onto the relief.
327
336
  */
328
- addTiles3d(url: string, max_error: number): number;
337
+ addTiles3d(url: string, max_error: number, geoid?: boolean | null): number;
329
338
  /**
330
339
  * Longitudes and latitudes the view covers on the ground, `[west, south, east, north]` (degrees): the screen's
331
340
  * border cast on the ground, or on the far plane where it passes the horizon
332
341
  */
333
342
  bounds(): Float64Array;
334
343
  camera(): Camera;
344
+ /**
345
+ * Removes the panorama
346
+ */
347
+ clearPanorama(): void;
335
348
  clearPreload(): void;
336
349
  /**
337
350
  * Removes the viewshed
@@ -343,6 +356,16 @@ export class Engine {
343
356
  * callback of a custom layer. Static: the engine is borrowed while it draws
344
357
  */
345
358
  static customMatrix(lon: number, lat: number, altitude: number): Float32Array | undefined;
359
+ /**
360
+ * Altitude of the relief at a position (metres, exaggeration included), from the copy of its tiles kept on the
361
+ * CPU (as coarse as the tiles loaded there); undefined without relief or where none is loaded
362
+ */
363
+ elevationAt(lon: number, lat: number): number | undefined;
364
+ /**
365
+ * Height of the RAF20 geoid above the ellipsoid at a position (metres; 0 away from mainland France): what raises
366
+ * the altitudes (NGF-IGN69) of a source onto the IGN relief
367
+ */
368
+ static geoidHeight(lon: number, lat: number): number;
346
369
  /**
347
370
  * Position under a screen point (CSS pixels), undefined above the horizon; on the relief itself
348
371
  */
@@ -353,6 +376,12 @@ export class Engine {
353
376
  * through the layer's ramp, up to `max` (above: its own color)
354
377
  */
355
378
  linkExtrusionNetwork(id: number, network: number | null | undefined, max: number): void;
379
+ /**
380
+ * Model-view-projection matrix (16 numbers, column-major) of the local frame at a longitude, latitude (degrees)
381
+ * and altitude (metres), x east, y north, z up, in metres, for the last frame drawn (else the camera): the 3D
382
+ * overlays of the page (`Panel`) placed with it after each frame
383
+ */
384
+ localMatrix(lon: number, lat: number, altitude: number): Float32Array;
356
385
  /**
357
386
  * Moves a layer to a drawing position (0 = bottom)
358
387
  */
@@ -401,9 +430,9 @@ export class Engine {
401
430
  */
402
431
  preload(lon: number, lat: number, zoom: number, pitch: number, bearing: number): void;
403
432
  /**
404
- * Screen point (CSS pixels) of a ground position, undefined behind the camera
433
+ * Screen point (CSS pixels) of a ground position, or `height` metres above it, undefined behind the camera
405
434
  */
406
- project(lon: number, lat: number): [x: number, y: number] | undefined;
435
+ project(lon: number, lat: number, height?: number | null): [x: number, y: number] | undefined;
407
436
  removeExtrusionBatch(id: number, key: number): void;
408
437
  removeLayer(id: number): void;
409
438
  render(): boolean;
@@ -481,6 +510,12 @@ export class Engine {
481
510
  * New polygons for a fill layer (same arguments as `addFills`, the same features)
482
511
  */
483
512
  setFills(id: number, points: Float64Array, ring_start: Uint32Array, polygon_start: Uint32Array, feature: Uint32Array): void;
513
+ /**
514
+ * A street-level view: the eye `height` metres above the ground at `lon`, `lat` (degrees), looking `bearing`
515
+ * (degrees clockwise from north) and `pitch` (0 straight down, 90 level, 180 straight up), with a vertical field
516
+ * of view of `fov` degrees. A camera set with `setCamera` turns around a point again
517
+ */
518
+ setFirstPerson(lon: number, lat: number, height: number, bearing: number, pitch: number, fov: number): void;
484
519
  /**
485
520
  * Color of the globe under the tiles (polar caps)
486
521
  */
@@ -560,16 +595,38 @@ export class Engine {
560
595
  * One value per node; negative = unreached
561
596
  */
562
597
  setNetworkValues(id: number, values: Float32Array): void;
598
+ /**
599
+ * The image of camera `index` of the panorama (the images sharing the size of the first)
600
+ */
601
+ setPanoramaImage(index: number, image: ImageBitmap): void;
602
+ /**
603
+ * Shows a panorama: at `lon`, `lat` (degrees) and `height` (metres above the ellipsoid), turned by `rotation`
604
+ * (9 numbers, row-major: its frame to east, north, up), its `cameras` (25 numbers each: rotation from the panorama
605
+ * frame, row-major, 9; position in it, 3; focal x, y; center x, y; skew; image width, height; principal point of
606
+ * the distortion x, y; its coefficients r³, r⁵, r⁷; its limit, pixels), a backdrop sphere of `radius` metres, at
607
+ * `opacity`. Its images come after (`setPanoramaImage`)
608
+ */
609
+ setPanorama(lon: number, lat: number, height: number, rotation: Float64Array, cameras: Float64Array, radius: number, opacity: number): void;
563
610
  /**
564
611
  * The style of a point cloud: 14 numbers (see `Style::parse`), the colors of the 256 classes (RGBA,
565
612
  * alpha 0 hides a class) and the ramp of the altitudes (256 RGBA texels)
566
613
  */
567
614
  setPointCloudStyle(id: number, style: Float64Array, palette: Uint8Array, ramp: Uint8Array): void;
568
615
  setRasterStyle(id: number, opacity: number, saturation: number): void;
616
+ /**
617
+ * The headers added to the engine's requests by URL prefix (`setRequestHeaders`, the same for every map of the
618
+ * page): `prefixes[i]` with `counts[i]` name and value pairs, in order, flattened into `pairs`
619
+ */
620
+ setRequestHeaders(prefixes: string[], counts: Uint32Array, pairs: string[]): void;
569
621
  /**
570
622
  * Space behind the globe (stars, atmosphere halo), in the globe projection
571
623
  */
572
624
  setSky(enabled: boolean): void;
625
+ /**
626
+ * Shows `layers` on one side of a vertical line only, the others beneath on the other side (comparing two states
627
+ * of a place): left of `x` (CSS pixels from the left of the canvas), or right of it; a non-finite `x` stops
628
+ */
629
+ setSwipe(x: number, right: boolean, layers: Uint32Array): void;
573
630
  /**
574
631
  * Layer-wide style of a symbol layer: size scale and opacity as zoom stops (four zooms then four values each),
575
632
  * zoom range, visibility
@@ -599,26 +656,45 @@ export class Engine {
599
656
  */
600
657
  setTileLoader(loader: TileLoaderLike | null): void;
601
658
  /**
602
- * Screen-space error threshold, opacity and size of the points (CSS pixels, 2 if not given) of a 3D Tiles layer
659
+ * Screen-space error threshold, opacity, size of the points (CSS pixels, 2 if not given) and color (RGB 0-1, empty
660
+ * for none: it tints the textures and colors the untextured meshes) of a 3D Tiles layer
603
661
  */
604
- setTiles3dStyle(id: number, max_error: number, opacity: number, point_size?: number | null): void;
662
+ setTiles3dStyle(id: number, max_error: number, opacity: number, point_size: number | null | undefined, color: Float32Array): void;
605
663
  /**
606
664
  * Shows what can be seen from points, each within its range: `observers` holds 8 numbers per observer
607
665
  * (16 at most): longitude, latitude (degrees), metres above the ground, range (metres), then to look one way
608
666
  * only heading, tilt, angles of view across and up (degrees), the heading NaN to look all around. What some
609
667
  * observer sees is tinted with `visible`, what is hidden from all those that reach it with `hidden` (RGB 0-1),
610
- * at `opacity`
668
+ * at `opacity`; `outline` (RGB 0-1, or empty) the color of the cones' edges drawn in 3D
611
669
  */
612
- setViewshed(observers: Float64Array, visible: Float32Array, hidden: Float32Array, opacity: number): void;
670
+ setViewshed(observers: Float64Array, visible: Float32Array, hidden: Float32Array, opacity: number, outline: Float32Array): void;
613
671
  setZoomRange(min: number, max: number): void;
614
672
  /**
615
673
  * Tile counters of the raster layers, for diagnostics
616
674
  */
617
675
  stats(): RasterLayerStats[];
676
+ /**
677
+ * The height above the relief (metres) of the top of what stands at a position (degrees): a roof, a mesh, 0 on
678
+ * the bare ground; undefined where nothing of the last frame is there. The scene is drawn from above into a single
679
+ * pixel and read back (a stall, cheap: one pixel to fill)
680
+ */
681
+ surfaceAt(lon: number, lat: number): any;
682
+ /**
683
+ * What is drawn under a screen point (CSS pixels): longitude, latitude and its height above the relief (metres),
684
+ * on a roof, a wall or a mesh as on the ground; undefined where nothing was drawn. The scene is drawn again and
685
+ * read back (a stall): for clicks and drags
686
+ */
687
+ surface(x: number, y: number): [lon: number, lat: number, height: number] | undefined;
618
688
  /**
619
689
  * Compressed texture formats of the GPU (their WebGL extensions get enabled), for the KTX2 transcoding
620
690
  */
621
691
  textureFormats(): TextureFormats;
692
+ /**
693
+ * The feature of a picked handle (`pick`'s index on a 3D Tiles layer): `[properties, feature]`, its properties
694
+ * (undefined when its tile has none) and its index in its tile; undefined if the handle is not of the last picking
695
+ * pass
696
+ */
697
+ tiles3dFeature(id: number, index: number): [properties: Record<string, unknown> | undefined, feature: number] | undefined;
622
698
  /**
623
699
  * Counters of a 3D Tiles layer, undefined if there is none with this id
624
700
  */
@@ -639,6 +715,11 @@ export class Engine {
639
715
  * A region of the icon atlas: `width` × `height` RGBA texels (premultiplied) at (`x`, `y`)
640
716
  */
641
717
  updateIconAtlas(x: number, y: number, width: number, height: number, data: Uint8Array): void;
718
+ /**
719
+ * Tiles a raster layer wants for the view of the last frame, three numbers per tile (z, x, y), the nearest to
720
+ * the eye first: the level each area of the ground is drawn at, for the labels of a vector style to follow it
721
+ */
722
+ wantedTiles(id: number): Uint32Array;
642
723
  zoomAt(delta: number, x: number, y: number): void;
643
724
  }
644
725
 
@@ -674,14 +755,18 @@ export interface InitOutput {
674
755
  readonly engine_addPointCloud: (a: number, b: number, c: number, d: any) => [number, number, number];
675
756
  readonly engine_addRaster: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number, number];
676
757
  readonly engine_addSymbols: (a: number) => [number, number, number];
677
- readonly engine_addTiles3d: (a: number, b: number, c: number, d: number) => [number, number, number];
758
+ readonly engine_addTiles3d: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
678
759
  readonly engine_bounds: (a: number) => [number, number];
679
760
  readonly engine_camera: (a: number) => any;
761
+ readonly engine_clearPanorama: (a: number) => void;
680
762
  readonly engine_clearPreload: (a: number) => void;
681
763
  readonly engine_clearViewshed: (a: number) => void;
682
764
  readonly engine_customMatrix: (a: number, b: number, c: number) => [number, number];
765
+ readonly engine_elevationAt: (a: number, b: number, c: number) => [number, number];
766
+ readonly engine_geoidHeight: (a: number, b: number) => number;
683
767
  readonly engine_ground: (a: number, b: number, c: number) => any;
684
768
  readonly engine_linkExtrusionNetwork: (a: number, b: number, c: number, d: number) => void;
769
+ readonly engine_localMatrix: (a: number, b: number, c: number, d: number) => [number, number];
685
770
  readonly engine_moveLayer: (a: number, b: number, c: number) => void;
686
771
  readonly engine_networkStats: (a: number, b: number) => any;
687
772
  readonly engine_new: (a: any, b: any) => [number, number, number];
@@ -692,7 +777,7 @@ export interface InitOutput {
692
777
  readonly engine_pointCloudStats: (a: number, b: number) => any;
693
778
  readonly engine_pollPick: (a: number) => any;
694
779
  readonly engine_preload: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
695
- readonly engine_project: (a: number, b: number, c: number) => any;
780
+ readonly engine_project: (a: number, b: number, c: number, d: number, e: number) => any;
696
781
  readonly engine_removeExtrusionBatch: (a: number, b: number, c: number) => void;
697
782
  readonly engine_removeLayer: (a: number, b: number) => void;
698
783
  readonly engine_render: (a: number) => number;
@@ -713,6 +798,7 @@ export interface InitOutput {
713
798
  readonly engine_setFeatureStyle: (a: number, b: number, c: number, d: number, e: number) => void;
714
799
  readonly engine_setFeatureValues: (a: number, b: number, c: number, d: number, e: number) => void;
715
800
  readonly engine_setFills: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
801
+ readonly engine_setFirstPerson: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
716
802
  readonly engine_setGlobe: (a: number, b: number) => void;
717
803
  readonly engine_setGlobeColor: (a: number, b: number, c: number, d: number) => void;
718
804
  readonly engine_setGlyphAtlas: (a: number, b: number, c: number, d: number, e: number) => [number, number];
@@ -732,23 +818,31 @@ export interface InitOutput {
732
818
  readonly engine_setNetworkScales: (a: number, b: number, c: number, d: number) => void;
733
819
  readonly engine_setNetworkStyle: (a: number, b: number, c: number, d: number) => void;
734
820
  readonly engine_setNetworkValues: (a: number, b: number, c: number, d: number) => void;
821
+ 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];
822
+ readonly engine_setPanoramaImage: (a: number, b: number, c: any) => [number, number];
735
823
  readonly engine_setPointCloudStyle: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
736
824
  readonly engine_setRasterStyle: (a: number, b: number, c: number, d: number) => void;
825
+ readonly engine_setRequestHeaders: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
737
826
  readonly engine_setSky: (a: number, b: number) => void;
827
+ readonly engine_setSwipe: (a: number, b: number, c: number, d: number, e: number) => void;
738
828
  readonly engine_setSymbolLayer: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
739
829
  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];
740
830
  readonly engine_setTerrain: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number];
741
831
  readonly engine_setTileLoader: (a: number, b: any) => void;
742
- readonly engine_setTiles3dStyle: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
743
- readonly engine_setViewshed: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number];
832
+ readonly engine_setTiles3dStyle: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: 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];
744
834
  readonly engine_setZoomRange: (a: number, b: number, c: number) => void;
745
835
  readonly engine_stats: (a: number) => any;
836
+ readonly engine_surface: (a: number, b: number, c: number) => any;
837
+ readonly engine_surfaceAt: (a: number, b: number, c: number) => any;
746
838
  readonly engine_textureFormats: (a: number) => any;
839
+ readonly engine_tiles3dFeature: (a: number, b: number, c: number) => any;
747
840
  readonly engine_tiles3dStats: (a: number, b: number) => any;
748
841
  readonly engine_updateGlyphAtlas: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
749
842
  readonly engine_updateGlyphPage: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
750
843
  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];
751
844
  readonly engine_updateIconAtlas: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
845
+ readonly engine_wantedTiles: (a: number, b: number) => [number, number];
752
846
  readonly engine_zoomAt: (a: number, b: number, c: number, d: number) => void;
753
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;
754
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];
@@ -228,14 +228,16 @@ export class Engine {
228
228
  /**
229
229
  * 3D Tiles (b3dm / glb textured meshes, external tilesets) from the URL of a `tileset.json`. `max_error`:
230
230
  * screen-space error (CSS pixels) above which a tile is refined; 16 is the usual value, lower is finer.
231
+ * `geoid`: its heights are altitudes (NGF-IGN69), each tile raised by the RAF20 geoid onto the relief.
231
232
  * @param {string} url
232
233
  * @param {number} max_error
234
+ * @param {boolean | null} [geoid]
233
235
  * @returns {number}
234
236
  */
235
- addTiles3d(url, max_error) {
237
+ addTiles3d(url, max_error, geoid) {
236
238
  const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
237
239
  const len0 = WASM_VECTOR_LEN;
238
- const ret = wasm.engine_addTiles3d(this.__wbg_ptr, ptr0, len0, max_error);
240
+ const ret = wasm.engine_addTiles3d(this.__wbg_ptr, ptr0, len0, max_error, isLikeNone(geoid) ? 0xFFFFFF : geoid ? 1 : 0);
239
241
  if (ret[2]) {
240
242
  throw takeFromExternrefTable0(ret[1]);
241
243
  }
@@ -259,6 +261,12 @@ export class Engine {
259
261
  const ret = wasm.engine_camera(this.__wbg_ptr);
260
262
  return ret;
261
263
  }
264
+ /**
265
+ * Removes the panorama
266
+ */
267
+ clearPanorama() {
268
+ wasm.engine_clearPanorama(this.__wbg_ptr);
269
+ }
262
270
  clearPreload() {
263
271
  wasm.engine_clearPreload(this.__wbg_ptr);
264
272
  }
@@ -286,6 +294,28 @@ export class Engine {
286
294
  }
287
295
  return v1;
288
296
  }
297
+ /**
298
+ * Altitude of the relief at a position (metres, exaggeration included), from the copy of its tiles kept on the
299
+ * CPU (as coarse as the tiles loaded there); undefined without relief or where none is loaded
300
+ * @param {number} lon
301
+ * @param {number} lat
302
+ * @returns {number | undefined}
303
+ */
304
+ elevationAt(lon, lat) {
305
+ const ret = wasm.engine_elevationAt(this.__wbg_ptr, lon, lat);
306
+ return ret[0] === 0 ? undefined : ret[1];
307
+ }
308
+ /**
309
+ * Height of the RAF20 geoid above the ellipsoid at a position (metres; 0 away from mainland France): what raises
310
+ * the altitudes (NGF-IGN69) of a source onto the IGN relief
311
+ * @param {number} lon
312
+ * @param {number} lat
313
+ * @returns {number}
314
+ */
315
+ static geoidHeight(lon, lat) {
316
+ const ret = wasm.engine_geoidHeight(lon, lat);
317
+ return ret;
318
+ }
289
319
  /**
290
320
  * Position under a screen point (CSS pixels), undefined above the horizon; on the relief itself
291
321
  * @param {number} x
@@ -307,6 +337,21 @@ export class Engine {
307
337
  linkExtrusionNetwork(id, network, max) {
308
338
  wasm.engine_linkExtrusionNetwork(this.__wbg_ptr, id, isLikeNone(network) ? Number.MAX_SAFE_INTEGER : (network) >>> 0, max);
309
339
  }
340
+ /**
341
+ * Model-view-projection matrix (16 numbers, column-major) of the local frame at a longitude, latitude (degrees)
342
+ * and altitude (metres), x east, y north, z up, in metres, for the last frame drawn (else the camera): the 3D
343
+ * overlays of the page (`Panel`) placed with it after each frame
344
+ * @param {number} lon
345
+ * @param {number} lat
346
+ * @param {number} altitude
347
+ * @returns {Float32Array}
348
+ */
349
+ localMatrix(lon, lat, altitude) {
350
+ const ret = wasm.engine_localMatrix(this.__wbg_ptr, lon, lat, altitude);
351
+ var v1 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
352
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
353
+ return v1;
354
+ }
310
355
  /**
311
356
  * Moves a layer to a drawing position (0 = bottom)
312
357
  * @param {number} id
@@ -417,13 +462,14 @@ export class Engine {
417
462
  wasm.engine_preload(this.__wbg_ptr, lon, lat, zoom, pitch, bearing);
418
463
  }
419
464
  /**
420
- * Screen point (CSS pixels) of a ground position, undefined behind the camera
465
+ * Screen point (CSS pixels) of a ground position, or `height` metres above it, undefined behind the camera
421
466
  * @param {number} lon
422
467
  * @param {number} lat
468
+ * @param {number | null} [height]
423
469
  * @returns {[x: number, y: number] | undefined}
424
470
  */
425
- project(lon, lat) {
426
- const ret = wasm.engine_project(this.__wbg_ptr, lon, lat);
471
+ project(lon, lat, height) {
472
+ const ret = wasm.engine_project(this.__wbg_ptr, lon, lat, !isLikeNone(height), isLikeNone(height) ? 0 : height);
427
473
  return ret;
428
474
  }
429
475
  /**
@@ -665,6 +711,20 @@ export class Engine {
665
711
  const len3 = WASM_VECTOR_LEN;
666
712
  wasm.engine_setFills(this.__wbg_ptr, id, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
667
713
  }
714
+ /**
715
+ * A street-level view: the eye `height` metres above the ground at `lon`, `lat` (degrees), looking `bearing`
716
+ * (degrees clockwise from north) and `pitch` (0 straight down, 90 level, 180 straight up), with a vertical field
717
+ * of view of `fov` degrees. A camera set with `setCamera` turns around a point again
718
+ * @param {number} lon
719
+ * @param {number} lat
720
+ * @param {number} height
721
+ * @param {number} bearing
722
+ * @param {number} pitch
723
+ * @param {number} fov
724
+ */
725
+ setFirstPerson(lon, lat, height, bearing, pitch, fov) {
726
+ wasm.engine_setFirstPerson(this.__wbg_ptr, lon, lat, height, bearing, pitch, fov);
727
+ }
668
728
  /**
669
729
  * Color of the globe under the tiles (polar caps)
670
730
  * @param {number} r
@@ -886,6 +946,41 @@ export class Engine {
886
946
  const len0 = WASM_VECTOR_LEN;
887
947
  wasm.engine_setNetworkValues(this.__wbg_ptr, id, ptr0, len0);
888
948
  }
949
+ /**
950
+ * The image of camera `index` of the panorama (the images sharing the size of the first)
951
+ * @param {number} index
952
+ * @param {ImageBitmap} image
953
+ */
954
+ setPanoramaImage(index, image) {
955
+ const ret = wasm.engine_setPanoramaImage(this.__wbg_ptr, index, image);
956
+ if (ret[1]) {
957
+ throw takeFromExternrefTable0(ret[0]);
958
+ }
959
+ }
960
+ /**
961
+ * Shows a panorama: at `lon`, `lat` (degrees) and `height` (metres above the ellipsoid), turned by `rotation`
962
+ * (9 numbers, row-major: its frame to east, north, up), its `cameras` (25 numbers each: rotation from the panorama
963
+ * frame, row-major, 9; position in it, 3; focal x, y; center x, y; skew; image width, height; principal point of
964
+ * the distortion x, y; its coefficients r³, r⁵, r⁷; its limit, pixels), a backdrop sphere of `radius` metres, at
965
+ * `opacity`. Its images come after (`setPanoramaImage`)
966
+ * @param {number} lon
967
+ * @param {number} lat
968
+ * @param {number} height
969
+ * @param {Float64Array} rotation
970
+ * @param {Float64Array} cameras
971
+ * @param {number} radius
972
+ * @param {number} opacity
973
+ */
974
+ setPanorama(lon, lat, height, rotation, cameras, radius, opacity) {
975
+ const ptr0 = passArrayF64ToWasm0(rotation, wasm.__wbindgen_malloc);
976
+ const len0 = WASM_VECTOR_LEN;
977
+ const ptr1 = passArrayF64ToWasm0(cameras, wasm.__wbindgen_malloc);
978
+ const len1 = WASM_VECTOR_LEN;
979
+ const ret = wasm.engine_setPanorama(this.__wbg_ptr, lon, lat, height, ptr0, len0, ptr1, len1, radius, opacity);
980
+ if (ret[1]) {
981
+ throw takeFromExternrefTable0(ret[0]);
982
+ }
983
+ }
889
984
  /**
890
985
  * The style of a point cloud: 14 numbers (see `Style::parse`), the colors of the 256 classes (RGBA,
891
986
  * alpha 0 hides a class) and the ramp of the altitudes (256 RGBA texels)
@@ -911,6 +1006,22 @@ export class Engine {
911
1006
  setRasterStyle(id, opacity, saturation) {
912
1007
  wasm.engine_setRasterStyle(this.__wbg_ptr, id, opacity, saturation);
913
1008
  }
1009
+ /**
1010
+ * The headers added to the engine's requests by URL prefix (`setRequestHeaders`, the same for every map of the
1011
+ * page): `prefixes[i]` with `counts[i]` name and value pairs, in order, flattened into `pairs`
1012
+ * @param {string[]} prefixes
1013
+ * @param {Uint32Array} counts
1014
+ * @param {string[]} pairs
1015
+ */
1016
+ setRequestHeaders(prefixes, counts, pairs) {
1017
+ const ptr0 = passArrayJsValueToWasm0(prefixes, wasm.__wbindgen_malloc);
1018
+ const len0 = WASM_VECTOR_LEN;
1019
+ const ptr1 = passArray32ToWasm0(counts, wasm.__wbindgen_malloc);
1020
+ const len1 = WASM_VECTOR_LEN;
1021
+ const ptr2 = passArrayJsValueToWasm0(pairs, wasm.__wbindgen_malloc);
1022
+ const len2 = WASM_VECTOR_LEN;
1023
+ wasm.engine_setRequestHeaders(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
1024
+ }
914
1025
  /**
915
1026
  * Space behind the globe (stars, atmosphere halo), in the globe projection
916
1027
  * @param {boolean} enabled
@@ -918,6 +1029,18 @@ export class Engine {
918
1029
  setSky(enabled) {
919
1030
  wasm.engine_setSky(this.__wbg_ptr, enabled);
920
1031
  }
1032
+ /**
1033
+ * Shows `layers` on one side of a vertical line only, the others beneath on the other side (comparing two states
1034
+ * of a place): left of `x` (CSS pixels from the left of the canvas), or right of it; a non-finite `x` stops
1035
+ * @param {number} x
1036
+ * @param {boolean} right
1037
+ * @param {Uint32Array} layers
1038
+ */
1039
+ setSwipe(x, right, layers) {
1040
+ const ptr0 = passArray32ToWasm0(layers, wasm.__wbindgen_malloc);
1041
+ const len0 = WASM_VECTOR_LEN;
1042
+ wasm.engine_setSwipe(this.__wbg_ptr, x, right, ptr0, len0);
1043
+ }
921
1044
  /**
922
1045
  * Layer-wide style of a symbol layer: size scale and opacity as zoom stops (four zooms then four values each),
923
1046
  * zoom range, visibility
@@ -992,34 +1115,41 @@ export class Engine {
992
1115
  wasm.engine_setTileLoader(this.__wbg_ptr, loader);
993
1116
  }
994
1117
  /**
995
- * Screen-space error threshold, opacity and size of the points (CSS pixels, 2 if not given) of a 3D Tiles layer
1118
+ * Screen-space error threshold, opacity, size of the points (CSS pixels, 2 if not given) and color (RGB 0-1, empty
1119
+ * for none: it tints the textures and colors the untextured meshes) of a 3D Tiles layer
996
1120
  * @param {number} id
997
1121
  * @param {number} max_error
998
1122
  * @param {number} opacity
999
- * @param {number | null} [point_size]
1123
+ * @param {number | null | undefined} point_size
1124
+ * @param {Float32Array} color
1000
1125
  */
1001
- setTiles3dStyle(id, max_error, opacity, point_size) {
1002
- wasm.engine_setTiles3dStyle(this.__wbg_ptr, id, max_error, opacity, !isLikeNone(point_size), isLikeNone(point_size) ? 0 : point_size);
1126
+ setTiles3dStyle(id, max_error, opacity, point_size, color) {
1127
+ const ptr0 = passArrayF32ToWasm0(color, wasm.__wbindgen_malloc);
1128
+ const len0 = WASM_VECTOR_LEN;
1129
+ wasm.engine_setTiles3dStyle(this.__wbg_ptr, id, max_error, opacity, !isLikeNone(point_size), isLikeNone(point_size) ? 0 : point_size, ptr0, len0);
1003
1130
  }
1004
1131
  /**
1005
1132
  * Shows what can be seen from points, each within its range: `observers` holds 8 numbers per observer
1006
1133
  * (16 at most): longitude, latitude (degrees), metres above the ground, range (metres), then to look one way
1007
1134
  * only heading, tilt, angles of view across and up (degrees), the heading NaN to look all around. What some
1008
1135
  * observer sees is tinted with `visible`, what is hidden from all those that reach it with `hidden` (RGB 0-1),
1009
- * at `opacity`
1136
+ * at `opacity`; `outline` (RGB 0-1, or empty) the color of the cones' edges drawn in 3D
1010
1137
  * @param {Float64Array} observers
1011
1138
  * @param {Float32Array} visible
1012
1139
  * @param {Float32Array} hidden
1013
1140
  * @param {number} opacity
1141
+ * @param {Float32Array} outline
1014
1142
  */
1015
- setViewshed(observers, visible, hidden, opacity) {
1143
+ setViewshed(observers, visible, hidden, opacity, outline) {
1016
1144
  const ptr0 = passArrayF64ToWasm0(observers, wasm.__wbindgen_malloc);
1017
1145
  const len0 = WASM_VECTOR_LEN;
1018
1146
  const ptr1 = passArrayF32ToWasm0(visible, wasm.__wbindgen_malloc);
1019
1147
  const len1 = WASM_VECTOR_LEN;
1020
1148
  const ptr2 = passArrayF32ToWasm0(hidden, wasm.__wbindgen_malloc);
1021
1149
  const len2 = WASM_VECTOR_LEN;
1022
- const ret = wasm.engine_setViewshed(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, opacity);
1150
+ const ptr3 = passArrayF32ToWasm0(outline, wasm.__wbindgen_malloc);
1151
+ const len3 = WASM_VECTOR_LEN;
1152
+ const ret = wasm.engine_setViewshed(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, opacity, ptr3, len3);
1023
1153
  if (ret[1]) {
1024
1154
  throw takeFromExternrefTable0(ret[0]);
1025
1155
  }
@@ -1039,6 +1169,30 @@ export class Engine {
1039
1169
  const ret = wasm.engine_stats(this.__wbg_ptr);
1040
1170
  return ret;
1041
1171
  }
1172
+ /**
1173
+ * The height above the relief (metres) of the top of what stands at a position (degrees): a roof, a mesh, 0 on
1174
+ * the bare ground; undefined where nothing of the last frame is there. The scene is drawn from above into a single
1175
+ * pixel and read back (a stall, cheap: one pixel to fill)
1176
+ * @param {number} lon
1177
+ * @param {number} lat
1178
+ * @returns {any}
1179
+ */
1180
+ surfaceAt(lon, lat) {
1181
+ const ret = wasm.engine_surfaceAt(this.__wbg_ptr, lon, lat);
1182
+ return ret;
1183
+ }
1184
+ /**
1185
+ * What is drawn under a screen point (CSS pixels): longitude, latitude and its height above the relief (metres),
1186
+ * on a roof, a wall or a mesh as on the ground; undefined where nothing was drawn. The scene is drawn again and
1187
+ * read back (a stall): for clicks and drags
1188
+ * @param {number} x
1189
+ * @param {number} y
1190
+ * @returns {[lon: number, lat: number, height: number] | undefined}
1191
+ */
1192
+ surface(x, y) {
1193
+ const ret = wasm.engine_surface(this.__wbg_ptr, x, y);
1194
+ return ret;
1195
+ }
1042
1196
  /**
1043
1197
  * Compressed texture formats of the GPU (their WebGL extensions get enabled), for the KTX2 transcoding
1044
1198
  * @returns {TextureFormats}
@@ -1047,6 +1201,18 @@ export class Engine {
1047
1201
  const ret = wasm.engine_textureFormats(this.__wbg_ptr);
1048
1202
  return ret;
1049
1203
  }
1204
+ /**
1205
+ * The feature of a picked handle (`pick`'s index on a 3D Tiles layer): `[properties, feature]`, its properties
1206
+ * (undefined when its tile has none) and its index in its tile; undefined if the handle is not of the last picking
1207
+ * pass
1208
+ * @param {number} id
1209
+ * @param {number} index
1210
+ * @returns {[properties: Record<string, unknown> | undefined, feature: number] | undefined}
1211
+ */
1212
+ tiles3dFeature(id, index) {
1213
+ const ret = wasm.engine_tiles3dFeature(this.__wbg_ptr, id, index);
1214
+ return ret;
1215
+ }
1050
1216
  /**
1051
1217
  * Counters of a 3D Tiles layer, undefined if there is none with this id
1052
1218
  * @param {number} id
@@ -1117,6 +1283,18 @@ export class Engine {
1117
1283
  const len0 = WASM_VECTOR_LEN;
1118
1284
  wasm.engine_updateIconAtlas(this.__wbg_ptr, x, y, width, height, ptr0, len0);
1119
1285
  }
1286
+ /**
1287
+ * Tiles a raster layer wants for the view of the last frame, three numbers per tile (z, x, y), the nearest to
1288
+ * the eye first: the level each area of the ground is drawn at, for the labels of a vector style to follow it
1289
+ * @param {number} id
1290
+ * @returns {Uint32Array}
1291
+ */
1292
+ wantedTiles(id) {
1293
+ const ret = wasm.engine_wantedTiles(this.__wbg_ptr, id);
1294
+ var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
1295
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1296
+ return v1;
1297
+ }
1120
1298
  /**
1121
1299
  * @param {number} delta
1122
1300
  * @param {number} x
@@ -1700,6 +1878,10 @@ function __wbg_get_imports() {
1700
1878
  const ret = Reflect.get(arg0, arg1);
1701
1879
  return ret;
1702
1880
  }, arguments); },
1881
+ __wbg_get_806853698d9fc227: function() { return handleError(function (arg0, arg1) {
1882
+ const ret = Reflect.get(arg0, arg1 >>> 0);
1883
+ return ret;
1884
+ }, arguments); },
1703
1885
  __wbg_get_f75619e20cb68514: function() { return handleError(function (arg0, arg1, arg2, arg3) {
1704
1886
  const ret = arg1.get(getStringFromWasm0(arg2, arg3));
1705
1887
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -2324,6 +2506,12 @@ function __wbg_get_imports() {
2324
2506
  __wbg_useProgram_e075c2902e420761: function(arg0, arg1) {
2325
2507
  arg0.useProgram(arg1);
2326
2508
  },
2509
+ __wbg_vertexAttrib1f_37ce0547e8fa5f36: function(arg0, arg1, arg2) {
2510
+ arg0.vertexAttrib1f(arg1 >>> 0, arg2);
2511
+ },
2512
+ __wbg_vertexAttrib1f_470b2556c148483a: function(arg0, arg1, arg2) {
2513
+ arg0.vertexAttrib1f(arg1 >>> 0, arg2);
2514
+ },
2327
2515
  __wbg_vertexAttribDivisorANGLE_659fb027198a47c3: function(arg0, arg1, arg2) {
2328
2516
  arg0.vertexAttribDivisorANGLE(arg1 >>> 0, arg2 >>> 0);
2329
2517
  },
@@ -2353,7 +2541,7 @@ function __wbg_get_imports() {
2353
2541
  return ret;
2354
2542
  },
2355
2543
  __wbindgen_generic_0000000000000001: function(arg0, arg1) {
2356
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 197, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
2544
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 198, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
2357
2545
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_2e566c63402fe7fa___convert__closures_____invoke___wasm_bindgen_2e566c63402fe7fa___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_2e566c63402fe7fa___JsError___true_);
2358
2546
  return ret;
2359
2547
  },
@@ -2704,6 +2892,16 @@ function passArrayF64ToWasm0(arg, malloc) {
2704
2892
  return ptr;
2705
2893
  }
2706
2894
 
2895
+ function passArrayJsValueToWasm0(array, malloc) {
2896
+ const ptr = malloc(array.length * 4, 4) >>> 0;
2897
+ for (let i = 0; i < array.length; i++) {
2898
+ const add = addToExternrefTable0(array[i]);
2899
+ getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
2900
+ }
2901
+ WASM_VECTOR_LEN = array.length;
2902
+ return ptr;
2903
+ }
2904
+
2707
2905
  function passStringToWasm0(arg, malloc, realloc) {
2708
2906
  if (realloc === undefined) {
2709
2907
  const buf = cachedTextEncoder.encode(arg);