isard 1.14.0 → 1.16.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.
@@ -215,7 +215,7 @@ export class Engine {
215
215
  /**
216
216
  * Raster tiles in Web Mercator; `url` holds {z}, {x} and {y}. `size`: side of the tiles' textures (256 by
217
217
  * default); `loader`: draws each tile instead of fetching `url`, `(z, x, y, signal) => Promise<ImageBitmap |
218
- * null>`, an image of `size` × `size` (null: nothing there)
218
+ * null>`, an image of `size` × `size` (null: nothing there); `ground: false`: draped on 3D layers only
219
219
  *
220
220
  * # Errors
221
221
  *
@@ -227,12 +227,13 @@ export class Engine {
227
227
  * @param {number} saturation
228
228
  * @param {number | null | undefined} size
229
229
  * @param {((z: number, x: number, y: number, signal: AbortSignal) => Promise<ImageBitmap | null>) | undefined} loader
230
+ * @param {boolean | null} [ground]
230
231
  * @returns {number}
231
232
  */
232
- addRaster(url, min_z, max_z, opacity, saturation, size, loader) {
233
+ addRaster(url, min_z, max_z, opacity, saturation, size, loader, ground) {
233
234
  const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
234
235
  const len0 = WASM_VECTOR_LEN;
235
- const ret = wasm.engine_addRaster(this.__wbg_ptr, ptr0, len0, min_z, max_z, opacity, saturation, isLikeNone(size) ? Number.MAX_SAFE_INTEGER : (size) >> 0, isLikeNone(loader) ? 0 : addToExternrefTable0(loader));
236
+ const ret = wasm.engine_addRaster(this.__wbg_ptr, ptr0, len0, min_z, max_z, opacity, saturation, isLikeNone(size) ? Number.MAX_SAFE_INTEGER : (size) >> 0, isLikeNone(loader) ? 0 : addToExternrefTable0(loader), isLikeNone(ground) ? 0xFFFFFF : ground ? 1 : 0);
236
237
  if (ret[2]) {
237
238
  throw takeFromExternrefTable0(ret[1]);
238
239
  }
@@ -403,7 +404,7 @@ export class Engine {
403
404
  return ret;
404
405
  }
405
406
  /**
406
- * `redraw` is called when the engine needs a new frame (a tile arrived)
407
+ * `redraw` is called when the engine needs a new frame (a tile arrived); `antialias`: multisampled (default true)
407
408
  *
408
409
  * # Errors
409
410
  *
@@ -411,9 +412,10 @@ export class Engine {
411
412
  * object of the globe, the sky or the raster pass cannot be created or one of their shaders fails to compile
412
413
  * @param {HTMLCanvasElement} canvas
413
414
  * @param {() => void} redraw
415
+ * @param {boolean | null} [antialias]
414
416
  */
415
- constructor(canvas, redraw) {
416
- const ret = wasm.engine_new(canvas, redraw);
417
+ constructor(canvas, redraw, antialias) {
418
+ const ret = wasm.engine_new(canvas, redraw, isLikeNone(antialias) ? 0xFFFFFF : antialias ? 1 : 0);
417
419
  if (ret[2]) {
418
420
  throw takeFromExternrefTable0(ret[1]);
419
421
  }
@@ -1310,7 +1312,7 @@ export class Engine {
1310
1312
  * end of each), its line pieces (`pieces::Piece` as bytes), the line table (feature and length of each line),
1311
1313
  * per sublayer its pieces (`line_ranges`: first, end), the blocks of its extrusion sublayers (`shapes::Block` as
1312
1314
  * bytes), their triangles, per sublayer its blocks' triangles (`block_ranges`: first, end), the extent of its
1313
- * points (`bounds`: min x, min y, max x, max y), `feature_count` features
1315
+ * points (`bounds`: min x, min y, max x, max y), its features' sublayers (one each, as for `setVectorTile`)
1314
1316
  *
1315
1317
  * # Errors
1316
1318
  *
@@ -1334,9 +1336,9 @@ export class Engine {
1334
1336
  * @param {Uint32Array} block_indices
1335
1337
  * @param {Uint32Array} block_ranges
1336
1338
  * @param {Float64Array} bounds
1337
- * @param {number} feature_count
1339
+ * @param {Uint16Array} feature_sublayer
1338
1340
  */
1339
- 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) {
1341
+ 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_sublayer) {
1340
1342
  const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
1341
1343
  const len0 = WASM_VECTOR_LEN;
1342
1344
  const ptr1 = passArray32ToWasm0(ring_start, wasm.__wbindgen_malloc);
@@ -1367,7 +1369,9 @@ export class Engine {
1367
1369
  const len13 = WASM_VECTOR_LEN;
1368
1370
  const ptr14 = passArrayF64ToWasm0(bounds, wasm.__wbindgen_malloc);
1369
1371
  const len14 = WASM_VECTOR_LEN;
1370
- 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);
1372
+ const ptr15 = passArray16ToWasm0(feature_sublayer, wasm.__wbindgen_malloc);
1373
+ const len15 = WASM_VECTOR_LEN;
1374
+ 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, ptr15, len15);
1371
1375
  if (ret[1]) {
1372
1376
  throw takeFromExternrefTable0(ret[0]);
1373
1377
  }
@@ -1394,7 +1398,8 @@ export class Engine {
1394
1398
  /**
1395
1399
  * Adds or replaces tile `key` of a vector tile layer: its polygons as for `addFills` (`fill_start`: the first
1396
1400
  * polygon of each sublayer, and the end; those of an extrusion sublayer raised into blocks), its lines as for
1397
- * `addLines` (`line_start`: the first line of each sublayer, and the end), `feature_count` features, styled as an
1401
+ * `addLines` (`line_start`: the first line of each sublayer, and the end), its features' sublayers (one each, the
1402
+ * features of a sublayer after those of the one before), styled as an
1398
1403
  * extrusion layer's (`setFeatureStyle` with the key: a color, then a line's width or a block's height and base);
1399
1404
  * `tile`: the corners of the tile they are cut to (west, north, east, south; empty: none), along whose edges no
1400
1405
  * wall of a block rises; `roofs` and `roof_heights`: per polygon, the shape and height of its block's roof
@@ -1418,7 +1423,7 @@ export class Engine {
1418
1423
  * @param {Uint32Array} line_first
1419
1424
  * @param {Uint32Array} line_feature
1420
1425
  * @param {Uint32Array} line_start
1421
- * @param {number} feature_count
1426
+ * @param {Uint16Array} feature_sublayer
1422
1427
  * @param {Float64Array} tile
1423
1428
  * @param {Uint8Array} roofs
1424
1429
  * @param {Float32Array} roof_heights
@@ -1426,7 +1431,7 @@ export class Engine {
1426
1431
  * @param {Uint32Array} roof_outline_start
1427
1432
  * @param {number} roof_metres
1428
1433
  */
1429
- setVectorTile(id, key, points, ring_start, polygon_start, polygon_feature, fill_start, line_points, line_first, line_feature, line_start, feature_count, tile, roofs, roof_heights, roof_outlines, roof_outline_start, roof_metres) {
1434
+ setVectorTile(id, key, points, ring_start, polygon_start, polygon_feature, fill_start, line_points, line_first, line_feature, line_start, feature_sublayer, tile, roofs, roof_heights, roof_outlines, roof_outline_start, roof_metres) {
1430
1435
  const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
1431
1436
  const len0 = WASM_VECTOR_LEN;
1432
1437
  const ptr1 = passArray32ToWasm0(ring_start, wasm.__wbindgen_malloc);
@@ -1445,17 +1450,19 @@ export class Engine {
1445
1450
  const len7 = WASM_VECTOR_LEN;
1446
1451
  const ptr8 = passArray32ToWasm0(line_start, wasm.__wbindgen_malloc);
1447
1452
  const len8 = WASM_VECTOR_LEN;
1448
- const ptr9 = passArrayF64ToWasm0(tile, wasm.__wbindgen_malloc);
1453
+ const ptr9 = passArray16ToWasm0(feature_sublayer, wasm.__wbindgen_malloc);
1449
1454
  const len9 = WASM_VECTOR_LEN;
1450
- const ptr10 = passArray8ToWasm0(roofs, wasm.__wbindgen_malloc);
1455
+ const ptr10 = passArrayF64ToWasm0(tile, wasm.__wbindgen_malloc);
1451
1456
  const len10 = WASM_VECTOR_LEN;
1452
- const ptr11 = passArrayF32ToWasm0(roof_heights, wasm.__wbindgen_malloc);
1457
+ const ptr11 = passArray8ToWasm0(roofs, wasm.__wbindgen_malloc);
1453
1458
  const len11 = WASM_VECTOR_LEN;
1454
- const ptr12 = passArrayF64ToWasm0(roof_outlines, wasm.__wbindgen_malloc);
1459
+ const ptr12 = passArrayF32ToWasm0(roof_heights, wasm.__wbindgen_malloc);
1455
1460
  const len12 = WASM_VECTOR_LEN;
1456
- const ptr13 = passArray32ToWasm0(roof_outline_start, wasm.__wbindgen_malloc);
1461
+ const ptr13 = passArrayF64ToWasm0(roof_outlines, wasm.__wbindgen_malloc);
1457
1462
  const len13 = WASM_VECTOR_LEN;
1458
- 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, ptr10, len10, ptr11, len11, ptr12, len12, ptr13, len13, roof_metres);
1463
+ const ptr14 = passArray32ToWasm0(roof_outline_start, wasm.__wbindgen_malloc);
1464
+ const len14 = WASM_VECTOR_LEN;
1465
+ 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, ptr9, len9, ptr10, len10, ptr11, len11, ptr12, len12, ptr13, len13, ptr14, len14, roof_metres);
1459
1466
  if (ret[1]) {
1460
1467
  throw takeFromExternrefTable0(ret[0]);
1461
1468
  }
@@ -2231,6 +2238,14 @@ function __wbg_get_imports() {
2231
2238
  const ret = arg0.isContextLost();
2232
2239
  return ret;
2233
2240
  },
2241
+ __wbg_isEnabled_a3522bc4076e6296: function(arg0, arg1) {
2242
+ const ret = arg0.isEnabled(arg1 >>> 0);
2243
+ return ret;
2244
+ },
2245
+ __wbg_isEnabled_acb9d89bd88c16bd: function(arg0, arg1) {
2246
+ const ret = arg0.isEnabled(arg1 >>> 0);
2247
+ return ret;
2248
+ },
2234
2249
  __wbg_is_4b278c0bd3caba97: function(arg0, arg1) {
2235
2250
  const ret = Object.is(arg0, arg1);
2236
2251
  return ret;
@@ -2672,7 +2687,7 @@ function __wbg_get_imports() {
2672
2687
  return ret;
2673
2688
  },
2674
2689
  __wbindgen_generic_0000000000000001: function(arg0, arg1) {
2675
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 119, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
2690
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 122, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
2676
2691
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_2e566c63402fe7fa___convert__closures_____invoke___wasm_bindgen_2e566c63402fe7fa___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_2e566c63402fe7fa___JsError___true_);
2677
2692
  return ret;
2678
2693
  },
@@ -2995,6 +3010,13 @@ function makeMutClosure(arg0, arg1, f) {
2995
3010
  return real;
2996
3011
  }
2997
3012
 
3013
+ function passArray16ToWasm0(arg, malloc) {
3014
+ const ptr = malloc(arg.length * 2, 2) >>> 0;
3015
+ getUint16ArrayMemory0().set(arg, ptr / 2);
3016
+ WASM_VECTOR_LEN = arg.length;
3017
+ return ptr;
3018
+ }
3019
+
2998
3020
  function passArray32ToWasm0(arg, malloc) {
2999
3021
  const ptr = malloc(arg.length * 4, 4) >>> 0;
3000
3022
  getUint32ArrayMemory0().set(arg, ptr / 4);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isard",
3
- "version": "1.14.0",
3
+ "version": "1.16.0",
4
4
  "description": "A WebGL2 map engine for large, interactive data layers, labels and 3D Tiles over raster or vector basemaps (Rust core in WebAssembly)",
5
5
  "license": "MIT",
6
6
  "author": "Kevin Graff",