isard 1.2.0 → 1.3.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 (94) hide show
  1. package/CHANGELOG.md +88 -0
  2. package/README.md +44 -39
  3. package/dist/basemap/pmtileslayer.d.ts +33 -0
  4. package/dist/basemap/pmtileslayer.js +97 -0
  5. package/dist/basemap/pmtileslayer.js.map +1 -0
  6. package/dist/basemap/trees.d.ts +26 -0
  7. package/dist/basemap/trees.js +141 -0
  8. package/dist/basemap/trees.js.map +1 -0
  9. package/dist/basemap/vectorstyle.d.ts +10 -0
  10. package/dist/basemap/vectorstyle.js +35 -0
  11. package/dist/basemap/vectorstyle.js.map +1 -1
  12. package/dist/basemap/vectortiles.d.ts +67 -44
  13. package/dist/basemap/vectortiles.js +386 -302
  14. package/dist/basemap/vectortiles.js.map +1 -1
  15. package/dist/basemap/workerpool.d.ts +17 -0
  16. package/dist/basemap/workerpool.js +194 -0
  17. package/dist/basemap/workerpool.js.map +1 -0
  18. package/dist/basemap.worker.js +2 -2
  19. package/dist/basemap.worker.js.map +15 -8
  20. package/dist/decoder.worker.js +4 -4
  21. package/dist/decoder.worker.js.map +3 -3
  22. package/dist/engine-loader.d.ts +5 -1
  23. package/dist/engine-loader.js +11 -1
  24. package/dist/engine-loader.js.map +1 -1
  25. package/dist/geoplateforme.d.ts +16 -0
  26. package/dist/geoplateforme.js +23 -0
  27. package/dist/geoplateforme.js.map +1 -1
  28. package/dist/index.d.ts +11 -4
  29. package/dist/index.js +9 -2
  30. package/dist/index.js.map +1 -1
  31. package/dist/isard_bg.wasm +0 -0
  32. package/dist/isard_core_bg.wasm +0 -0
  33. package/dist/isard_tess_bg.wasm +0 -0
  34. package/dist/layers/layers.js +9 -0
  35. package/dist/layers/layers.js.map +1 -1
  36. package/dist/layers/vectors.d.ts +60 -0
  37. package/dist/layers/vectors.js +130 -0
  38. package/dist/layers/vectors.js.map +1 -0
  39. package/dist/map/frame-loop.d.ts +3 -0
  40. package/dist/map/frame-loop.js +6 -0
  41. package/dist/map/frame-loop.js.map +1 -1
  42. package/dist/map/raster-source.js +1 -1
  43. package/dist/map/raster-source.js.map +1 -1
  44. package/dist/map/workers.d.ts +1 -1
  45. package/dist/map/workers.js +1 -1
  46. package/dist/map/workers.js.map +1 -1
  47. package/dist/map.d.ts +21 -6
  48. package/dist/map.js +65 -11
  49. package/dist/map.js.map +1 -1
  50. package/dist/react/IsardMap.js +1 -0
  51. package/dist/react/IsardMap.js.map +1 -1
  52. package/dist/react/Swipe.d.ts +11 -4
  53. package/dist/react/Swipe.js +26 -15
  54. package/dist/react/Swipe.js.map +1 -1
  55. package/dist/react/VectorGeometry.d.ts +35 -0
  56. package/dist/react/VectorGeometry.js +82 -0
  57. package/dist/react/VectorGeometry.js.map +1 -0
  58. package/dist/react/context.d.ts +2 -1
  59. package/dist/react/context.js.map +1 -1
  60. package/dist/react/index.d.ts +2 -1
  61. package/dist/react/index.js +2 -1
  62. package/dist/react/index.js.map +1 -1
  63. package/dist/types.d.ts +24 -1
  64. package/dist/types.js.map +1 -1
  65. package/dist/ui/minimap.d.ts +25 -0
  66. package/dist/ui/minimap.js +90 -0
  67. package/dist/ui/minimap.js.map +1 -0
  68. package/dist/ui/scale.d.ts +19 -0
  69. package/dist/ui/scale.js +44 -0
  70. package/dist/ui/scale.js.map +1 -0
  71. package/dist/ui/search.d.ts +25 -0
  72. package/dist/ui/search.js +119 -0
  73. package/dist/ui/search.js.map +1 -0
  74. package/dist/ui/style.js +17 -0
  75. package/dist/ui/style.js.map +1 -1
  76. package/dist/util/sun.d.ts +11 -0
  77. package/dist/util/sun.js +26 -0
  78. package/dist/util/sun.js.map +1 -0
  79. package/dist/wasm/isard.d.ts +82 -7
  80. package/dist/wasm/isard.js +229 -8
  81. package/dist/wasm/isard_core.d.ts +82 -7
  82. package/dist/wasm/isard_core.js +229 -8
  83. package/dist/wasm/isard_tess.d.ts +109 -0
  84. package/dist/wasm/isard_tess.js +398 -0
  85. package/dist/workers/basemap/geometry.d.ts +72 -0
  86. package/dist/workers/basemap/labels.d.ts +8 -0
  87. package/dist/workers/basemap/raster.d.ts +10 -0
  88. package/dist/workers/basemap/tiles.d.ts +65 -0
  89. package/dist/workers/basemap/trees.d.ts +19 -0
  90. package/dist/workers/basemap.worker.d.ts +126 -22
  91. package/dist/workers/basemap.worker.js +72 -551
  92. package/dist/workers/basemap.worker.js.map +1 -1
  93. package/package.json +5 -4
  94. package/vite.js +10 -2
