isard 1.2.0 → 1.4.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.
- package/CHANGELOG.md +124 -0
- package/README.md +46 -39
- package/dist/basemap/basemaps.js +1 -0
- package/dist/basemap/basemaps.js.map +1 -1
- package/dist/basemap/pmtileslayer.d.ts +33 -0
- package/dist/basemap/pmtileslayer.js +97 -0
- package/dist/basemap/pmtileslayer.js.map +1 -0
- package/dist/basemap/trees.d.ts +26 -0
- package/dist/basemap/trees.js +141 -0
- package/dist/basemap/trees.js.map +1 -0
- package/dist/basemap/vectorstyle.d.ts +10 -0
- package/dist/basemap/vectorstyle.js +35 -0
- package/dist/basemap/vectorstyle.js.map +1 -1
- package/dist/basemap/vectortiles.d.ts +93 -44
- package/dist/basemap/vectortiles.js +511 -303
- package/dist/basemap/vectortiles.js.map +1 -1
- package/dist/basemap/workerpool.d.ts +17 -0
- package/dist/basemap/workerpool.js +203 -0
- package/dist/basemap/workerpool.js.map +1 -0
- package/dist/basemap.worker.js +2 -2
- package/dist/basemap.worker.js.map +18 -8
- package/dist/bind/layers.js +10 -0
- package/dist/bind/layers.js.map +1 -1
- package/dist/decoder.worker.js +4 -4
- package/dist/decoder.worker.js.map +3 -3
- package/dist/engine-loader.d.ts +8 -1
- package/dist/engine-loader.js +20 -1
- package/dist/engine-loader.js.map +1 -1
- package/dist/geoplateforme.d.ts +16 -0
- package/dist/geoplateforme.js +23 -0
- package/dist/geoplateforme.js.map +1 -1
- package/dist/grid-module.d.ts +44 -0
- package/dist/grid-module.js +63 -0
- package/dist/grid-module.js.map +1 -0
- package/dist/grids.d.ts +51 -0
- package/dist/grids.js +88 -0
- package/dist/grids.js.map +1 -0
- package/dist/index.d.ts +14 -4
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/dist/isard_bg.wasm +0 -0
- package/dist/isard_core_bg.wasm +0 -0
- package/dist/isard_grid_bg.wasm +0 -0
- package/dist/isard_tess_bg.wasm +0 -0
- package/dist/layers/flow.d.ts +111 -0
- package/dist/layers/flow.js +222 -0
- package/dist/layers/flow.js.map +1 -0
- package/dist/layers/layers.js +9 -0
- package/dist/layers/layers.js.map +1 -1
- package/dist/layers/symbols.d.ts +2 -0
- package/dist/layers/symbols.js +2 -1
- package/dist/layers/symbols.js.map +1 -1
- package/dist/layers/vectors.d.ts +60 -0
- package/dist/layers/vectors.js +130 -0
- package/dist/layers/vectors.js.map +1 -0
- package/dist/map/frame-loop.d.ts +3 -0
- package/dist/map/frame-loop.js +6 -0
- package/dist/map/frame-loop.js.map +1 -1
- package/dist/map/layer-spec.d.ts +4 -1
- package/dist/map/layer-spec.js +2 -0
- package/dist/map/layer-spec.js.map +1 -1
- package/dist/map/raster-source.js +1 -1
- package/dist/map/raster-source.js.map +1 -1
- package/dist/map/workers.d.ts +5 -1
- package/dist/map/workers.js +36 -1
- package/dist/map/workers.js.map +1 -1
- package/dist/map.d.ts +35 -6
- package/dist/map.js +83 -11
- package/dist/map.js.map +1 -1
- package/dist/react/IsardMap.js +1 -0
- package/dist/react/IsardMap.js.map +1 -1
- package/dist/react/Layer.d.ts +2 -0
- package/dist/react/Layer.js.map +1 -1
- package/dist/react/Swipe.d.ts +11 -4
- package/dist/react/Swipe.js +26 -15
- package/dist/react/Swipe.js.map +1 -1
- package/dist/react/VectorGeometry.d.ts +35 -0
- package/dist/react/VectorGeometry.js +82 -0
- package/dist/react/VectorGeometry.js.map +1 -0
- package/dist/react/context.d.ts +2 -1
- package/dist/react/context.js.map +1 -1
- package/dist/react/index.d.ts +2 -1
- package/dist/react/index.js +2 -1
- package/dist/react/index.js.map +1 -1
- package/dist/types.d.ts +30 -3
- package/dist/types.js.map +1 -1
- package/dist/ui/minimap.d.ts +25 -0
- package/dist/ui/minimap.js +90 -0
- package/dist/ui/minimap.js.map +1 -0
- package/dist/ui/scale.d.ts +19 -0
- package/dist/ui/scale.js +44 -0
- package/dist/ui/scale.js.map +1 -0
- package/dist/ui/search.d.ts +25 -0
- package/dist/ui/search.js +119 -0
- package/dist/ui/search.js.map +1 -0
- package/dist/ui/style.js +17 -0
- package/dist/ui/style.js.map +1 -1
- package/dist/util/sun.d.ts +11 -0
- package/dist/util/sun.js +26 -0
- package/dist/util/sun.js.map +1 -0
- package/dist/wasm/isard.d.ts +124 -7
- package/dist/wasm/isard.js +319 -8
- package/dist/wasm/isard_core.d.ts +124 -7
- package/dist/wasm/isard_core.js +319 -8
- package/dist/wasm/isard_grid.d.ts +101 -0
- package/dist/wasm/isard_grid.js +375 -0
- package/dist/wasm/isard_tess.d.ts +109 -0
- package/dist/wasm/isard_tess.js +398 -0
- package/dist/workers/basemap/geometry.d.ts +72 -0
- package/dist/workers/basemap/labels.d.ts +8 -0
- package/dist/workers/basemap/raster.d.ts +10 -0
- package/dist/workers/basemap/street.d.ts +19 -0
- package/dist/workers/basemap/tiles.d.ts +65 -0
- package/dist/workers/basemap/trees.d.ts +19 -0
- package/dist/workers/basemap.worker.d.ts +147 -22
- package/dist/workers/basemap.worker.js +93 -553
- package/dist/workers/basemap.worker.js.map +1 -1
- package/package.json +6 -4
- package/vite.js +11 -2
package/dist/wasm/isard.d.ts
CHANGED
|
@@ -307,6 +307,16 @@ export class Engine {
|
|
|
307
307
|
* info log), or when `feature_count` features need a table texture past the GPU's `MAX_TEXTURE_SIZE`
|
|
308
308
|
*/
|
|
309
309
|
addFills(points: Float64Array, ring_start: Uint32Array, polygon_start: Uint32Array, feature: Uint32Array, feature_count: number): number;
|
|
310
|
+
/**
|
|
311
|
+
* A flow layer of `particles` particles (rounded up to a multiple of 4096) with trails of `trail` positions; its
|
|
312
|
+
* field comes with `setFlowField`
|
|
313
|
+
*
|
|
314
|
+
* # Errors
|
|
315
|
+
*
|
|
316
|
+
* Throws (to JavaScript) when a WebGL object cannot be created, a shader fails to compile or the trails need a
|
|
317
|
+
* table texture past the GPU's `MAX_TEXTURE_SIZE`
|
|
318
|
+
*/
|
|
319
|
+
addFlow(particles: number, trail: number): number;
|
|
310
320
|
/**
|
|
311
321
|
* Ground layer running `code` (GLSL ES 3.0 defining `vec4 ground(vec2 offset)`, see `render::ground`) over the
|
|
312
322
|
* ground; `anchor`: Mercator point the offsets are taken from; bounds: Mercator box it shows in. Compilation errors
|
|
@@ -393,6 +403,15 @@ export class Engine {
|
|
|
393
403
|
* its info log). The tileset itself is read later: a bad one leaves the layer empty, it does not throw
|
|
394
404
|
*/
|
|
395
405
|
addTiles3d(url: string, max_error: number, geoid?: boolean | null): number;
|
|
406
|
+
/**
|
|
407
|
+
* An empty layer of vector tiles drawn as geometry: its style layers come with `setVectorSublayers`, its tiles
|
|
408
|
+
* with `setVectorTile`
|
|
409
|
+
*
|
|
410
|
+
* # Errors
|
|
411
|
+
*
|
|
412
|
+
* Throws (to JavaScript) when a shader fails to compile (the error carries its info log)
|
|
413
|
+
*/
|
|
414
|
+
addVectorTiles(): number;
|
|
396
415
|
/**
|
|
397
416
|
* Longitudes and latitudes the view covers on the ground, `[west, south, east, north]` (degrees): the screen's
|
|
398
417
|
* border cast on the ground, or on the far plane where it passes the horizon
|
|
@@ -510,6 +529,10 @@ export class Engine {
|
|
|
510
529
|
* Removes a layer and frees its GPU objects; the other layers forget it (a layer that referred to it)
|
|
511
530
|
*/
|
|
512
531
|
removeLayer(id: number): void;
|
|
532
|
+
/**
|
|
533
|
+
* Removes tile `key` of a vector tile layer (nothing if there is none)
|
|
534
|
+
*/
|
|
535
|
+
removeVectorTile(id: number, key: number): void;
|
|
513
536
|
/**
|
|
514
537
|
* Draws a frame: the backdrop, the ground and the layers over it bottom to top, then the panorama and the
|
|
515
538
|
* viewshed; returns true while tiles are still loading (a new frame will be asked through `redraw`)
|
|
@@ -592,10 +615,10 @@ export class Engine {
|
|
|
592
615
|
*/
|
|
593
616
|
setFeatureRamp(id: number, rgba: Uint8Array | null | undefined, min: number, max: number): void;
|
|
594
617
|
/**
|
|
595
|
-
* Style of the features of a line, circle, fill or
|
|
596
|
-
* feature, its color (RGBA 0-1), its second color (a circle's stroke), then two sizes as zoom
|
|
597
|
-
* four values each): a line's width; a circle's radius and stroke width, CSS pixels; a block's
|
|
598
|
-
* height, metres
|
|
618
|
+
* Style of the features of a line, circle, fill, extrusion or vector tile layer (batch or tile `key` of the last
|
|
619
|
+
* two): 32 floats per feature, its color (RGBA 0-1), its second color (a circle's stroke), then two sizes as zoom
|
|
620
|
+
* stops (four zooms, four values each): a line's width; a circle's radius and stroke width, CSS pixels; a block's
|
|
621
|
+
* height and base height, metres
|
|
599
622
|
*/
|
|
600
623
|
setFeatureStyle(id: number, style: Float32Array, key?: number | null): void;
|
|
601
624
|
/**
|
|
@@ -612,6 +635,28 @@ export class Engine {
|
|
|
612
635
|
* of view of `fov` degrees. A camera set with `setCamera` turns around a point again
|
|
613
636
|
*/
|
|
614
637
|
setFirstPerson(lon: number, lat: number, height: number, bearing: number, pitch: number, fov: number): void;
|
|
638
|
+
/**
|
|
639
|
+
* How far a flow layer's field has gone towards its next one, 0 to 1 (the time between the model's two hours)
|
|
640
|
+
*/
|
|
641
|
+
setFlowBlend(id: number, blend: number): void;
|
|
642
|
+
/**
|
|
643
|
+
* The field of a flow layer: `width` × `height` points over `bounds` (west, south, east, north, degrees: the
|
|
644
|
+
* longitudes and latitudes of the corner points; a last column one step short of 360° round the world), their
|
|
645
|
+
* east and north components (m/s, row after row from the north; not a number: none there). On the grid of the
|
|
646
|
+
* field before, the particles go on (its next field and blend kept); on another one, they start again
|
|
647
|
+
*/
|
|
648
|
+
setFlowField(id: number, width: number, height: number, u: Float32Array, v: Float32Array, bounds: Float64Array): void;
|
|
649
|
+
/**
|
|
650
|
+
* The field a flow layer's goes towards, on its grid (the model's next hour: east and north components, row after
|
|
651
|
+
* row; empty: none), mixed in by `setFlowBlend`
|
|
652
|
+
*/
|
|
653
|
+
setFlowNext(id: number, u: Float32Array, v: Float32Array): void;
|
|
654
|
+
/**
|
|
655
|
+
* The look of a flow layer's trails: speeds (m/s) and their colors (RGBA 0-1, four numbers each), up to 8;
|
|
656
|
+
* width (CSS pixels), opacity, height over the ground (metres), speed on screen (pixels a second for 10 m/s),
|
|
657
|
+
* particles moving for each 100 × 100 CSS pixels of the view (at most the layer's)
|
|
658
|
+
*/
|
|
659
|
+
setFlowStyle(id: number, speeds: Float32Array, colors: Float32Array, width: number, opacity: number, height: number, speed: number, density: number): void;
|
|
615
660
|
/**
|
|
616
661
|
* Color of the globe under the tiles (polar caps)
|
|
617
662
|
*/
|
|
@@ -765,11 +810,22 @@ export class Engine {
|
|
|
765
810
|
* Space behind the globe (stars, atmosphere halo), in the globe projection
|
|
766
811
|
*/
|
|
767
812
|
setSky(enabled: boolean): void;
|
|
813
|
+
/**
|
|
814
|
+
* The sun casting shadows and the night: its azimuth (degrees clockwise from north) and altitude (degrees above
|
|
815
|
+
* the horizon), the shadows' opacity (0 to 1; none under the horizon or not a number), how dark the night is (0 to
|
|
816
|
+
* 1: the frame tinted, the lights of the layers on). Neither shadows nor night: nothing drawn
|
|
817
|
+
*
|
|
818
|
+
* # Errors
|
|
819
|
+
*
|
|
820
|
+
* Throws (to JavaScript) when a WebGL object cannot be created or the pass fails to compile
|
|
821
|
+
*/
|
|
822
|
+
setSun(azimuth: number, altitude: number, opacity: number, night: number): void;
|
|
768
823
|
/**
|
|
769
824
|
* Shows `layers` on one side of a vertical line only, the others beneath on the other side (comparing two states
|
|
770
|
-
* of a place): left of `x` (CSS pixels from the left of the canvas), or right of it;
|
|
825
|
+
* of a place): left of `x` (CSS pixels from the left of the canvas), or right of it; `others` on the other side
|
|
826
|
+
* only (two meshes of the same place, each on its side, never drawn over each other); a non-finite `x` stops
|
|
771
827
|
*/
|
|
772
|
-
setSwipe(x: number, right: boolean, layers: Uint32Array): void;
|
|
828
|
+
setSwipe(x: number, right: boolean, layers: Uint32Array, others: Uint32Array): void;
|
|
773
829
|
/**
|
|
774
830
|
* Layer-wide style of a symbol layer: size scale and opacity as zoom stops (four zooms then four values each),
|
|
775
831
|
* zoom range, visibility
|
|
@@ -812,6 +868,44 @@ export class Engine {
|
|
|
812
868
|
* for none: it tints the textures and colors the untextured meshes) of a 3D Tiles layer
|
|
813
869
|
*/
|
|
814
870
|
setTiles3dStyle(id: number, max_error: number, opacity: number, point_size: number | null | undefined, color: Float32Array): void;
|
|
871
|
+
/**
|
|
872
|
+
* The style layers of a vector tile layer, in drawing order: per layer, its kind (0 fill, 1 line, 2 extrusion), its zoom range
|
|
873
|
+
* (two numbers: shown from the first, included, to the second, excluded), whether it shows (0 or 1), its dashes
|
|
874
|
+
* (four numbers: dash, gap, dash, gap, in line widths; 0: solid), its opacity as zoom stops (four zooms then four
|
|
875
|
+
* values; missing: opaque), the caps of its lines' ends (0 butt, 1 round, 2 square; missing: round), whether its
|
|
876
|
+
* lines glow at night (streets; 0 or 1)
|
|
877
|
+
*/
|
|
878
|
+
setVectorSublayers(id: number, kinds: Uint8Array, zooms: Float64Array, visible: Uint8Array, dashes: Float32Array, opacities: Float32Array, caps: Uint8Array, lit: Uint8Array): void;
|
|
879
|
+
/**
|
|
880
|
+
* Adds or replaces tile `key` of a vector tile layer ready for the GPU, as the basemap workers make it (the
|
|
881
|
+
* tessellation module): its polygons as for `setVectorTile` (picked here; their prisms built here if drawn in
|
|
882
|
+
* relief while `prism` is false), the vertices of its fills (`shapes::Vertex` as bytes, each with its feature),
|
|
883
|
+
* their triangles, per sublayer its top cap and the rest of its prism (`fill_ranges`: four numbers, first and
|
|
884
|
+
* end of each), its line pieces (`pieces::Piece` as bytes), the line table (feature and length of each line),
|
|
885
|
+
* per sublayer its pieces (`line_ranges`: first, end), the blocks of its extrusion sublayers (`shapes::Block` as
|
|
886
|
+
* bytes), their triangles, per sublayer its blocks' triangles (`block_ranges`: first, end), the extent of its
|
|
887
|
+
* points (`bounds`: min x, min y, max x, max y), `feature_count` features
|
|
888
|
+
*
|
|
889
|
+
* # Errors
|
|
890
|
+
*
|
|
891
|
+
* Throws (to JavaScript) when the vertices, pieces or blocks are cut short, when a WebGL object of the tile cannot be
|
|
892
|
+
* created, or when its features or lines need a table texture past the GPU's `MAX_TEXTURE_SIZE`
|
|
893
|
+
*/
|
|
894
|
+
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_count: number): void;
|
|
895
|
+
/**
|
|
896
|
+
* Adds or replaces tile `key` of a vector tile layer: its polygons as for `addFills` (`fill_start`: the first
|
|
897
|
+
* polygon of each sublayer, and the end; those of an extrusion sublayer raised into blocks), its lines as for
|
|
898
|
+
* `addLines` (`line_start`: the first line of each sublayer, and the end), `feature_count` features, styled as an
|
|
899
|
+
* extrusion layer's (`setFeatureStyle` with the key: a color, then a line's width or a block's height and base);
|
|
900
|
+
* `tile`: the corners of the tile they are cut to (west, north, east, south; empty: none), along whose edges no
|
|
901
|
+
* wall of a block rises
|
|
902
|
+
*
|
|
903
|
+
* # Errors
|
|
904
|
+
*
|
|
905
|
+
* Throws (to JavaScript) when a WebGL object of the tile cannot be created, or when its features or lines need a
|
|
906
|
+
* table texture past the GPU's `MAX_TEXTURE_SIZE`
|
|
907
|
+
*/
|
|
908
|
+
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_count: number, tile: Float64Array): void;
|
|
815
909
|
/**
|
|
816
910
|
* Shows what can be seen from points, each within its range: `observers` holds 8 numbers per observer
|
|
817
911
|
* (16 at most): longitude, latitude (degrees), metres above the ground, range (metres), then to look one way
|
|
@@ -833,6 +927,10 @@ export class Engine {
|
|
|
833
927
|
* Tile counters of the raster layers, for diagnostics
|
|
834
928
|
*/
|
|
835
929
|
stats(): RasterLayerStats[];
|
|
930
|
+
/**
|
|
931
|
+
* Moves a flow layer's particles by `seconds` of the page's time (one animation frame), in the current view
|
|
932
|
+
*/
|
|
933
|
+
stepFlow(id: number, seconds: number): void;
|
|
836
934
|
/**
|
|
837
935
|
* The height above the relief (metres) of the top of what stands at a position (degrees): a roof, a mesh, 0 on
|
|
838
936
|
* the bare ground; undefined where nothing of the last frame is there. The scene is drawn from above into a single
|
|
@@ -880,6 +978,12 @@ export class Engine {
|
|
|
880
978
|
* A region of the icon atlas: `width` × `height` RGBA texels (premultiplied) at (`x`, `y`)
|
|
881
979
|
*/
|
|
882
980
|
updateIconAtlas(x: number, y: number, width: number, height: number, data: Uint8Array): void;
|
|
981
|
+
/**
|
|
982
|
+
* Vector tiles (512 CSS pixels across at their level, as `MapLibre`'s) for the view of the last frame (else the
|
|
983
|
+
* camera's), levels `min_z` to `max_z`, three numbers per tile (z, x, y), the nearest to the eye first: what a
|
|
984
|
+
* vector tile layer draws (`addVectorTiles`), coarser far away in a tilted view as the raster layers
|
|
985
|
+
*/
|
|
986
|
+
vectorTilesInView(min_z: number, max_z: number): Uint32Array;
|
|
883
987
|
/**
|
|
884
988
|
* Tiles a raster layer wants for the view of the last frame, three numbers per tile (z, x, y), the nearest to
|
|
885
989
|
* the eye first: the level each area of the ground is drawn at, for the labels of a vector style to follow it
|
|
@@ -916,6 +1020,7 @@ export interface InitOutput {
|
|
|
916
1020
|
readonly engine_addCustomLayer: (a: number, b: any, c: number) => number;
|
|
917
1021
|
readonly engine_addExtrusions: (a: number) => [number, number, number];
|
|
918
1022
|
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];
|
|
1023
|
+
readonly engine_addFlow: (a: number, b: number, c: number) => [number, number, number];
|
|
919
1024
|
readonly engine_addGround: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number, number];
|
|
920
1025
|
readonly engine_addLines: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number];
|
|
921
1026
|
readonly engine_addModels: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
@@ -924,6 +1029,7 @@ export interface InitOutput {
|
|
|
924
1029
|
readonly engine_addRaster: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number, number];
|
|
925
1030
|
readonly engine_addSymbols: (a: number) => [number, number, number];
|
|
926
1031
|
readonly engine_addTiles3d: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
|
|
1032
|
+
readonly engine_addVectorTiles: (a: number) => [number, number, number];
|
|
927
1033
|
readonly engine_bounds: (a: number) => [number, number];
|
|
928
1034
|
readonly engine_camera: (a: number) => any;
|
|
929
1035
|
readonly engine_clearPanorama: (a: number) => void;
|
|
@@ -948,6 +1054,7 @@ export interface InitOutput {
|
|
|
948
1054
|
readonly engine_project: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
949
1055
|
readonly engine_removeExtrusionBatch: (a: number, b: number, c: number) => void;
|
|
950
1056
|
readonly engine_removeLayer: (a: number, b: number) => void;
|
|
1057
|
+
readonly engine_removeVectorTile: (a: number, b: number, c: number) => void;
|
|
951
1058
|
readonly engine_render: (a: number) => number;
|
|
952
1059
|
readonly engine_requestPick: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
|
|
953
1060
|
readonly engine_resize: (a: number, b: number, c: number, d: number) => void;
|
|
@@ -967,6 +1074,10 @@ export interface InitOutput {
|
|
|
967
1074
|
readonly engine_setFeatureValues: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
968
1075
|
readonly engine_setFills: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
|
|
969
1076
|
readonly engine_setFirstPerson: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
1077
|
+
readonly engine_setFlowBlend: (a: number, b: number, c: number) => void;
|
|
1078
|
+
readonly engine_setFlowField: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
|
|
1079
|
+
readonly engine_setFlowNext: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
1080
|
+
readonly engine_setFlowStyle: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => void;
|
|
970
1081
|
readonly engine_setGlobe: (a: number, b: number) => void;
|
|
971
1082
|
readonly engine_setGlobeColor: (a: number, b: number, c: number, d: number) => void;
|
|
972
1083
|
readonly engine_setGlyphAtlas: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
@@ -992,15 +1103,20 @@ export interface InitOutput {
|
|
|
992
1103
|
readonly engine_setRasterStyle: (a: number, b: number, c: number, d: number) => void;
|
|
993
1104
|
readonly engine_setRequestHeaders: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
994
1105
|
readonly engine_setSky: (a: number, b: number) => void;
|
|
995
|
-
readonly
|
|
1106
|
+
readonly engine_setSun: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
1107
|
+
readonly engine_setSwipe: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
996
1108
|
readonly engine_setSymbolLayer: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
997
1109
|
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];
|
|
998
1110
|
readonly engine_setTerrain: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number];
|
|
999
1111
|
readonly engine_setTileLoader: (a: number, b: any) => void;
|
|
1000
1112
|
readonly engine_setTiles3dStyle: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
1113
|
+
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) => void;
|
|
1114
|
+
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) => [number, number];
|
|
1115
|
+
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) => [number, number];
|
|
1001
1116
|
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];
|
|
1002
1117
|
readonly engine_setZoomRange: (a: number, b: number, c: number) => void;
|
|
1003
1118
|
readonly engine_stats: (a: number) => any;
|
|
1119
|
+
readonly engine_stepFlow: (a: number, b: number, c: number) => void;
|
|
1004
1120
|
readonly engine_surface: (a: number, b: number, c: number) => any;
|
|
1005
1121
|
readonly engine_surfaceAt: (a: number, b: number, c: number) => any;
|
|
1006
1122
|
readonly engine_textureFormats: (a: number) => any;
|
|
@@ -1010,6 +1126,7 @@ export interface InitOutput {
|
|
|
1010
1126
|
readonly engine_updateGlyphPage: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
1011
1127
|
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];
|
|
1012
1128
|
readonly engine_updateIconAtlas: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
1129
|
+
readonly engine_vectorTilesInView: (a: number, b: number, c: number) => [number, number];
|
|
1013
1130
|
readonly engine_wantedTiles: (a: number, b: number) => [number, number];
|
|
1014
1131
|
readonly engine_zoomAt: (a: number, b: number, c: number, d: number) => void;
|
|
1015
1132
|
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;
|
package/dist/wasm/isard.js
CHANGED
|
@@ -97,6 +97,25 @@ export class Engine {
|
|
|
97
97
|
}
|
|
98
98
|
return ret[0] >>> 0;
|
|
99
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* A flow layer of `particles` particles (rounded up to a multiple of 4096) with trails of `trail` positions; its
|
|
102
|
+
* field comes with `setFlowField`
|
|
103
|
+
*
|
|
104
|
+
* # Errors
|
|
105
|
+
*
|
|
106
|
+
* Throws (to JavaScript) when a WebGL object cannot be created, a shader fails to compile or the trails need a
|
|
107
|
+
* table texture past the GPU's `MAX_TEXTURE_SIZE`
|
|
108
|
+
* @param {number} particles
|
|
109
|
+
* @param {number} trail
|
|
110
|
+
* @returns {number}
|
|
111
|
+
*/
|
|
112
|
+
addFlow(particles, trail) {
|
|
113
|
+
const ret = wasm.engine_addFlow(this.__wbg_ptr, particles, trail);
|
|
114
|
+
if (ret[2]) {
|
|
115
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
116
|
+
}
|
|
117
|
+
return ret[0] >>> 0;
|
|
118
|
+
}
|
|
100
119
|
/**
|
|
101
120
|
* Ground layer running `code` (GLSL ES 3.0 defining `vec4 ground(vec2 offset)`, see `render::ground`) over the
|
|
102
121
|
* ground; `anchor`: Mercator point the offsets are taken from; bounds: Mercator box it shows in. Compilation errors
|
|
@@ -301,6 +320,22 @@ export class Engine {
|
|
|
301
320
|
}
|
|
302
321
|
return ret[0] >>> 0;
|
|
303
322
|
}
|
|
323
|
+
/**
|
|
324
|
+
* An empty layer of vector tiles drawn as geometry: its style layers come with `setVectorSublayers`, its tiles
|
|
325
|
+
* with `setVectorTile`
|
|
326
|
+
*
|
|
327
|
+
* # Errors
|
|
328
|
+
*
|
|
329
|
+
* Throws (to JavaScript) when a shader fails to compile (the error carries its info log)
|
|
330
|
+
* @returns {number}
|
|
331
|
+
*/
|
|
332
|
+
addVectorTiles() {
|
|
333
|
+
const ret = wasm.engine_addVectorTiles(this.__wbg_ptr);
|
|
334
|
+
if (ret[2]) {
|
|
335
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
336
|
+
}
|
|
337
|
+
return ret[0] >>> 0;
|
|
338
|
+
}
|
|
304
339
|
/**
|
|
305
340
|
* Longitudes and latitudes the view covers on the ground, `[west, south, east, north]` (degrees): the screen's
|
|
306
341
|
* border cast on the ground, or on the far plane where it passes the horizon
|
|
@@ -554,6 +589,14 @@ export class Engine {
|
|
|
554
589
|
removeLayer(id) {
|
|
555
590
|
wasm.engine_removeLayer(this.__wbg_ptr, id);
|
|
556
591
|
}
|
|
592
|
+
/**
|
|
593
|
+
* Removes tile `key` of a vector tile layer (nothing if there is none)
|
|
594
|
+
* @param {number} id
|
|
595
|
+
* @param {number} key
|
|
596
|
+
*/
|
|
597
|
+
removeVectorTile(id, key) {
|
|
598
|
+
wasm.engine_removeVectorTile(this.__wbg_ptr, id, key);
|
|
599
|
+
}
|
|
557
600
|
/**
|
|
558
601
|
* Draws a frame: the backdrop, the ground and the layers over it bottom to top, then the panorama and the
|
|
559
602
|
* viewshed; returns true while tiles are still loading (a new frame will be asked through `redraw`)
|
|
@@ -752,10 +795,10 @@ export class Engine {
|
|
|
752
795
|
wasm.engine_setFeatureRamp(this.__wbg_ptr, id, ptr0, len0, min, max);
|
|
753
796
|
}
|
|
754
797
|
/**
|
|
755
|
-
* Style of the features of a line, circle, fill or
|
|
756
|
-
* feature, its color (RGBA 0-1), its second color (a circle's stroke), then two sizes as zoom
|
|
757
|
-
* four values each): a line's width; a circle's radius and stroke width, CSS pixels; a block's
|
|
758
|
-
* height, metres
|
|
798
|
+
* Style of the features of a line, circle, fill, extrusion or vector tile layer (batch or tile `key` of the last
|
|
799
|
+
* two): 32 floats per feature, its color (RGBA 0-1), its second color (a circle's stroke), then two sizes as zoom
|
|
800
|
+
* stops (four zooms, four values each): a line's width; a circle's radius and stroke width, CSS pixels; a block's
|
|
801
|
+
* height and base height, metres
|
|
759
802
|
* @param {number} id
|
|
760
803
|
* @param {Float32Array} style
|
|
761
804
|
* @param {number | null} [key]
|
|
@@ -809,6 +852,69 @@ export class Engine {
|
|
|
809
852
|
setFirstPerson(lon, lat, height, bearing, pitch, fov) {
|
|
810
853
|
wasm.engine_setFirstPerson(this.__wbg_ptr, lon, lat, height, bearing, pitch, fov);
|
|
811
854
|
}
|
|
855
|
+
/**
|
|
856
|
+
* How far a flow layer's field has gone towards its next one, 0 to 1 (the time between the model's two hours)
|
|
857
|
+
* @param {number} id
|
|
858
|
+
* @param {number} blend
|
|
859
|
+
*/
|
|
860
|
+
setFlowBlend(id, blend) {
|
|
861
|
+
wasm.engine_setFlowBlend(this.__wbg_ptr, id, blend);
|
|
862
|
+
}
|
|
863
|
+
/**
|
|
864
|
+
* The field of a flow layer: `width` × `height` points over `bounds` (west, south, east, north, degrees: the
|
|
865
|
+
* longitudes and latitudes of the corner points; a last column one step short of 360° round the world), their
|
|
866
|
+
* east and north components (m/s, row after row from the north; not a number: none there). On the grid of the
|
|
867
|
+
* field before, the particles go on (its next field and blend kept); on another one, they start again
|
|
868
|
+
* @param {number} id
|
|
869
|
+
* @param {number} width
|
|
870
|
+
* @param {number} height
|
|
871
|
+
* @param {Float32Array} u
|
|
872
|
+
* @param {Float32Array} v
|
|
873
|
+
* @param {Float64Array} bounds
|
|
874
|
+
*/
|
|
875
|
+
setFlowField(id, width, height, u, v, bounds) {
|
|
876
|
+
const ptr0 = passArrayF32ToWasm0(u, wasm.__wbindgen_malloc);
|
|
877
|
+
const len0 = WASM_VECTOR_LEN;
|
|
878
|
+
const ptr1 = passArrayF32ToWasm0(v, wasm.__wbindgen_malloc);
|
|
879
|
+
const len1 = WASM_VECTOR_LEN;
|
|
880
|
+
const ptr2 = passArrayF64ToWasm0(bounds, wasm.__wbindgen_malloc);
|
|
881
|
+
const len2 = WASM_VECTOR_LEN;
|
|
882
|
+
wasm.engine_setFlowField(this.__wbg_ptr, id, width, height, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
883
|
+
}
|
|
884
|
+
/**
|
|
885
|
+
* The field a flow layer's goes towards, on its grid (the model's next hour: east and north components, row after
|
|
886
|
+
* row; empty: none), mixed in by `setFlowBlend`
|
|
887
|
+
* @param {number} id
|
|
888
|
+
* @param {Float32Array} u
|
|
889
|
+
* @param {Float32Array} v
|
|
890
|
+
*/
|
|
891
|
+
setFlowNext(id, u, v) {
|
|
892
|
+
const ptr0 = passArrayF32ToWasm0(u, wasm.__wbindgen_malloc);
|
|
893
|
+
const len0 = WASM_VECTOR_LEN;
|
|
894
|
+
const ptr1 = passArrayF32ToWasm0(v, wasm.__wbindgen_malloc);
|
|
895
|
+
const len1 = WASM_VECTOR_LEN;
|
|
896
|
+
wasm.engine_setFlowNext(this.__wbg_ptr, id, ptr0, len0, ptr1, len1);
|
|
897
|
+
}
|
|
898
|
+
/**
|
|
899
|
+
* The look of a flow layer's trails: speeds (m/s) and their colors (RGBA 0-1, four numbers each), up to 8;
|
|
900
|
+
* width (CSS pixels), opacity, height over the ground (metres), speed on screen (pixels a second for 10 m/s),
|
|
901
|
+
* particles moving for each 100 × 100 CSS pixels of the view (at most the layer's)
|
|
902
|
+
* @param {number} id
|
|
903
|
+
* @param {Float32Array} speeds
|
|
904
|
+
* @param {Float32Array} colors
|
|
905
|
+
* @param {number} width
|
|
906
|
+
* @param {number} opacity
|
|
907
|
+
* @param {number} height
|
|
908
|
+
* @param {number} speed
|
|
909
|
+
* @param {number} density
|
|
910
|
+
*/
|
|
911
|
+
setFlowStyle(id, speeds, colors, width, opacity, height, speed, density) {
|
|
912
|
+
const ptr0 = passArrayF32ToWasm0(speeds, wasm.__wbindgen_malloc);
|
|
913
|
+
const len0 = WASM_VECTOR_LEN;
|
|
914
|
+
const ptr1 = passArrayF32ToWasm0(colors, wasm.__wbindgen_malloc);
|
|
915
|
+
const len1 = WASM_VECTOR_LEN;
|
|
916
|
+
wasm.engine_setFlowStyle(this.__wbg_ptr, id, ptr0, len0, ptr1, len1, width, opacity, height, speed, density);
|
|
917
|
+
}
|
|
812
918
|
/**
|
|
813
919
|
* Color of the globe under the tiles (polar caps)
|
|
814
920
|
* @param {number} r
|
|
@@ -1154,17 +1260,40 @@ export class Engine {
|
|
|
1154
1260
|
setSky(enabled) {
|
|
1155
1261
|
wasm.engine_setSky(this.__wbg_ptr, enabled);
|
|
1156
1262
|
}
|
|
1263
|
+
/**
|
|
1264
|
+
* The sun casting shadows and the night: its azimuth (degrees clockwise from north) and altitude (degrees above
|
|
1265
|
+
* the horizon), the shadows' opacity (0 to 1; none under the horizon or not a number), how dark the night is (0 to
|
|
1266
|
+
* 1: the frame tinted, the lights of the layers on). Neither shadows nor night: nothing drawn
|
|
1267
|
+
*
|
|
1268
|
+
* # Errors
|
|
1269
|
+
*
|
|
1270
|
+
* Throws (to JavaScript) when a WebGL object cannot be created or the pass fails to compile
|
|
1271
|
+
* @param {number} azimuth
|
|
1272
|
+
* @param {number} altitude
|
|
1273
|
+
* @param {number} opacity
|
|
1274
|
+
* @param {number} night
|
|
1275
|
+
*/
|
|
1276
|
+
setSun(azimuth, altitude, opacity, night) {
|
|
1277
|
+
const ret = wasm.engine_setSun(this.__wbg_ptr, azimuth, altitude, opacity, night);
|
|
1278
|
+
if (ret[1]) {
|
|
1279
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1157
1282
|
/**
|
|
1158
1283
|
* Shows `layers` on one side of a vertical line only, the others beneath on the other side (comparing two states
|
|
1159
|
-
* of a place): left of `x` (CSS pixels from the left of the canvas), or right of it;
|
|
1284
|
+
* of a place): left of `x` (CSS pixels from the left of the canvas), or right of it; `others` on the other side
|
|
1285
|
+
* only (two meshes of the same place, each on its side, never drawn over each other); a non-finite `x` stops
|
|
1160
1286
|
* @param {number} x
|
|
1161
1287
|
* @param {boolean} right
|
|
1162
1288
|
* @param {Uint32Array} layers
|
|
1289
|
+
* @param {Uint32Array} others
|
|
1163
1290
|
*/
|
|
1164
|
-
setSwipe(x, right, layers) {
|
|
1291
|
+
setSwipe(x, right, layers, others) {
|
|
1165
1292
|
const ptr0 = passArray32ToWasm0(layers, wasm.__wbindgen_malloc);
|
|
1166
1293
|
const len0 = WASM_VECTOR_LEN;
|
|
1167
|
-
|
|
1294
|
+
const ptr1 = passArray32ToWasm0(others, wasm.__wbindgen_malloc);
|
|
1295
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1296
|
+
wasm.engine_setSwipe(this.__wbg_ptr, x, right, ptr0, len0, ptr1, len1);
|
|
1168
1297
|
}
|
|
1169
1298
|
/**
|
|
1170
1299
|
* Layer-wide style of a symbol layer: size scale and opacity as zoom stops (four zooms then four values each),
|
|
@@ -1262,6 +1391,160 @@ export class Engine {
|
|
|
1262
1391
|
const len0 = WASM_VECTOR_LEN;
|
|
1263
1392
|
wasm.engine_setTiles3dStyle(this.__wbg_ptr, id, max_error, opacity, !isLikeNone(point_size), isLikeNone(point_size) ? 0 : point_size, ptr0, len0);
|
|
1264
1393
|
}
|
|
1394
|
+
/**
|
|
1395
|
+
* The style layers of a vector tile layer, in drawing order: per layer, its kind (0 fill, 1 line, 2 extrusion), its zoom range
|
|
1396
|
+
* (two numbers: shown from the first, included, to the second, excluded), whether it shows (0 or 1), its dashes
|
|
1397
|
+
* (four numbers: dash, gap, dash, gap, in line widths; 0: solid), its opacity as zoom stops (four zooms then four
|
|
1398
|
+
* values; missing: opaque), the caps of its lines' ends (0 butt, 1 round, 2 square; missing: round), whether its
|
|
1399
|
+
* lines glow at night (streets; 0 or 1)
|
|
1400
|
+
* @param {number} id
|
|
1401
|
+
* @param {Uint8Array} kinds
|
|
1402
|
+
* @param {Float64Array} zooms
|
|
1403
|
+
* @param {Uint8Array} visible
|
|
1404
|
+
* @param {Float32Array} dashes
|
|
1405
|
+
* @param {Float32Array} opacities
|
|
1406
|
+
* @param {Uint8Array} caps
|
|
1407
|
+
* @param {Uint8Array} lit
|
|
1408
|
+
*/
|
|
1409
|
+
setVectorSublayers(id, kinds, zooms, visible, dashes, opacities, caps, lit) {
|
|
1410
|
+
const ptr0 = passArray8ToWasm0(kinds, wasm.__wbindgen_malloc);
|
|
1411
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1412
|
+
const ptr1 = passArrayF64ToWasm0(zooms, wasm.__wbindgen_malloc);
|
|
1413
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1414
|
+
const ptr2 = passArray8ToWasm0(visible, wasm.__wbindgen_malloc);
|
|
1415
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1416
|
+
const ptr3 = passArrayF32ToWasm0(dashes, wasm.__wbindgen_malloc);
|
|
1417
|
+
const len3 = WASM_VECTOR_LEN;
|
|
1418
|
+
const ptr4 = passArrayF32ToWasm0(opacities, wasm.__wbindgen_malloc);
|
|
1419
|
+
const len4 = WASM_VECTOR_LEN;
|
|
1420
|
+
const ptr5 = passArray8ToWasm0(caps, wasm.__wbindgen_malloc);
|
|
1421
|
+
const len5 = WASM_VECTOR_LEN;
|
|
1422
|
+
const ptr6 = passArray8ToWasm0(lit, wasm.__wbindgen_malloc);
|
|
1423
|
+
const len6 = WASM_VECTOR_LEN;
|
|
1424
|
+
wasm.engine_setVectorSublayers(this.__wbg_ptr, id, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6);
|
|
1425
|
+
}
|
|
1426
|
+
/**
|
|
1427
|
+
* Adds or replaces tile `key` of a vector tile layer ready for the GPU, as the basemap workers make it (the
|
|
1428
|
+
* tessellation module): its polygons as for `setVectorTile` (picked here; their prisms built here if drawn in
|
|
1429
|
+
* relief while `prism` is false), the vertices of its fills (`shapes::Vertex` as bytes, each with its feature),
|
|
1430
|
+
* their triangles, per sublayer its top cap and the rest of its prism (`fill_ranges`: four numbers, first and
|
|
1431
|
+
* end of each), its line pieces (`pieces::Piece` as bytes), the line table (feature and length of each line),
|
|
1432
|
+
* per sublayer its pieces (`line_ranges`: first, end), the blocks of its extrusion sublayers (`shapes::Block` as
|
|
1433
|
+
* bytes), their triangles, per sublayer its blocks' triangles (`block_ranges`: first, end), the extent of its
|
|
1434
|
+
* points (`bounds`: min x, min y, max x, max y), `feature_count` features
|
|
1435
|
+
*
|
|
1436
|
+
* # Errors
|
|
1437
|
+
*
|
|
1438
|
+
* Throws (to JavaScript) when the vertices, pieces or blocks are cut short, when a WebGL object of the tile cannot be
|
|
1439
|
+
* created, or when its features or lines need a table texture past the GPU's `MAX_TEXTURE_SIZE`
|
|
1440
|
+
* @param {number} id
|
|
1441
|
+
* @param {number} key
|
|
1442
|
+
* @param {Float64Array} points
|
|
1443
|
+
* @param {Uint32Array} ring_start
|
|
1444
|
+
* @param {Uint32Array} polygon_start
|
|
1445
|
+
* @param {Uint32Array} polygon_feature
|
|
1446
|
+
* @param {Uint32Array} fill_start
|
|
1447
|
+
* @param {Uint8Array} vertices
|
|
1448
|
+
* @param {Uint32Array} indices
|
|
1449
|
+
* @param {Uint32Array} fill_ranges
|
|
1450
|
+
* @param {boolean} prism
|
|
1451
|
+
* @param {Uint8Array} pieces
|
|
1452
|
+
* @param {Float32Array} line_table
|
|
1453
|
+
* @param {Uint32Array} line_ranges
|
|
1454
|
+
* @param {Uint8Array} blocks
|
|
1455
|
+
* @param {Uint32Array} block_indices
|
|
1456
|
+
* @param {Uint32Array} block_ranges
|
|
1457
|
+
* @param {Float64Array} bounds
|
|
1458
|
+
* @param {number} feature_count
|
|
1459
|
+
*/
|
|
1460
|
+
setVectorTileMesh(id, key, points, ring_start, polygon_start, polygon_feature, fill_start, vertices, indices, fill_ranges, prism, pieces, line_table, line_ranges, blocks, block_indices, block_ranges, bounds, feature_count) {
|
|
1461
|
+
const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
|
|
1462
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1463
|
+
const ptr1 = passArray32ToWasm0(ring_start, wasm.__wbindgen_malloc);
|
|
1464
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1465
|
+
const ptr2 = passArray32ToWasm0(polygon_start, wasm.__wbindgen_malloc);
|
|
1466
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1467
|
+
const ptr3 = passArray32ToWasm0(polygon_feature, wasm.__wbindgen_malloc);
|
|
1468
|
+
const len3 = WASM_VECTOR_LEN;
|
|
1469
|
+
const ptr4 = passArray32ToWasm0(fill_start, wasm.__wbindgen_malloc);
|
|
1470
|
+
const len4 = WASM_VECTOR_LEN;
|
|
1471
|
+
const ptr5 = passArray8ToWasm0(vertices, wasm.__wbindgen_malloc);
|
|
1472
|
+
const len5 = WASM_VECTOR_LEN;
|
|
1473
|
+
const ptr6 = passArray32ToWasm0(indices, wasm.__wbindgen_malloc);
|
|
1474
|
+
const len6 = WASM_VECTOR_LEN;
|
|
1475
|
+
const ptr7 = passArray32ToWasm0(fill_ranges, wasm.__wbindgen_malloc);
|
|
1476
|
+
const len7 = WASM_VECTOR_LEN;
|
|
1477
|
+
const ptr8 = passArray8ToWasm0(pieces, wasm.__wbindgen_malloc);
|
|
1478
|
+
const len8 = WASM_VECTOR_LEN;
|
|
1479
|
+
const ptr9 = passArrayF32ToWasm0(line_table, wasm.__wbindgen_malloc);
|
|
1480
|
+
const len9 = WASM_VECTOR_LEN;
|
|
1481
|
+
const ptr10 = passArray32ToWasm0(line_ranges, wasm.__wbindgen_malloc);
|
|
1482
|
+
const len10 = WASM_VECTOR_LEN;
|
|
1483
|
+
const ptr11 = passArray8ToWasm0(blocks, wasm.__wbindgen_malloc);
|
|
1484
|
+
const len11 = WASM_VECTOR_LEN;
|
|
1485
|
+
const ptr12 = passArray32ToWasm0(block_indices, wasm.__wbindgen_malloc);
|
|
1486
|
+
const len12 = WASM_VECTOR_LEN;
|
|
1487
|
+
const ptr13 = passArray32ToWasm0(block_ranges, wasm.__wbindgen_malloc);
|
|
1488
|
+
const len13 = WASM_VECTOR_LEN;
|
|
1489
|
+
const ptr14 = passArrayF64ToWasm0(bounds, wasm.__wbindgen_malloc);
|
|
1490
|
+
const len14 = WASM_VECTOR_LEN;
|
|
1491
|
+
const ret = wasm.engine_setVectorTileMesh(this.__wbg_ptr, id, key, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6, ptr7, len7, prism, ptr8, len8, ptr9, len9, ptr10, len10, ptr11, len11, ptr12, len12, ptr13, len13, ptr14, len14, feature_count);
|
|
1492
|
+
if (ret[1]) {
|
|
1493
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
/**
|
|
1497
|
+
* Adds or replaces tile `key` of a vector tile layer: its polygons as for `addFills` (`fill_start`: the first
|
|
1498
|
+
* polygon of each sublayer, and the end; those of an extrusion sublayer raised into blocks), its lines as for
|
|
1499
|
+
* `addLines` (`line_start`: the first line of each sublayer, and the end), `feature_count` features, styled as an
|
|
1500
|
+
* extrusion layer's (`setFeatureStyle` with the key: a color, then a line's width or a block's height and base);
|
|
1501
|
+
* `tile`: the corners of the tile they are cut to (west, north, east, south; empty: none), along whose edges no
|
|
1502
|
+
* wall of a block rises
|
|
1503
|
+
*
|
|
1504
|
+
* # Errors
|
|
1505
|
+
*
|
|
1506
|
+
* Throws (to JavaScript) when a WebGL object of the tile cannot be created, or when its features or lines need a
|
|
1507
|
+
* table texture past the GPU's `MAX_TEXTURE_SIZE`
|
|
1508
|
+
* @param {number} id
|
|
1509
|
+
* @param {number} key
|
|
1510
|
+
* @param {Float64Array} points
|
|
1511
|
+
* @param {Uint32Array} ring_start
|
|
1512
|
+
* @param {Uint32Array} polygon_start
|
|
1513
|
+
* @param {Uint32Array} polygon_feature
|
|
1514
|
+
* @param {Uint32Array} fill_start
|
|
1515
|
+
* @param {Float64Array} line_points
|
|
1516
|
+
* @param {Uint32Array} line_first
|
|
1517
|
+
* @param {Uint32Array} line_feature
|
|
1518
|
+
* @param {Uint32Array} line_start
|
|
1519
|
+
* @param {number} feature_count
|
|
1520
|
+
* @param {Float64Array} tile
|
|
1521
|
+
*/
|
|
1522
|
+
setVectorTile(id, key, points, ring_start, polygon_start, polygon_feature, fill_start, line_points, line_first, line_feature, line_start, feature_count, tile) {
|
|
1523
|
+
const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
|
|
1524
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1525
|
+
const ptr1 = passArray32ToWasm0(ring_start, wasm.__wbindgen_malloc);
|
|
1526
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1527
|
+
const ptr2 = passArray32ToWasm0(polygon_start, wasm.__wbindgen_malloc);
|
|
1528
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1529
|
+
const ptr3 = passArray32ToWasm0(polygon_feature, wasm.__wbindgen_malloc);
|
|
1530
|
+
const len3 = WASM_VECTOR_LEN;
|
|
1531
|
+
const ptr4 = passArray32ToWasm0(fill_start, wasm.__wbindgen_malloc);
|
|
1532
|
+
const len4 = WASM_VECTOR_LEN;
|
|
1533
|
+
const ptr5 = passArrayF64ToWasm0(line_points, wasm.__wbindgen_malloc);
|
|
1534
|
+
const len5 = WASM_VECTOR_LEN;
|
|
1535
|
+
const ptr6 = passArray32ToWasm0(line_first, wasm.__wbindgen_malloc);
|
|
1536
|
+
const len6 = WASM_VECTOR_LEN;
|
|
1537
|
+
const ptr7 = passArray32ToWasm0(line_feature, wasm.__wbindgen_malloc);
|
|
1538
|
+
const len7 = WASM_VECTOR_LEN;
|
|
1539
|
+
const ptr8 = passArray32ToWasm0(line_start, wasm.__wbindgen_malloc);
|
|
1540
|
+
const len8 = WASM_VECTOR_LEN;
|
|
1541
|
+
const ptr9 = passArrayF64ToWasm0(tile, wasm.__wbindgen_malloc);
|
|
1542
|
+
const len9 = WASM_VECTOR_LEN;
|
|
1543
|
+
const ret = wasm.engine_setVectorTile(this.__wbg_ptr, id, key, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6, ptr7, len7, ptr8, len8, feature_count, ptr9, len9);
|
|
1544
|
+
if (ret[1]) {
|
|
1545
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1265
1548
|
/**
|
|
1266
1549
|
* Shows what can be seen from points, each within its range: `observers` holds 8 numbers per observer
|
|
1267
1550
|
* (16 at most): longitude, latitude (degrees), metres above the ground, range (metres), then to look one way
|
|
@@ -1309,6 +1592,14 @@ export class Engine {
|
|
|
1309
1592
|
const ret = wasm.engine_stats(this.__wbg_ptr);
|
|
1310
1593
|
return ret;
|
|
1311
1594
|
}
|
|
1595
|
+
/**
|
|
1596
|
+
* Moves a flow layer's particles by `seconds` of the page's time (one animation frame), in the current view
|
|
1597
|
+
* @param {number} id
|
|
1598
|
+
* @param {number} seconds
|
|
1599
|
+
*/
|
|
1600
|
+
stepFlow(id, seconds) {
|
|
1601
|
+
wasm.engine_stepFlow(this.__wbg_ptr, id, seconds);
|
|
1602
|
+
}
|
|
1312
1603
|
/**
|
|
1313
1604
|
* The height above the relief (metres) of the top of what stands at a position (degrees): a roof, a mesh, 0 on
|
|
1314
1605
|
* the bare ground; undefined where nothing of the last frame is there. The scene is drawn from above into a single
|
|
@@ -1428,6 +1719,20 @@ export class Engine {
|
|
|
1428
1719
|
const len0 = WASM_VECTOR_LEN;
|
|
1429
1720
|
wasm.engine_updateIconAtlas(this.__wbg_ptr, x, y, width, height, ptr0, len0);
|
|
1430
1721
|
}
|
|
1722
|
+
/**
|
|
1723
|
+
* Vector tiles (512 CSS pixels across at their level, as `MapLibre`'s) for the view of the last frame (else the
|
|
1724
|
+
* camera's), levels `min_z` to `max_z`, three numbers per tile (z, x, y), the nearest to the eye first: what a
|
|
1725
|
+
* vector tile layer draws (`addVectorTiles`), coarser far away in a tilted view as the raster layers
|
|
1726
|
+
* @param {number} min_z
|
|
1727
|
+
* @param {number} max_z
|
|
1728
|
+
* @returns {Uint32Array}
|
|
1729
|
+
*/
|
|
1730
|
+
vectorTilesInView(min_z, max_z) {
|
|
1731
|
+
const ret = wasm.engine_vectorTilesInView(this.__wbg_ptr, min_z, max_z);
|
|
1732
|
+
var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
|
|
1733
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
1734
|
+
return v1;
|
|
1735
|
+
}
|
|
1431
1736
|
/**
|
|
1432
1737
|
* Tiles a raster layer wants for the view of the last frame, three numbers per tile (z, x, y), the nearest to
|
|
1433
1738
|
* the eye first: the level each area of the ground is drawn at, for the labels of a vector style to follow it
|
|
@@ -2324,6 +2629,12 @@ function __wbg_get_imports() {
|
|
|
2324
2629
|
__wbg_pixelStorei_cb4e43466f5b8703: function(arg0, arg1, arg2) {
|
|
2325
2630
|
arg0.pixelStorei(arg1 >>> 0, arg2);
|
|
2326
2631
|
},
|
|
2632
|
+
__wbg_polygonOffset_81dc8ca84e29572b: function(arg0, arg1, arg2) {
|
|
2633
|
+
arg0.polygonOffset(arg1, arg2);
|
|
2634
|
+
},
|
|
2635
|
+
__wbg_polygonOffset_8f922d9173d8849d: function(arg0, arg1, arg2) {
|
|
2636
|
+
arg0.polygonOffset(arg1, arg2);
|
|
2637
|
+
},
|
|
2327
2638
|
__wbg_prototypesetcall_06eb15da165dee8f: function(arg0, arg1, arg2) {
|
|
2328
2639
|
Uint32Array.prototype.set.call(getArrayU32FromWasm0(arg0, arg1), arg2);
|
|
2329
2640
|
},
|
|
@@ -2687,7 +2998,7 @@ function __wbg_get_imports() {
|
|
|
2687
2998
|
return ret;
|
|
2688
2999
|
},
|
|
2689
3000
|
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
2690
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
3001
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 218, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
2691
3002
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_2e566c63402fe7fa___convert__closures_____invoke___wasm_bindgen_2e566c63402fe7fa___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_2e566c63402fe7fa___JsError___true_);
|
|
2692
3003
|
return ret;
|
|
2693
3004
|
},
|