@@ -301,6 +301,22 @@ export class Engine {
301
301
  }
302
302
  return ret[0] >>> 0;
303
303
  }
304
+ /**
305
+ * An empty layer of vector tiles drawn as geometry: its style layers come with `setVectorSublayers`, its tiles
306
+ * with `setVectorTile`
307
+ *
308
+ * # Errors
309
+ *
310
+ * Throws (to JavaScript) when a shader fails to compile (the error carries its info log)
311
+ * @returns {number}
312
+ */
313
+ addVectorTiles() {
314
+ const ret = wasm.engine_addVectorTiles(this.__wbg_ptr);
315
+ if (ret[2]) {
316
+ throw takeFromExternrefTable0(ret[1]);
317
+ }
318
+ return ret[0] >>> 0;
319
+ }
304
320
  /**
305
321
  * Longitudes and latitudes the view covers on the ground, `[west, south, east, north]` (degrees): the screen's
306
322
  * border cast on the ground, or on the far plane where it passes the horizon
@@ -554,6 +570,14 @@ export class Engine {
554
570
  removeLayer(id) {
555
571
  wasm.engine_removeLayer(this.__wbg_ptr, id);
556
572
  }
573
+ /**
574
+ * Removes tile `key` of a vector tile layer (nothing if there is none)
575
+ * @param {number} id
576
+ * @param {number} key
577
+ */
578
+ removeVectorTile(id, key) {
579
+ wasm.engine_removeVectorTile(this.__wbg_ptr, id, key);
580
+ }
557
581
  /**
558
582
  * Draws a frame: the backdrop, the ground and the layers over it bottom to top, then the panorama and the
559
583
  * viewshed; returns true while tiles are still loading (a new frame will be asked through `redraw`)
@@ -752,10 +776,10 @@ export class Engine {
752
776
  wasm.engine_setFeatureRamp(this.__wbg_ptr, id, ptr0, len0, min, max);
753
777
  }
754
778
  /**
755
- * Style of the features of a line, circle, fill or extrusion layer (batch `key` of the latter): 32 floats per
756
- * feature, its color (RGBA 0-1), its second color (a circle's stroke), then two sizes as zoom stops (four zooms,
757
- * four values each): a line's width; a circle's radius and stroke width, CSS pixels; a block's height and base
758
- * height, metres
779
+ * Style of the features of a line, circle, fill, extrusion or vector tile layer (batch or tile `key` of the last
780
+ * two): 32 floats per feature, its color (RGBA 0-1), its second color (a circle's stroke), then two sizes as zoom
781
+ * stops (four zooms, four values each): a line's width; a circle's radius and stroke width, CSS pixels; a block's
782
+ * height and base height, metres
759
783
  * @param {number} id
760
784
  * @param {Float32Array} style
761
785
  * @param {number | null} [key]
@@ -1154,17 +1178,40 @@ export class Engine {
1154
1178
  setSky(enabled) {
1155
1179
  wasm.engine_setSky(this.__wbg_ptr, enabled);
1156
1180
  }
1181
+ /**
1182
+ * The sun casting shadows and the night: its azimuth (degrees clockwise from north) and altitude (degrees above
1183
+ * the horizon), the shadows' opacity (0 to 1; none under the horizon or not a number), how dark the night is (0 to
1184
+ * 1: the frame tinted, the lights of the layers on). Neither shadows nor night: nothing drawn
1185
+ *
1186
+ * # Errors
1187
+ *
1188
+ * Throws (to JavaScript) when a WebGL object cannot be created or the pass fails to compile
1189
+ * @param {number} azimuth
1190
+ * @param {number} altitude
1191
+ * @param {number} opacity
1192
+ * @param {number} night
1193
+ */
1194
+ setSun(azimuth, altitude, opacity, night) {
1195
+ const ret = wasm.engine_setSun(this.__wbg_ptr, azimuth, altitude, opacity, night);
1196
+ if (ret[1]) {
1197
+ throw takeFromExternrefTable0(ret[0]);
1198
+ }
1199
+ }
1157
1200
  /**
1158
1201
  * 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; a non-finite `x` stops
1202
+ * of a place): left of `x` (CSS pixels from the left of the canvas), or right of it; `others` on the other side
1203
+ * only (two meshes of the same place, each on its side, never drawn over each other); a non-finite `x` stops
1160
1204
  * @param {number} x
1161
1205
  * @param {boolean} right
1162
1206
  * @param {Uint32Array} layers
1207
+ * @param {Uint32Array} others
1163
1208
  */
1164
- setSwipe(x, right, layers) {
1209
+ setSwipe(x, right, layers, others) {
1165
1210
  const ptr0 = passArray32ToWasm0(layers, wasm.__wbindgen_malloc);
1166
1211
  const len0 = WASM_VECTOR_LEN;
1167
- wasm.engine_setSwipe(this.__wbg_ptr, x, right, ptr0, len0);
1212
+ const ptr1 = passArray32ToWasm0(others, wasm.__wbindgen_malloc);
1213
+ const len1 = WASM_VECTOR_LEN;
1214
+ wasm.engine_setSwipe(this.__wbg_ptr, x, right, ptr0, len0, ptr1, len1);
1168
1215
  }
1169
1216
  /**
1170
1217
  * Layer-wide style of a symbol layer: size scale and opacity as zoom stops (four zooms then four values each),
@@ -1262,6 +1309,160 @@ export class Engine {
1262
1309
  const len0 = WASM_VECTOR_LEN;
1263
1310
  wasm.engine_setTiles3dStyle(this.__wbg_ptr, id, max_error, opacity, !isLikeNone(point_size), isLikeNone(point_size) ? 0 : point_size, ptr0, len0);
1264
1311
  }
1312
+ /**
1313
+ * The style layers of a vector tile layer, in drawing order: per layer, its kind (0 fill, 1 line, 2 extrusion), its zoom range
1314
+ * (two numbers: shown from the first, included, to the second, excluded), whether it shows (0 or 1), its dashes
1315
+ * (four numbers: dash, gap, dash, gap, in line widths; 0: solid), its opacity as zoom stops (four zooms then four
1316
+ * values; missing: opaque), the caps of its lines' ends (0 butt, 1 round, 2 square; missing: round), whether its
1317
+ * lines glow at night (streets; 0 or 1)
1318
+ * @param {number} id
1319
+ * @param {Uint8Array} kinds
1320
+ * @param {Float64Array} zooms
1321
+ * @param {Uint8Array} visible
1322
+ * @param {Float32Array} dashes
1323
+ * @param {Float32Array} opacities
1324
+ * @param {Uint8Array} caps
1325
+ * @param {Uint8Array} lit
1326
+ */
1327
+ setVectorSublayers(id, kinds, zooms, visible, dashes, opacities, caps, lit) {
1328
+ const ptr0 = passArray8ToWasm0(kinds, wasm.__wbindgen_malloc);
1329
+ const len0 = WASM_VECTOR_LEN;
1330
+ const ptr1 = passArrayF64ToWasm0(zooms, wasm.__wbindgen_malloc);
1331
+ const len1 = WASM_VECTOR_LEN;
1332
+ const ptr2 = passArray8ToWasm0(visible, wasm.__wbindgen_malloc);
1333
+ const len2 = WASM_VECTOR_LEN;
1334
+ const ptr3 = passArrayF32ToWasm0(dashes, wasm.__wbindgen_malloc);
1335
+ const len3 = WASM_VECTOR_LEN;
1336
+ const ptr4 = passArrayF32ToWasm0(opacities, wasm.__wbindgen_malloc);
1337
+ const len4 = WASM_VECTOR_LEN;
1338
+ const ptr5 = passArray8ToWasm0(caps, wasm.__wbindgen_malloc);
1339
+ const len5 = WASM_VECTOR_LEN;
1340
+ const ptr6 = passArray8ToWasm0(lit, wasm.__wbindgen_malloc);
1341
+ const len6 = WASM_VECTOR_LEN;
1342
+ wasm.engine_setVectorSublayers(this.__wbg_ptr, id, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6);
1343
+ }
1344
+ /**
1345
+ * Adds or replaces tile `key` of a vector tile layer ready for the GPU, as the basemap workers make it (the
1346
+ * tessellation module): its polygons as for `setVectorTile` (picked here; their prisms built here if drawn in
1347
+ * relief while `prism` is false), the vertices of its fills (`shapes::Vertex` as bytes, each with its feature),
1348
+ * their triangles, per sublayer its top cap and the rest of its prism (`fill_ranges`: four numbers, first and
1349
+ * end of each), its line pieces (`pieces::Piece` as bytes), the line table (feature and length of each line),
1350
+ * per sublayer its pieces (`line_ranges`: first, end), the blocks of its extrusion sublayers (`shapes::Block` as
1351
+ * bytes), their triangles, per sublayer its blocks' triangles (`block_ranges`: first, end), the extent of its
1352
+ * points (`bounds`: min x, min y, max x, max y), `feature_count` features
1353
+ *
1354
+ * # Errors
1355
+ *
1356
+ * Throws (to JavaScript) when the vertices, pieces or blocks are cut short, when a WebGL object of the tile cannot be
1357
+ * created, or when its features or lines need a table texture past the GPU's `MAX_TEXTURE_SIZE`
1358
+ * @param {number} id
1359
+ * @param {number} key
1360
+ * @param {Float64Array} points
1361
+ * @param {Uint32Array} ring_start
1362
+ * @param {Uint32Array} polygon_start
1363
+ * @param {Uint32Array} polygon_feature
1364
+ * @param {Uint32Array} fill_start
1365
+ * @param {Uint8Array} vertices
1366
+ * @param {Uint32Array} indices
1367
+ * @param {Uint32Array} fill_ranges
1368
+ * @param {boolean} prism
1369
+ * @param {Uint8Array} pieces
1370
+ * @param {Float32Array} line_table
1371
+ * @param {Uint32Array} line_ranges
1372
+ * @param {Uint8Array} blocks
1373
+ * @param {Uint32Array} block_indices
1374
+ * @param {Uint32Array} block_ranges
1375
+ * @param {Float64Array} bounds
1376
+ * @param {number} feature_count
1377
+ */
1378
+ 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) {
1379
+ const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
1380
+ const len0 = WASM_VECTOR_LEN;
1381
+ const ptr1 = passArray32ToWasm0(ring_start, wasm.__wbindgen_malloc);
1382
+ const len1 = WASM_VECTOR_LEN;
1383
+ const ptr2 = passArray32ToWasm0(polygon_start, wasm.__wbindgen_malloc);
1384
+ const len2 = WASM_VECTOR_LEN;
1385
+ const ptr3 = passArray32ToWasm0(polygon_feature, wasm.__wbindgen_malloc);
1386
+ const len3 = WASM_VECTOR_LEN;
1387
+ const ptr4 = passArray32ToWasm0(fill_start, wasm.__wbindgen_malloc);
1388
+ const len4 = WASM_VECTOR_LEN;
1389
+ const ptr5 = passArray8ToWasm0(vertices, wasm.__wbindgen_malloc);
1390
+ const len5 = WASM_VECTOR_LEN;
1391
+ const ptr6 = passArray32ToWasm0(indices, wasm.__wbindgen_malloc);
1392
+ const len6 = WASM_VECTOR_LEN;
1393
+ const ptr7 = passArray32ToWasm0(fill_ranges, wasm.__wbindgen_malloc);
1394
+ const len7 = WASM_VECTOR_LEN;
1395
+ const ptr8 = passArray8ToWasm0(pieces, wasm.__wbindgen_malloc);
1396
+ const len8 = WASM_VECTOR_LEN;
1397
+ const ptr9 = passArrayF32ToWasm0(line_table, wasm.__wbindgen_malloc);
1398
+ const len9 = WASM_VECTOR_LEN;
1399
+ const ptr10 = passArray32ToWasm0(line_ranges, wasm.__wbindgen_malloc);
1400
+ const len10 = WASM_VECTOR_LEN;
1401
+ const ptr11 = passArray8ToWasm0(blocks, wasm.__wbindgen_malloc);
1402
+ const len11 = WASM_VECTOR_LEN;
1403
+ const ptr12 = passArray32ToWasm0(block_indices, wasm.__wbindgen_malloc);
1404
+ const len12 = WASM_VECTOR_LEN;
1405
+ const ptr13 = passArray32ToWasm0(block_ranges, wasm.__wbindgen_malloc);
1406
+ const len13 = WASM_VECTOR_LEN;
1407
+ const ptr14 = passArrayF64ToWasm0(bounds, wasm.__wbindgen_malloc);
1408
+ const len14 = WASM_VECTOR_LEN;
1409
+ 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);
1410
+ if (ret[1]) {
1411
+ throw takeFromExternrefTable0(ret[0]);
1412
+ }
1413
+ }
1414
+ /**
1415
+ * Adds or replaces tile `key` of a vector tile layer: its polygons as for `addFills` (`fill_start`: the first
1416
+ * polygon of each sublayer, and the end; those of an extrusion sublayer raised into blocks), its lines as for
1417
+ * `addLines` (`line_start`: the first line of each sublayer, and the end), `feature_count` features, styled as an
1418
+ * extrusion layer's (`setFeatureStyle` with the key: a color, then a line's width or a block's height and base);
1419
+ * `tile`: the corners of the tile they are cut to (west, north, east, south; empty: none), along whose edges no
1420
+ * wall of a block rises
1421
+ *
1422
+ * # Errors
1423
+ *
1424
+ * Throws (to JavaScript) when a WebGL object of the tile cannot be created, or when its features or lines need a
1425
+ * table texture past the GPU's `MAX_TEXTURE_SIZE`
1426
+ * @param {number} id
1427
+ * @param {number} key
1428
+ * @param {Float64Array} points
1429
+ * @param {Uint32Array} ring_start
1430
+ * @param {Uint32Array} polygon_start
1431
+ * @param {Uint32Array} polygon_feature
1432
+ * @param {Uint32Array} fill_start
1433
+ * @param {Float64Array} line_points
1434
+ * @param {Uint32Array} line_first
1435
+ * @param {Uint32Array} line_feature
1436
+ * @param {Uint32Array} line_start
1437
+ * @param {number} feature_count
1438
+ * @param {Float64Array} tile
1439
+ */
1440
+ setVectorTile(id, key, points, ring_start, polygon_start, polygon_feature, fill_start, line_points, line_first, line_feature, line_start, feature_count, tile) {
1441
+ const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
1442
+ const len0 = WASM_VECTOR_LEN;
1443
+ const ptr1 = passArray32ToWasm0(ring_start, wasm.__wbindgen_malloc);
1444
+ const len1 = WASM_VECTOR_LEN;
1445
+ const ptr2 = passArray32ToWasm0(polygon_start, wasm.__wbindgen_malloc);
1446
+ const len2 = WASM_VECTOR_LEN;
1447
+ const ptr3 = passArray32ToWasm0(polygon_feature, wasm.__wbindgen_malloc);
1448
+ const len3 = WASM_VECTOR_LEN;
1449
+ const ptr4 = passArray32ToWasm0(fill_start, wasm.__wbindgen_malloc);
1450
+ const len4 = WASM_VECTOR_LEN;
1451
+ const ptr5 = passArrayF64ToWasm0(line_points, wasm.__wbindgen_malloc);
1452
+ const len5 = WASM_VECTOR_LEN;
1453
+ const ptr6 = passArray32ToWasm0(line_first, wasm.__wbindgen_malloc);
1454
+ const len6 = WASM_VECTOR_LEN;
1455
+ const ptr7 = passArray32ToWasm0(line_feature, wasm.__wbindgen_malloc);
1456
+ const len7 = WASM_VECTOR_LEN;
1457
+ const ptr8 = passArray32ToWasm0(line_start, wasm.__wbindgen_malloc);
1458
+ const len8 = WASM_VECTOR_LEN;
1459
+ const ptr9 = passArrayF64ToWasm0(tile, wasm.__wbindgen_malloc);
1460
+ const len9 = WASM_VECTOR_LEN;
1461
+ 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);
1462
+ if (ret[1]) {
1463
+ throw takeFromExternrefTable0(ret[0]);
1464
+ }
1465
+ }
1265
1466
  /**
1266
1467
  * Shows what can be seen from points, each within its range: `observers` holds 8 numbers per observer
1267
1468
  * (16 at most): longitude, latitude (degrees), metres above the ground, range (metres), then to look one way
@@ -1428,6 +1629,20 @@ export class Engine {
1428
1629
  const len0 = WASM_VECTOR_LEN;
1429
1630
  wasm.engine_updateIconAtlas(this.__wbg_ptr, x, y, width, height, ptr0, len0);
1430
1631
  }
1632
+ /**
1633
+ * Vector tiles (512 CSS pixels across at their level, as `MapLibre`'s) for the view of the last frame (else the
1634
+ * camera's), levels `min_z` to `max_z`, three numbers per tile (z, x, y), the nearest to the eye first: what a
1635
+ * vector tile layer draws (`addVectorTiles`), coarser far away in a tilted view as the raster layers
1636
+ * @param {number} min_z
1637
+ * @param {number} max_z
1638
+ * @returns {Uint32Array}
1639
+ */
1640
+ vectorTilesInView(min_z, max_z) {
1641
+ const ret = wasm.engine_vectorTilesInView(this.__wbg_ptr, min_z, max_z);
1642
+ var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
1643
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1644
+ return v1;
1645
+ }
1431
1646
  /**
1432
1647
  * Tiles a raster layer wants for the view of the last frame, three numbers per tile (z, x, y), the nearest to
1433
1648
  * 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 +2539,12 @@ function __wbg_get_imports() {
2324
2539
  __wbg_pixelStorei_cb4e43466f5b8703: function(arg0, arg1, arg2) {
2325
2540
  arg0.pixelStorei(arg1 >>> 0, arg2);
2326
2541
  },
2542
+ __wbg_polygonOffset_81dc8ca84e29572b: function(arg0, arg1, arg2) {
2543
+ arg0.polygonOffset(arg1, arg2);
2544
+ },
2545
+ __wbg_polygonOffset_8f922d9173d8849d: function(arg0, arg1, arg2) {
2546
+ arg0.polygonOffset(arg1, arg2);
2547
+ },
2327
2548
  __wbg_prototypesetcall_06eb15da165dee8f: function(arg0, arg1, arg2) {
2328
2549
  Uint32Array.prototype.set.call(getArrayU32FromWasm0(arg0, arg1), arg2);
2329
2550
  },
@@ -2687,7 +2908,7 @@ function __wbg_get_imports() {
2687
2908
  return ret;
2688
2909
  },
2689
2910
  __wbindgen_generic_0000000000000001: function(arg0, arg1) {
2690
- // 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`.
2911
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 214, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
2691
2912
  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
2913
  return ret;
2693
2914
  },
@@ -156,6 +156,15 @@ export class Engine {
156
156
  * info log)
157
157
  */
158
158
  addSymbols(): number;
159
+ /**
160
+ * An empty layer of vector tiles drawn as geometry: its style layers come with `setVectorSublayers`, its tiles
161
+ * with `setVectorTile`
162
+ *
163
+ * # Errors
164
+ *
165
+ * Throws (to JavaScript) when a shader fails to compile (the error carries its info log)
166
+ */
167
+ addVectorTiles(): number;
159
168
  /**
160
169
  * Longitudes and latitudes the view covers on the ground, `[west, south, east, north]` (degrees): the screen's
161
170
  * border cast on the ground, or on the far plane where it passes the horizon
@@ -256,6 +265,10 @@ export class Engine {
256
265
  * Removes a layer and frees its GPU objects; the other layers forget it (a layer that referred to it)
257
266
  */
258
267
  removeLayer(id: number): void;
268
+ /**
269
+ * Removes tile `key` of a vector tile layer (nothing if there is none)
270
+ */
271
+ removeVectorTile(id: number, key: number): void;
259
272
  /**
260
273
  * Draws a frame: the backdrop, the ground and the layers over it bottom to top, then the panorama and the
261
274
  * viewshed; returns true while tiles are still loading (a new frame will be asked through `redraw`)
@@ -338,10 +351,10 @@ export class Engine {
338
351
  */
339
352
  setFeatureRamp(id: number, rgba: Uint8Array | null | undefined, min: number, max: number): void;
340
353
  /**
341
- * Style of the features of a line, circle, fill or extrusion layer (batch `key` of the latter): 32 floats per
342
- * feature, its color (RGBA 0-1), its second color (a circle's stroke), then two sizes as zoom stops (four zooms,
343
- * four values each): a line's width; a circle's radius and stroke width, CSS pixels; a block's height and base
344
- * height, metres
354
+ * Style of the features of a line, circle, fill, extrusion or vector tile layer (batch or tile `key` of the last
355
+ * two): 32 floats per feature, its color (RGBA 0-1), its second color (a circle's stroke), then two sizes as zoom
356
+ * stops (four zooms, four values each): a line's width; a circle's radius and stroke width, CSS pixels; a block's
357
+ * height and base height, metres
345
358
  */
346
359
  setFeatureStyle(id: number, style: Float32Array, key?: number | null): void;
347
360
  /**
@@ -481,11 +494,22 @@ export class Engine {
481
494
  * Space behind the globe (stars, atmosphere halo), in the globe projection
482
495
  */
483
496
  setSky(enabled: boolean): void;
497
+ /**
498
+ * The sun casting shadows and the night: its azimuth (degrees clockwise from north) and altitude (degrees above
499
+ * the horizon), the shadows' opacity (0 to 1; none under the horizon or not a number), how dark the night is (0 to
500
+ * 1: the frame tinted, the lights of the layers on). Neither shadows nor night: nothing drawn
501
+ *
502
+ * # Errors
503
+ *
504
+ * Throws (to JavaScript) when a WebGL object cannot be created or the pass fails to compile
505
+ */
506
+ setSun(azimuth: number, altitude: number, opacity: number, night: number): void;
484
507
  /**
485
508
  * Shows `layers` on one side of a vertical line only, the others beneath on the other side (comparing two states
486
- * of a place): left of `x` (CSS pixels from the left of the canvas), or right of it; a non-finite `x` stops
509
+ * of a place): left of `x` (CSS pixels from the left of the canvas), or right of it; `others` on the other side
510
+ * only (two meshes of the same place, each on its side, never drawn over each other); a non-finite `x` stops
487
511
  */
488
- setSwipe(x: number, right: boolean, layers: Uint32Array): void;
512
+ setSwipe(x: number, right: boolean, layers: Uint32Array, others: Uint32Array): void;
489
513
  /**
490
514
  * Layer-wide style of a symbol layer: size scale and opacity as zoom stops (four zooms then four values each),
491
515
  * zoom range, visibility
@@ -517,6 +541,44 @@ export class Engine {
517
541
  * Throws (to JavaScript) when the texture holding the relief's tiles cannot be created
518
542
  */
519
543
  setTerrain(url: string | null | undefined, exaggeration: number, max_z: number | null | undefined, geoid: boolean | null | undefined, loader: ((z: number, x: number, y: number, signal: AbortSignal) => Promise<Float32Array | null>) | undefined): void;
544
+ /**
545
+ * The style layers of a vector tile layer, in drawing order: per layer, its kind (0 fill, 1 line, 2 extrusion), its zoom range
546
+ * (two numbers: shown from the first, included, to the second, excluded), whether it shows (0 or 1), its dashes
547
+ * (four numbers: dash, gap, dash, gap, in line widths; 0: solid), its opacity as zoom stops (four zooms then four
548
+ * values; missing: opaque), the caps of its lines' ends (0 butt, 1 round, 2 square; missing: round), whether its
549
+ * lines glow at night (streets; 0 or 1)
550
+ */
551
+ setVectorSublayers(id: number, kinds: Uint8Array, zooms: Float64Array, visible: Uint8Array, dashes: Float32Array, opacities: Float32Array, caps: Uint8Array, lit: Uint8Array): void;
552
+ /**
553
+ * Adds or replaces tile `key` of a vector tile layer ready for the GPU, as the basemap workers make it (the
554
+ * tessellation module): its polygons as for `setVectorTile` (picked here; their prisms built here if drawn in
555
+ * relief while `prism` is false), the vertices of its fills (`shapes::Vertex` as bytes, each with its feature),
556
+ * their triangles, per sublayer its top cap and the rest of its prism (`fill_ranges`: four numbers, first and
557
+ * end of each), its line pieces (`pieces::Piece` as bytes), the line table (feature and length of each line),
558
+ * per sublayer its pieces (`line_ranges`: first, end), the blocks of its extrusion sublayers (`shapes::Block` as
559
+ * bytes), their triangles, per sublayer its blocks' triangles (`block_ranges`: first, end), the extent of its
560
+ * points (`bounds`: min x, min y, max x, max y), `feature_count` features
561
+ *
562
+ * # Errors
563
+ *
564
+ * Throws (to JavaScript) when the vertices, pieces or blocks are cut short, when a WebGL object of the tile cannot be
565
+ * created, or when its features or lines need a table texture past the GPU's `MAX_TEXTURE_SIZE`
566
+ */
567
+ 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;
568
+ /**
569
+ * Adds or replaces tile `key` of a vector tile layer: its polygons as for `addFills` (`fill_start`: the first
570
+ * polygon of each sublayer, and the end; those of an extrusion sublayer raised into blocks), its lines as for
571
+ * `addLines` (`line_start`: the first line of each sublayer, and the end), `feature_count` features, styled as an
572
+ * extrusion layer's (`setFeatureStyle` with the key: a color, then a line's width or a block's height and base);
573
+ * `tile`: the corners of the tile they are cut to (west, north, east, south; empty: none), along whose edges no
574
+ * wall of a block rises
575
+ *
576
+ * # Errors
577
+ *
578
+ * Throws (to JavaScript) when a WebGL object of the tile cannot be created, or when its features or lines need a
579
+ * table texture past the GPU's `MAX_TEXTURE_SIZE`
580
+ */
581
+ 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;
520
582
  /**
521
583
  * Shows what can be seen from points, each within its range: `observers` holds 8 numbers per observer
522
584
  * (16 at most): longitude, latitude (degrees), metres above the ground, range (metres), then to look one way
@@ -571,6 +633,12 @@ export class Engine {
571
633
  * A region of the icon atlas: `width` × `height` RGBA texels (premultiplied) at (`x`, `y`)
572
634
  */
573
635
  updateIconAtlas(x: number, y: number, width: number, height: number, data: Uint8Array): void;
636
+ /**
637
+ * Vector tiles (512 CSS pixels across at their level, as `MapLibre`'s) for the view of the last frame (else the
638
+ * camera's), levels `min_z` to `max_z`, three numbers per tile (z, x, y), the nearest to the eye first: what a
639
+ * vector tile layer draws (`addVectorTiles`), coarser far away in a tilted view as the raster layers
640
+ */
641
+ vectorTilesInView(min_z: number, max_z: number): Uint32Array;
574
642
  /**
575
643
  * Tiles a raster layer wants for the view of the last frame, three numbers per tile (z, x, y), the nearest to
576
644
  * the eye first: the level each area of the ground is drawn at, for the labels of a vector style to follow it
@@ -596,6 +664,7 @@ export interface InitOutput {
596
664
  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];
597
665
  readonly engine_addRaster: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number, number];
598
666
  readonly engine_addSymbols: (a: number) => [number, number, number];
667
+ readonly engine_addVectorTiles: (a: number) => [number, number, number];
599
668
  readonly engine_bounds: (a: number) => [number, number];
600
669
  readonly engine_camera: (a: number) => any;
601
670
  readonly engine_clearPreload: (a: number) => void;
@@ -616,6 +685,7 @@ export interface InitOutput {
616
685
  readonly engine_project: (a: number, b: number, c: number, d: number, e: number) => any;
617
686
  readonly engine_removeExtrusionBatch: (a: number, b: number, c: number) => void;
618
687
  readonly engine_removeLayer: (a: number, b: number) => void;
688
+ readonly engine_removeVectorTile: (a: number, b: number, c: number) => void;
619
689
  readonly engine_render: (a: number) => number;
620
690
  readonly engine_requestPick: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
621
691
  readonly engine_resize: (a: number, b: number, c: number, d: number) => void;
@@ -656,10 +726,14 @@ export interface InitOutput {
656
726
  readonly engine_setRasterStyle: (a: number, b: number, c: number, d: number) => void;
657
727
  readonly engine_setRequestHeaders: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
658
728
  readonly engine_setSky: (a: number, b: number) => void;
659
- readonly engine_setSwipe: (a: number, b: number, c: number, d: number, e: number) => void;
729
+ readonly engine_setSun: (a: number, b: number, c: number, d: number, e: number) => [number, number];
730
+ readonly engine_setSwipe: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
660
731
  readonly engine_setSymbolLayer: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
661
732
  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];
662
733
  readonly engine_setTerrain: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number];
734
+ 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;
735
+ 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];
736
+ 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];
663
737
  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];
664
738
  readonly engine_setZoomRange: (a: number, b: number, c: number) => void;
665
739
  readonly engine_stats: (a: number) => any;
@@ -669,6 +743,7 @@ export interface InitOutput {
669
743
  readonly engine_updateGlyphPage: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
670
744
  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];
671
745
  readonly engine_updateIconAtlas: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
746
+ readonly engine_vectorTilesInView: (a: number, b: number, c: number) => [number, number];
672
747
  readonly engine_wantedTiles: (a: number, b: number) => [number, number];
673
748
  readonly engine_zoomAt: (a: number, b: number, c: number, d: number) => void;
674
749
  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;