isard 1.5.0 → 1.6.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 +165 -1
- package/README.md +3 -2
- package/dist/basemap/furniture.d.ts +8 -0
- package/dist/basemap/furniture.js +26 -0
- package/dist/basemap/furniture.js.map +1 -0
- package/dist/basemap/trees.d.ts +35 -8
- package/dist/basemap/trees.js +105 -52
- package/dist/basemap/trees.js.map +1 -1
- package/dist/basemap/vectorstyle.d.ts +9 -3
- package/dist/basemap/vectorstyle.js +5 -6
- package/dist/basemap/vectorstyle.js.map +1 -1
- package/dist/basemap/vectortiles/context.d.ts +3 -0
- package/dist/basemap/vectortiles/context.js.map +1 -1
- package/dist/basemap/vectortiles/extrusions.d.ts +4 -0
- package/dist/basemap/vectortiles/extrusions.js +17 -2
- package/dist/basemap/vectortiles/extrusions.js.map +1 -1
- package/dist/basemap/vectortiles/labels.d.ts +3 -0
- package/dist/basemap/vectortiles/labels.js +42 -17
- package/dist/basemap/vectortiles/labels.js.map +1 -1
- package/dist/basemap/vectortiles/lamps.d.ts +23 -0
- package/dist/basemap/vectortiles/lamps.js +90 -0
- package/dist/basemap/vectortiles/lamps.js.map +1 -0
- package/dist/basemap/vectortiles/requests.d.ts +4 -0
- package/dist/basemap/vectortiles/requests.js +15 -2
- package/dist/basemap/vectortiles/requests.js.map +1 -1
- package/dist/basemap/vectortiles/trees.d.ts +9 -0
- package/dist/basemap/vectortiles/trees.js +114 -29
- package/dist/basemap/vectortiles/trees.js.map +1 -1
- package/dist/basemap/vectortiles/vectors.d.ts +17 -0
- package/dist/basemap/vectortiles/vectors.js +72 -8
- package/dist/basemap/vectortiles/vectors.js.map +1 -1
- package/dist/basemap/vectortiles.d.ts +26 -6
- package/dist/basemap/vectortiles.js +43 -10
- package/dist/basemap/vectortiles.js.map +1 -1
- package/dist/basemap.worker.js +2 -2
- package/dist/basemap.worker.js.map +12 -10
- package/dist/bind/layers.js +1 -0
- package/dist/bind/layers.js.map +1 -1
- package/dist/data/collada.d.ts +19 -0
- package/dist/data/collada.js +319 -0
- package/dist/data/collada.js.map +1 -0
- package/dist/data/ifc.d.ts +100 -0
- package/dist/data/ifc.js +372 -0
- package/dist/data/ifc.js.map +1 -0
- package/dist/decoder.worker.js +5 -5
- package/dist/decoder.worker.js.map +3 -3
- package/dist/formats.d.ts +7 -2
- package/dist/formats.js +7 -2
- package/dist/formats.js.map +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +6 -1
- 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/extrusions.d.ts +10 -0
- package/dist/layers/extrusions.js +28 -2
- package/dist/layers/extrusions.js.map +1 -1
- package/dist/layers/layers.d.ts +12 -0
- package/dist/layers/layers.js +44 -1
- package/dist/layers/layers.js.map +1 -1
- package/dist/layers/photos.d.ts +48 -0
- package/dist/layers/photos.js +140 -0
- package/dist/layers/photos.js.map +1 -0
- package/dist/layers/symbols.d.ts +5 -1
- package/dist/layers/symbols.js +111 -32
- package/dist/layers/symbols.js.map +1 -1
- package/dist/layers/trees.d.ts +28 -0
- package/dist/layers/trees.js +51 -0
- package/dist/layers/trees.js.map +1 -0
- package/dist/layers/vectors.d.ts +28 -2
- package/dist/layers/vectors.js +81 -7
- package/dist/layers/vectors.js.map +1 -1
- package/dist/map/layer-spec.d.ts +3 -0
- package/dist/map/layer-spec.js +2 -0
- package/dist/map/layer-spec.js.map +1 -1
- package/dist/map.d.ts +8 -0
- package/dist/map.js +15 -2
- package/dist/map.js.map +1 -1
- package/dist/panoramax.d.ts +49 -0
- package/dist/panoramax.js +71 -0
- package/dist/panoramax.js.map +1 -0
- package/dist/react/Layer.d.ts +1 -0
- package/dist/react/Layer.js.map +1 -1
- package/dist/react/VectorGeometry.d.ts +5 -0
- package/dist/react/VectorGeometry.js +12 -4
- package/dist/react/VectorGeometry.js.map +1 -1
- package/dist/util/gltf.d.ts +9 -0
- package/dist/util/gltf.js +27 -0
- package/dist/util/gltf.js.map +1 -0
- package/dist/util/roofs.d.ts +10 -0
- package/dist/util/roofs.js +30 -0
- package/dist/util/roofs.js.map +1 -0
- package/dist/wasm/isard.d.ts +56 -17
- package/dist/wasm/isard.js +128 -18
- package/dist/wasm/isard_core.d.ts +44 -17
- package/dist/wasm/isard_core.js +104 -18
- package/dist/wasm/isard_tess.d.ts +6 -3
- package/dist/wasm/isard_tess.js +27 -4
- package/dist/workers/basemap/geometry.d.ts +38 -22
- package/dist/workers/basemap/labels.d.ts +14 -1
- package/dist/workers/basemap/lamps.d.ts +10 -0
- package/dist/workers/basemap/trees.d.ts +3 -1
- package/dist/workers/basemap.worker.d.ts +43 -3
- package/dist/workers/basemap.worker.js +14 -2
- package/dist/workers/basemap.worker.js.map +1 -1
- package/package.json +1 -1
package/dist/wasm/isard_core.js
CHANGED
|
@@ -632,7 +632,7 @@ export class Engine {
|
|
|
632
632
|
}
|
|
633
633
|
/**
|
|
634
634
|
* Adds or replaces batch `key` of an extrusion layer: polygons as for `addFills`, `feature_count` features (the
|
|
635
|
-
* feature style gives each its height and base height as its two sizes, metres)
|
|
635
|
+
* feature style gives each its height and base height as its two sizes, metres), each polygon's roof (`Roofs`)
|
|
636
636
|
*
|
|
637
637
|
* # Errors
|
|
638
638
|
*
|
|
@@ -645,8 +645,11 @@ export class Engine {
|
|
|
645
645
|
* @param {Uint32Array} polygon_start
|
|
646
646
|
* @param {Uint32Array} feature
|
|
647
647
|
* @param {number} feature_count
|
|
648
|
+
* @param {Uint8Array} roofs
|
|
649
|
+
* @param {Float32Array} roof_heights
|
|
650
|
+
* @param {number} metres
|
|
648
651
|
*/
|
|
649
|
-
setExtrusionBatch(id, key, points, ring_start, polygon_start, feature, feature_count) {
|
|
652
|
+
setExtrusionBatch(id, key, points, ring_start, polygon_start, feature, feature_count, roofs, roof_heights, metres) {
|
|
650
653
|
const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
|
|
651
654
|
const len0 = WASM_VECTOR_LEN;
|
|
652
655
|
const ptr1 = passArray32ToWasm0(ring_start, wasm.__wbindgen_malloc);
|
|
@@ -655,11 +658,23 @@ export class Engine {
|
|
|
655
658
|
const len2 = WASM_VECTOR_LEN;
|
|
656
659
|
const ptr3 = passArray32ToWasm0(feature, wasm.__wbindgen_malloc);
|
|
657
660
|
const len3 = WASM_VECTOR_LEN;
|
|
658
|
-
const
|
|
661
|
+
const ptr4 = passArray8ToWasm0(roofs, wasm.__wbindgen_malloc);
|
|
662
|
+
const len4 = WASM_VECTOR_LEN;
|
|
663
|
+
const ptr5 = passArrayF32ToWasm0(roof_heights, wasm.__wbindgen_malloc);
|
|
664
|
+
const len5 = WASM_VECTOR_LEN;
|
|
665
|
+
const ret = wasm.engine_setExtrusionBatch(this.__wbg_ptr, id, key, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, feature_count, ptr4, len4, ptr5, len5, metres);
|
|
659
666
|
if (ret[1]) {
|
|
660
667
|
throw takeFromExternrefTable0(ret[0]);
|
|
661
668
|
}
|
|
662
669
|
}
|
|
670
|
+
/**
|
|
671
|
+
* Whether the buildings of an extrusion layer, or of a vector tiles layer, show their windows on their walls
|
|
672
|
+
* @param {number} id
|
|
673
|
+
* @param {boolean} on
|
|
674
|
+
*/
|
|
675
|
+
setFacades(id, on) {
|
|
676
|
+
wasm.engine_setFacades(this.__wbg_ptr, id, on);
|
|
677
|
+
}
|
|
663
678
|
/**
|
|
664
679
|
* Layer-wide style of a feature layer: opacity as zoom stops (four zooms then four values), the zoom range it
|
|
665
680
|
* shows in (`min_zoom` included, `max_zoom` excluded), whether it shows at all
|
|
@@ -1138,25 +1153,27 @@ export class Engine {
|
|
|
1138
1153
|
}
|
|
1139
1154
|
/**
|
|
1140
1155
|
* Layer-wide style of a symbol layer: size scale and opacity as zoom stops (four zooms then four values each),
|
|
1141
|
-
* zoom range, visibility
|
|
1156
|
+
* zoom range, visibility, hidden by the buildings
|
|
1142
1157
|
* @param {number} id
|
|
1143
1158
|
* @param {Float32Array} size
|
|
1144
1159
|
* @param {Float32Array} opacity
|
|
1145
1160
|
* @param {number} min_zoom
|
|
1146
1161
|
* @param {number} max_zoom
|
|
1147
1162
|
* @param {boolean} visible
|
|
1163
|
+
* @param {boolean} occluded
|
|
1148
1164
|
*/
|
|
1149
|
-
setSymbolLayer(id, size, opacity, min_zoom, max_zoom, visible) {
|
|
1165
|
+
setSymbolLayer(id, size, opacity, min_zoom, max_zoom, visible, occluded) {
|
|
1150
1166
|
const ptr0 = passArrayF32ToWasm0(size, wasm.__wbindgen_malloc);
|
|
1151
1167
|
const len0 = WASM_VECTOR_LEN;
|
|
1152
1168
|
const ptr1 = passArrayF32ToWasm0(opacity, wasm.__wbindgen_malloc);
|
|
1153
1169
|
const len1 = WASM_VECTOR_LEN;
|
|
1154
|
-
wasm.engine_setSymbolLayer(this.__wbg_ptr, id, ptr0, len0, ptr1, len1, min_zoom, max_zoom, visible);
|
|
1170
|
+
wasm.engine_setSymbolLayer(this.__wbg_ptr, id, ptr0, len0, ptr1, len1, min_zoom, max_zoom, visible, occluded);
|
|
1155
1171
|
}
|
|
1156
1172
|
/**
|
|
1157
1173
|
* Labels of a symbol layer, shaped by the page: anchors (Mercator, interleaved), their texts' boxes (min x, min y,
|
|
1158
|
-
* max x, max y, CSS pixels from the anchor), styles (
|
|
1159
|
-
* (11 floats each, see `QUAD_FLOATS`)
|
|
1174
|
+
* max x, max y, CSS pixels from the anchor), styles (37 floats each, see `LABEL_FLOATS`), glyph and icon quads
|
|
1175
|
+
* (11 floats each, see `QUAD_FLOATS`) and the lines their curved texts follow (`paths`: for each label, its number
|
|
1176
|
+
* of points, the index of its anchor among them, then the points, Mercator; 0, 0 and none for the others)
|
|
1160
1177
|
*
|
|
1161
1178
|
* # Errors
|
|
1162
1179
|
*
|
|
@@ -1167,8 +1184,9 @@ export class Engine {
|
|
|
1167
1184
|
* @param {Float32Array} boxes
|
|
1168
1185
|
* @param {Float32Array} styles
|
|
1169
1186
|
* @param {Float32Array} quads
|
|
1187
|
+
* @param {Float64Array} paths
|
|
1170
1188
|
*/
|
|
1171
|
-
setSymbols(id, anchors, boxes, styles, quads) {
|
|
1189
|
+
setSymbols(id, anchors, boxes, styles, quads, paths) {
|
|
1172
1190
|
const ptr0 = passArrayF64ToWasm0(anchors, wasm.__wbindgen_malloc);
|
|
1173
1191
|
const len0 = WASM_VECTOR_LEN;
|
|
1174
1192
|
const ptr1 = passArrayF32ToWasm0(boxes, wasm.__wbindgen_malloc);
|
|
@@ -1177,7 +1195,9 @@ export class Engine {
|
|
|
1177
1195
|
const len2 = WASM_VECTOR_LEN;
|
|
1178
1196
|
const ptr3 = passArrayF32ToWasm0(quads, wasm.__wbindgen_malloc);
|
|
1179
1197
|
const len3 = WASM_VECTOR_LEN;
|
|
1180
|
-
const
|
|
1198
|
+
const ptr4 = passArrayF64ToWasm0(paths, wasm.__wbindgen_malloc);
|
|
1199
|
+
const len4 = WASM_VECTOR_LEN;
|
|
1200
|
+
const ret = wasm.engine_setSymbols(this.__wbg_ptr, id, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
1181
1201
|
if (ret[1]) {
|
|
1182
1202
|
throw takeFromExternrefTable0(ret[0]);
|
|
1183
1203
|
}
|
|
@@ -1210,11 +1230,15 @@ export class Engine {
|
|
|
1210
1230
|
}
|
|
1211
1231
|
}
|
|
1212
1232
|
/**
|
|
1213
|
-
* The style layers of a vector tile layer, in drawing order: per layer, its kind (0 fill, 1 line, 2 extrusion
|
|
1233
|
+
* The style layers of a vector tile layer, in drawing order: per layer, its kind (0 fill, 1 line, 2 extrusion, 3
|
|
1234
|
+
* circle), its zoom range
|
|
1214
1235
|
* (two numbers: shown from the first, included, to the second, excluded), whether it shows (0 or 1), its dashes
|
|
1215
1236
|
* (four numbers: dash, gap, dash, gap, in line widths; 0: solid), its opacity as zoom stops (four zooms then four
|
|
1216
1237
|
* values; missing: opaque), the caps of its lines' ends (0 butt, 1 round, 2 square; missing: round), whether its
|
|
1217
|
-
* lines glow at night (streets; 0 or 1)
|
|
1238
|
+
* lines glow at night (streets; 0 or 1), the joins of its lines (two numbers: 0 round, 1 miter, 2 bevel, then the
|
|
1239
|
+
* miter limit in line widths; missing: round), the translation of its fills or lines (three numbers: x and y in CSS
|
|
1240
|
+
* pixels, x right and y down, then 0 if it turns with the map, 1 if it stays on the screen; missing: none), whether its
|
|
1241
|
+
* fills have patterns (0 or 1)
|
|
1218
1242
|
* @param {number} id
|
|
1219
1243
|
* @param {Uint8Array} kinds
|
|
1220
1244
|
* @param {Float64Array} zooms
|
|
@@ -1223,8 +1247,11 @@ export class Engine {
|
|
|
1223
1247
|
* @param {Float32Array} opacities
|
|
1224
1248
|
* @param {Uint8Array} caps
|
|
1225
1249
|
* @param {Uint8Array} lit
|
|
1250
|
+
* @param {Float32Array} joins
|
|
1251
|
+
* @param {Float32Array} translates
|
|
1252
|
+
* @param {Uint8Array} patterned
|
|
1226
1253
|
*/
|
|
1227
|
-
setVectorSublayers(id, kinds, zooms, visible, dashes, opacities, caps, lit) {
|
|
1254
|
+
setVectorSublayers(id, kinds, zooms, visible, dashes, opacities, caps, lit, joins, translates, patterned) {
|
|
1228
1255
|
const ptr0 = passArray8ToWasm0(kinds, wasm.__wbindgen_malloc);
|
|
1229
1256
|
const len0 = WASM_VECTOR_LEN;
|
|
1230
1257
|
const ptr1 = passArrayF64ToWasm0(zooms, wasm.__wbindgen_malloc);
|
|
@@ -1239,7 +1266,13 @@ export class Engine {
|
|
|
1239
1266
|
const len5 = WASM_VECTOR_LEN;
|
|
1240
1267
|
const ptr6 = passArray8ToWasm0(lit, wasm.__wbindgen_malloc);
|
|
1241
1268
|
const len6 = WASM_VECTOR_LEN;
|
|
1242
|
-
|
|
1269
|
+
const ptr7 = passArrayF32ToWasm0(joins, wasm.__wbindgen_malloc);
|
|
1270
|
+
const len7 = WASM_VECTOR_LEN;
|
|
1271
|
+
const ptr8 = passArrayF32ToWasm0(translates, wasm.__wbindgen_malloc);
|
|
1272
|
+
const len8 = WASM_VECTOR_LEN;
|
|
1273
|
+
const ptr9 = passArray8ToWasm0(patterned, wasm.__wbindgen_malloc);
|
|
1274
|
+
const len9 = WASM_VECTOR_LEN;
|
|
1275
|
+
wasm.engine_setVectorSublayers(this.__wbg_ptr, id, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6, ptr7, len7, ptr8, len8, ptr9, len9);
|
|
1243
1276
|
}
|
|
1244
1277
|
/**
|
|
1245
1278
|
* Adds or replaces tile `key` of a vector tile layer ready for the GPU, as the basemap workers make it (the
|
|
@@ -1311,13 +1344,36 @@ export class Engine {
|
|
|
1311
1344
|
throw takeFromExternrefTable0(ret[0]);
|
|
1312
1345
|
}
|
|
1313
1346
|
}
|
|
1347
|
+
/**
|
|
1348
|
+
* The points of tile `key` of a vector tile layer, after the tile itself (`setVectorTile`, `setVectorTileMesh`):
|
|
1349
|
+
* Mercator, interleaved, each with its feature (styled as a circle's: a color, a radius and a stroke width, then the
|
|
1350
|
+
* stroke's color), `start` the first point of each sublayer and the end; the circle sublayers draw theirs
|
|
1351
|
+
* @param {number} id
|
|
1352
|
+
* @param {number} key
|
|
1353
|
+
* @param {Float64Array} points
|
|
1354
|
+
* @param {Uint32Array} feature
|
|
1355
|
+
* @param {Uint32Array} start
|
|
1356
|
+
*/
|
|
1357
|
+
setVectorTilePoints(id, key, points, feature, start) {
|
|
1358
|
+
const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
|
|
1359
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1360
|
+
const ptr1 = passArray32ToWasm0(feature, wasm.__wbindgen_malloc);
|
|
1361
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1362
|
+
const ptr2 = passArray32ToWasm0(start, wasm.__wbindgen_malloc);
|
|
1363
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1364
|
+
wasm.engine_setVectorTilePoints(this.__wbg_ptr, id, key, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1365
|
+
}
|
|
1314
1366
|
/**
|
|
1315
1367
|
* Adds or replaces tile `key` of a vector tile layer: its polygons as for `addFills` (`fill_start`: the first
|
|
1316
1368
|
* polygon of each sublayer, and the end; those of an extrusion sublayer raised into blocks), its lines as for
|
|
1317
1369
|
* `addLines` (`line_start`: the first line of each sublayer, and the end), `feature_count` features, styled as an
|
|
1318
1370
|
* extrusion layer's (`setFeatureStyle` with the key: a color, then a line's width or a block's height and base);
|
|
1319
1371
|
* `tile`: the corners of the tile they are cut to (west, north, east, south; empty: none), along whose edges no
|
|
1320
|
-
* wall of a block rises
|
|
1372
|
+
* wall of a block rises; `roofs` and `roof_heights`: per polygon, the shape and height of its block's roof
|
|
1373
|
+
* (`shapes::Roofs`: 0 flat, 1 to 5 `RoofShape::number`, 255 generated from its outline; metres, not a number: as
|
|
1374
|
+
* its slopes make it; empty: flat), the whole outlines of the buildings the tile cuts (`roof_outlines`, interleaved
|
|
1375
|
+
* Mercator points, `roof_outline_start`: where each polygon's starts, and the end), `roof_metres` the metres per
|
|
1376
|
+
* Mercator unit at the tile
|
|
1321
1377
|
*
|
|
1322
1378
|
* # Errors
|
|
1323
1379
|
*
|
|
@@ -1336,8 +1392,13 @@ export class Engine {
|
|
|
1336
1392
|
* @param {Uint32Array} line_start
|
|
1337
1393
|
* @param {number} feature_count
|
|
1338
1394
|
* @param {Float64Array} tile
|
|
1395
|
+
* @param {Uint8Array} roofs
|
|
1396
|
+
* @param {Float32Array} roof_heights
|
|
1397
|
+
* @param {Float64Array} roof_outlines
|
|
1398
|
+
* @param {Uint32Array} roof_outline_start
|
|
1399
|
+
* @param {number} roof_metres
|
|
1339
1400
|
*/
|
|
1340
|
-
setVectorTile(id, key, points, ring_start, polygon_start, polygon_feature, fill_start, line_points, line_first, line_feature, line_start, feature_count, tile) {
|
|
1401
|
+
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) {
|
|
1341
1402
|
const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
|
|
1342
1403
|
const len0 = WASM_VECTOR_LEN;
|
|
1343
1404
|
const ptr1 = passArray32ToWasm0(ring_start, wasm.__wbindgen_malloc);
|
|
@@ -1358,7 +1419,15 @@ export class Engine {
|
|
|
1358
1419
|
const len8 = WASM_VECTOR_LEN;
|
|
1359
1420
|
const ptr9 = passArrayF64ToWasm0(tile, wasm.__wbindgen_malloc);
|
|
1360
1421
|
const len9 = WASM_VECTOR_LEN;
|
|
1361
|
-
const
|
|
1422
|
+
const ptr10 = passArray8ToWasm0(roofs, wasm.__wbindgen_malloc);
|
|
1423
|
+
const len10 = WASM_VECTOR_LEN;
|
|
1424
|
+
const ptr11 = passArrayF32ToWasm0(roof_heights, wasm.__wbindgen_malloc);
|
|
1425
|
+
const len11 = WASM_VECTOR_LEN;
|
|
1426
|
+
const ptr12 = passArrayF64ToWasm0(roof_outlines, wasm.__wbindgen_malloc);
|
|
1427
|
+
const len12 = WASM_VECTOR_LEN;
|
|
1428
|
+
const ptr13 = passArray32ToWasm0(roof_outline_start, wasm.__wbindgen_malloc);
|
|
1429
|
+
const len13 = WASM_VECTOR_LEN;
|
|
1430
|
+
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);
|
|
1362
1431
|
if (ret[1]) {
|
|
1363
1432
|
throw takeFromExternrefTable0(ret[0]);
|
|
1364
1433
|
}
|
|
@@ -1511,6 +1580,17 @@ export class Engine {
|
|
|
1511
1580
|
const len0 = WASM_VECTOR_LEN;
|
|
1512
1581
|
wasm.engine_updateIconAtlas(this.__wbg_ptr, x, y, width, height, ptr0, len0);
|
|
1513
1582
|
}
|
|
1583
|
+
/**
|
|
1584
|
+
* Uploads a part more of the blocks of tile `key` of a vector tile layer (a large tile's, a part at a time over
|
|
1585
|
+
* several frames); whether some are left. Its blocks are drawn once they are all there
|
|
1586
|
+
* @param {number} id
|
|
1587
|
+
* @param {number} key
|
|
1588
|
+
* @returns {boolean}
|
|
1589
|
+
*/
|
|
1590
|
+
uploadVectorTile(id, key) {
|
|
1591
|
+
const ret = wasm.engine_uploadVectorTile(this.__wbg_ptr, id, key);
|
|
1592
|
+
return ret !== 0;
|
|
1593
|
+
}
|
|
1514
1594
|
/**
|
|
1515
1595
|
* Vector tiles (512 CSS pixels across at their level, as `MapLibre`'s) for the view of the last frame (else the
|
|
1516
1596
|
* camera's), levels `min_z` to `max_z`, three numbers per tile (z, x, y), the nearest to the eye first: what a
|
|
@@ -1682,6 +1762,12 @@ function __wbg_get_imports() {
|
|
|
1682
1762
|
__wbg_bufferData_bad7ce562b6a9eac: function(arg0, arg1, arg2, arg3) {
|
|
1683
1763
|
arg0.bufferData(arg1 >>> 0, arg2, arg3 >>> 0);
|
|
1684
1764
|
},
|
|
1765
|
+
__wbg_bufferSubData_22c4c420e0f67cda: function(arg0, arg1, arg2, arg3) {
|
|
1766
|
+
arg0.bufferSubData(arg1 >>> 0, arg2, arg3);
|
|
1767
|
+
},
|
|
1768
|
+
__wbg_bufferSubData_8609cd8a2c013181: function(arg0, arg1, arg2, arg3) {
|
|
1769
|
+
arg0.bufferSubData(arg1 >>> 0, arg2, arg3);
|
|
1770
|
+
},
|
|
1685
1771
|
__wbg_byteLength_27689b065d089962: function(arg0) {
|
|
1686
1772
|
const ret = arg0.byteLength;
|
|
1687
1773
|
return ret;
|
|
@@ -2550,7 +2636,7 @@ function __wbg_get_imports() {
|
|
|
2550
2636
|
return ret;
|
|
2551
2637
|
},
|
|
2552
2638
|
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
2553
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
2639
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 116, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
2554
2640
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_2e566c63402fe7fa___convert__closures_____invoke___wasm_bindgen_2e566c63402fe7fa___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_2e566c63402fe7fa___JsError___true_);
|
|
2555
2641
|
return ret;
|
|
2556
2642
|
},
|
|
@@ -58,17 +58,20 @@ export class TessellatedTile {
|
|
|
58
58
|
* (interleaved points, `ring_start`, `polygon_start`, the feature of each, `fill_start`: the first polygon of each
|
|
59
59
|
* sublayer and the end), its lines (interleaved points, `line_first`: the first point of each, the feature of each,
|
|
60
60
|
* `line_start`: the first line of each sublayer and the end); `raised`: per sublayer, whether its polygons are extruded
|
|
61
|
-
* into blocks rather than filled; `
|
|
61
|
+
* into blocks rather than filled; `roofs` and `roof_heights`: per polygon, the shape and height of its block's roof
|
|
62
|
+
* (`shapes::Roofs`; empty: flat), the whole outlines of the buildings the tile cuts (`roof_outlines`, interleaved
|
|
63
|
+
* Mercator points, `roof_outline_start`: where each polygon's starts, and the end), `roof_metres` the metres per
|
|
64
|
+
* Mercator unit at the tile; `prism`: with the prisms the fills need over the relief; `tile`: the corners of the
|
|
62
65
|
* tile they are cut to (west, north, east, south, Mercator; empty: none), along whose edges no wall of a block rises
|
|
63
66
|
*/
|
|
64
|
-
export function tessellateVectorTile(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, raised: Uint8Array, prism: boolean, tile: Float64Array): TessellatedTile;
|
|
67
|
+
export function tessellateVectorTile(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, raised: Uint8Array, roofs: Uint8Array, roof_heights: Float32Array, roof_outlines: Float64Array, roof_outline_start: Uint32Array, roof_metres: number, prism: boolean, tile: Float64Array): TessellatedTile;
|
|
65
68
|
|
|
66
69
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
67
70
|
|
|
68
71
|
export interface InitOutput {
|
|
69
72
|
readonly memory: WebAssembly.Memory;
|
|
70
73
|
readonly __wbg_tessellatedtile_free: (a: number, b: number) => void;
|
|
71
|
-
readonly tessellateVectorTile: (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) => number;
|
|
74
|
+
readonly tessellateVectorTile: (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) => number;
|
|
72
75
|
readonly tessellatedtile_blockIndices: (a: number) => any;
|
|
73
76
|
readonly tessellatedtile_blockRanges: (a: number) => [number, number];
|
|
74
77
|
readonly tessellatedtile_blocks: (a: number) => any;
|
package/dist/wasm/isard_tess.js
CHANGED
|
@@ -124,7 +124,10 @@ if (Symbol.dispose) TessellatedTile.prototype[Symbol.dispose] = TessellatedTile.
|
|
|
124
124
|
* (interleaved points, `ring_start`, `polygon_start`, the feature of each, `fill_start`: the first polygon of each
|
|
125
125
|
* sublayer and the end), its lines (interleaved points, `line_first`: the first point of each, the feature of each,
|
|
126
126
|
* `line_start`: the first line of each sublayer and the end); `raised`: per sublayer, whether its polygons are extruded
|
|
127
|
-
* into blocks rather than filled; `
|
|
127
|
+
* into blocks rather than filled; `roofs` and `roof_heights`: per polygon, the shape and height of its block's roof
|
|
128
|
+
* (`shapes::Roofs`; empty: flat), the whole outlines of the buildings the tile cuts (`roof_outlines`, interleaved
|
|
129
|
+
* Mercator points, `roof_outline_start`: where each polygon's starts, and the end), `roof_metres` the metres per
|
|
130
|
+
* Mercator unit at the tile; `prism`: with the prisms the fills need over the relief; `tile`: the corners of the
|
|
128
131
|
* tile they are cut to (west, north, east, south, Mercator; empty: none), along whose edges no wall of a block rises
|
|
129
132
|
* @param {Float64Array} points
|
|
130
133
|
* @param {Uint32Array} ring_start
|
|
@@ -136,11 +139,16 @@ if (Symbol.dispose) TessellatedTile.prototype[Symbol.dispose] = TessellatedTile.
|
|
|
136
139
|
* @param {Uint32Array} line_feature
|
|
137
140
|
* @param {Uint32Array} line_start
|
|
138
141
|
* @param {Uint8Array} raised
|
|
142
|
+
* @param {Uint8Array} roofs
|
|
143
|
+
* @param {Float32Array} roof_heights
|
|
144
|
+
* @param {Float64Array} roof_outlines
|
|
145
|
+
* @param {Uint32Array} roof_outline_start
|
|
146
|
+
* @param {number} roof_metres
|
|
139
147
|
* @param {boolean} prism
|
|
140
148
|
* @param {Float64Array} tile
|
|
141
149
|
* @returns {TessellatedTile}
|
|
142
150
|
*/
|
|
143
|
-
export function tessellateVectorTile(points, ring_start, polygon_start, polygon_feature, fill_start, line_points, line_first, line_feature, line_start, raised, prism, tile) {
|
|
151
|
+
export function tessellateVectorTile(points, ring_start, polygon_start, polygon_feature, fill_start, line_points, line_first, line_feature, line_start, raised, roofs, roof_heights, roof_outlines, roof_outline_start, roof_metres, prism, tile) {
|
|
144
152
|
const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
|
|
145
153
|
const len0 = WASM_VECTOR_LEN;
|
|
146
154
|
const ptr1 = passArray32ToWasm0(ring_start, wasm.__wbindgen_malloc);
|
|
@@ -161,9 +169,17 @@ export function tessellateVectorTile(points, ring_start, polygon_start, polygon_
|
|
|
161
169
|
const len8 = WASM_VECTOR_LEN;
|
|
162
170
|
const ptr9 = passArray8ToWasm0(raised, wasm.__wbindgen_malloc);
|
|
163
171
|
const len9 = WASM_VECTOR_LEN;
|
|
164
|
-
const ptr10 =
|
|
172
|
+
const ptr10 = passArray8ToWasm0(roofs, wasm.__wbindgen_malloc);
|
|
165
173
|
const len10 = WASM_VECTOR_LEN;
|
|
166
|
-
const
|
|
174
|
+
const ptr11 = passArrayF32ToWasm0(roof_heights, wasm.__wbindgen_malloc);
|
|
175
|
+
const len11 = WASM_VECTOR_LEN;
|
|
176
|
+
const ptr12 = passArrayF64ToWasm0(roof_outlines, wasm.__wbindgen_malloc);
|
|
177
|
+
const len12 = WASM_VECTOR_LEN;
|
|
178
|
+
const ptr13 = passArray32ToWasm0(roof_outline_start, wasm.__wbindgen_malloc);
|
|
179
|
+
const len13 = WASM_VECTOR_LEN;
|
|
180
|
+
const ptr14 = passArrayF64ToWasm0(tile, wasm.__wbindgen_malloc);
|
|
181
|
+
const len14 = WASM_VECTOR_LEN;
|
|
182
|
+
const ret = wasm.tessellateVectorTile(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, roof_metres, prism, ptr14, len14);
|
|
167
183
|
return TessellatedTile.__wrap(ret);
|
|
168
184
|
}
|
|
169
185
|
function __wbg_get_imports() {
|
|
@@ -274,6 +290,13 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
274
290
|
return ptr;
|
|
275
291
|
}
|
|
276
292
|
|
|
293
|
+
function passArrayF32ToWasm0(arg, malloc) {
|
|
294
|
+
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
295
|
+
getFloat32ArrayMemory0().set(arg, ptr / 4);
|
|
296
|
+
WASM_VECTOR_LEN = arg.length;
|
|
297
|
+
return ptr;
|
|
298
|
+
}
|
|
299
|
+
|
|
277
300
|
function passArrayF64ToWasm0(arg, malloc) {
|
|
278
301
|
const ptr = malloc(arg.length * 8, 8) >>> 0;
|
|
279
302
|
getFloat64ArrayMemory0().set(arg, ptr / 8);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/** A vector tile cut into geometry for the engine: the polygons of the extrusions, the fills, lines and buildings of
|
|
2
2
|
* `vectors()` with their style per feature, made ready for the GPU by the tessellation module */
|
|
3
|
-
import type { Value } from '../../basemap/mvt.ts';
|
|
4
|
-
import
|
|
3
|
+
import type { TileFeature, Value } from '../../basemap/mvt.ts';
|
|
4
|
+
import { type StyleLayer } from '../../basemap/vectorstyle.ts';
|
|
5
|
+
import type { Priority, TileMesh, TileStyles, TileVectors } from '../basemap.worker.ts';
|
|
5
6
|
import { type Renderer } from './tiles.ts';
|
|
6
7
|
/**
|
|
7
8
|
* The polygons of a tile's features in the renderer's fill layers (each feature once, whichever layers keep it), in
|
|
@@ -17,11 +18,43 @@ export declare const polygons: (r: Renderer, z: number, x: number, y: number, id
|
|
|
17
18
|
};
|
|
18
19
|
properties: Record<string, Value>[];
|
|
19
20
|
} | undefined>;
|
|
21
|
+
/** The landmarks of a tile: its points of interest of `LANDMARKS` (x, y interleaved, tile units) */
|
|
22
|
+
export declare const landmarksOf: (layers: Map<string, {
|
|
23
|
+
features: TileFeature[];
|
|
24
|
+
}> | undefined) => number[];
|
|
25
|
+
/** Whether a building's rings (tile units) hold one of the landmarks' points */
|
|
26
|
+
export declare const holdsLandmark: (rings: readonly (readonly number[])[], points: readonly number[]) => boolean;
|
|
27
|
+
/**
|
|
28
|
+
* The buildings of a layer that are landmarks: those holding a landmark's point (`holdsLandmark`), and the parts of
|
|
29
|
+
* those (a building whose middle is inside one of them, or that holds one's middle: the stage tower, the dome). Their
|
|
30
|
+
* walls along each other drawn alike, not one floodlit fighting a dark one as the view moves; a neighbour against a
|
|
31
|
+
* landmark's wall, its middle outside, is none
|
|
32
|
+
*/
|
|
33
|
+
export declare const landmarkBuildings: (features: readonly TileFeature[], points: readonly number[]) => Set<TileFeature>;
|
|
34
|
+
/** How the buildings' roofs are made: from their data (`roof:shape`, `roof:height`; flat without), generated where
|
|
35
|
+
* they have none, or all flat */
|
|
36
|
+
export type RoofMode = 'data' | 'generated' | 'flat';
|
|
37
|
+
/** A building's roof for the engine: its shape's number (0 flat) and height (metres; not a number: as its slopes make
|
|
38
|
+
* it), from its properties (`roof:shape` or `roof_shape`, `roof:height` or `roof_height`) and the `mode` */
|
|
39
|
+
export declare const roofOf: (properties: Record<string, Value>, mode: RoofMode) => [number, number];
|
|
40
|
+
/**
|
|
41
|
+
* The zooms a feature shows over by its layer's filter, as MapLibre evaluates a filter (at the whole zoom under the
|
|
42
|
+
* camera's): its filter at each whole zoom of the range a tile of level `z` is drawn over (`z - 1` to `last`), from
|
|
43
|
+
* the first where it holds to past the last (open at the ends of the range, `[0, 0]` for a filter that does not read
|
|
44
|
+
* the zoom); undefined if it holds at none
|
|
45
|
+
*/
|
|
46
|
+
export declare const filterZooms: (layer: StyleLayer, feature: TileFeature, z: number, last: number) => [number, number] | undefined;
|
|
20
47
|
/**
|
|
21
48
|
* A ring cut to the square [0, `extent`] (Sutherland–Hodgman), its points interleaved, unclosed: a polygon lying
|
|
22
49
|
* across the tile's edge keeps its part in the tile, along the edge
|
|
23
50
|
*/
|
|
24
51
|
export declare const clipRing: (ring: readonly number[], extent: number) => number[];
|
|
52
|
+
/**
|
|
53
|
+
* A line with the points dropped that lie within `tolerance` of the line through their neighbours kept (Douglas–
|
|
54
|
+
* Peucker): a sequence of photos every few metres (Panoramax's) drawn as many pieces under a pixel, each as wide as the
|
|
55
|
+
* line, covered a pixel ten times over
|
|
56
|
+
*/
|
|
57
|
+
export declare const simplifyLine: (line: readonly number[], tolerance: number) => number[];
|
|
25
58
|
/** A line cut to the square [0, `extent`] (Liang–Barsky per segment): its runs inside, each two points at least */
|
|
26
59
|
export declare const clipLine: (line: readonly number[], extent: number) => number[][];
|
|
27
60
|
/**
|
|
@@ -36,30 +69,13 @@ export declare const overzoomed: (geometry: readonly (readonly number[])[], exte
|
|
|
36
69
|
* zooms over the range the tile is drawn at); with `stylesOnly`, the styles alone. Patterns, outlines and circles are
|
|
37
70
|
* left to the raster path
|
|
38
71
|
*/
|
|
39
|
-
export declare const vectors: (r: Renderer, { z, x, y, deepest }: {
|
|
72
|
+
export declare const vectors: (r: Renderer, { z, x, y, deepest, roofs: roofMode, }: {
|
|
40
73
|
z: number;
|
|
41
74
|
x: number;
|
|
42
75
|
y: number;
|
|
43
76
|
deepest?: number;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
points: Float64Array<ArrayBuffer>;
|
|
47
|
-
ringStart: Uint32Array<ArrayBuffer>;
|
|
48
|
-
polygonStart: Uint32Array<ArrayBuffer>;
|
|
49
|
-
feature: Uint32Array<ArrayBuffer>;
|
|
50
|
-
fillStart: Uint32Array<ArrayBuffer>;
|
|
51
|
-
};
|
|
52
|
-
lines: {
|
|
53
|
-
points: Float64Array<ArrayBuffer>;
|
|
54
|
-
start: Uint32Array<ArrayBuffer>;
|
|
55
|
-
feature: Uint32Array<ArrayBuffer>;
|
|
56
|
-
lineStart: Uint32Array<ArrayBuffer>;
|
|
57
|
-
};
|
|
58
|
-
styles: Float32Array<ArrayBuffer>;
|
|
59
|
-
tile: Float64Array<ArrayBuffer>;
|
|
60
|
-
properties: Record<string, Value>[];
|
|
61
|
-
sublayer: Uint16Array<ArrayBuffer>;
|
|
62
|
-
} | undefined>;
|
|
77
|
+
roofs?: RoofMode;
|
|
78
|
+
}, id: number, stylesOnly: boolean, priority?: Priority) => Promise<TileVectors | TileStyles | undefined>;
|
|
63
79
|
/** The tessellation module: where it is, and once loaded whether it works (false: the main thread does its work) */
|
|
64
80
|
export declare const tess: {
|
|
65
81
|
url?: string;
|
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
/** The label candidates of a tile: the texts and icons of the style's symbol layers, for the page to shape and place */
|
|
2
|
+
import type { TileFeature } from '../../basemap/mvt.ts';
|
|
2
3
|
import { type LabelCandidate } from '../../basemap/vectorstyle.ts';
|
|
3
4
|
import type { Priority } from '../basemap.worker.ts';
|
|
4
5
|
import { type Renderer } from './tiles.ts';
|
|
5
6
|
/** Points every `spacing` along a line (tile units, x and y interleaved), the first half a spacing in (the middle of a
|
|
6
|
-
* shorter line): each point
|
|
7
|
+
* shorter line): each point, the segment it lies on and how far along the line it is (x, y, x0, y0, x1, y1, the
|
|
8
|
+
* segment's index, the distance) */
|
|
7
9
|
export declare const lineAnchors: (line: readonly number[], spacing: number) => number[][];
|
|
10
|
+
/** The part of a line (tile units, interleaved) from `from` to `to` along it (distances from its start) */
|
|
11
|
+
export declare const lineBetween: (line: readonly number[], from: number, to: number) => number[];
|
|
12
|
+
/**
|
|
13
|
+
* The height of the building under a point of a tile (its units), the highest if several: the buildings of the
|
|
14
|
+
* style's `fill-extrusion` layers shown at `zoom`, at their `fill-extrusion-height`; undefined outside them. A label
|
|
15
|
+
* there stands on its roof, not hidden by its walls. The buildings found through a grid of the tile's squares
|
|
16
|
+
*/
|
|
17
|
+
export declare const roofsOf: (r: Renderer, layers: Map<string, {
|
|
18
|
+
extent: number;
|
|
19
|
+
features: TileFeature[];
|
|
20
|
+
}>, zoom: number) => ((px: number, py: number) => number | undefined);
|
|
8
21
|
export declare const labels: (r: Renderer, z: number, x: number, y: number, id: number, priority?: Priority, zoom?: number) => Promise<LabelCandidate[]>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** The street lamps of a tile: points along its streets, on one side then the other, the same each time the tile is cut */
|
|
2
|
+
import type { Priority } from '../basemap.worker.ts';
|
|
3
|
+
import { type Renderer } from './tiles.ts';
|
|
4
|
+
/**
|
|
5
|
+
* Lamps along the lines of the renderer's layers in a tile, `spacing` metres apart along each street, every other
|
|
6
|
+
* one on its other side, as far from its middle as its class says (`SIDE_METRES`): longitude, latitude, scale, heading
|
|
7
|
+
* (degrees, facing the street) and rank (in [0, 1): the page keeps the lowest far from the view) of each, as the trees'
|
|
8
|
+
* numbers (`TREE_NUMBERS`, the kind 0); past `maxLamps`, thinned evenly. A street in several layers has its lamps once
|
|
9
|
+
*/
|
|
10
|
+
export declare const lamps: (r: Renderer, z: number, x: number, y: number, id: number, spacing: number, maxLamps: number, priority?: Priority) => Promise<Float64Array<ArrayBuffer> | undefined>;
|
|
@@ -14,6 +14,8 @@ export declare const inRings: (rings: readonly (readonly number[])[], px: number
|
|
|
14
14
|
export declare const scatter: (rings: readonly (readonly number[])[], extent: number, spacing: number, seed: [number, number, number], maxCells?: number) => [x: number, y: number, k: number][];
|
|
15
15
|
/**
|
|
16
16
|
* Trees over the polygons of the renderer's layers in a tile: longitude, latitude, scale (0.75 to 1.25), heading
|
|
17
|
-
* (degrees)
|
|
17
|
+
* (degrees), rank (in [0, 1): the page keeps the lowest far from the view) and kind (1 a conifer, as many as its wood's
|
|
18
|
+
* `coniferShare`, else 0) of each, `spacing[s]` metres apart in layer `s` on a jittered grid; past `maxTrees`, thinned
|
|
19
|
+
* evenly
|
|
18
20
|
*/
|
|
19
21
|
export declare const trees: (r: Renderer, z: number, x: number, y: number, id: number, spacing: number[], maxTrees: number, priority?: Priority) => Promise<Float64Array<ArrayBuffer> | undefined>;
|
|
@@ -20,6 +20,7 @@ import { type PngEncoding } from '../basemap/terrain.ts';
|
|
|
20
20
|
import { type LabelCandidate, type RasterSource, type StyleLayer } from '../basemap/vectorstyle.ts';
|
|
21
21
|
import { type HeaderRules } from '../engine/requests.ts';
|
|
22
22
|
import { type GridDescription, type StreetFlows } from '../grid-module.ts';
|
|
23
|
+
import { type RoofMode } from './basemap/geometry.ts';
|
|
23
24
|
import { type StreetWork } from './basemap/street.ts';
|
|
24
25
|
import { type Sprite } from './basemap/tiles.ts';
|
|
25
26
|
export type { LabelCandidate, RasterSource, Sprite };
|
|
@@ -67,6 +68,18 @@ export type BasemapWork = {
|
|
|
67
68
|
maxTrees: number;
|
|
68
69
|
priority?: Priority;
|
|
69
70
|
}
|
|
71
|
+
/** Street lamps along the lines of the renderer's layers, `spacing` metres apart along each street, at most
|
|
72
|
+
* `maxLamps` */
|
|
73
|
+
| {
|
|
74
|
+
type: 'lamps';
|
|
75
|
+
key: string;
|
|
76
|
+
z: number;
|
|
77
|
+
x: number;
|
|
78
|
+
y: number;
|
|
79
|
+
spacing: number;
|
|
80
|
+
maxLamps: number;
|
|
81
|
+
priority?: Priority;
|
|
82
|
+
}
|
|
70
83
|
/** The fills and lines of the renderer's layers cut to the tile, for the engine to draw as geometry; `styles`: their
|
|
71
84
|
* style only, the layers' paint changed (the same features, in the same order). A tile past the source's deepest
|
|
72
85
|
* level is cut from its tile of that level (overzoom); `deepest`, the deepest level asked for (default the
|
|
@@ -78,6 +91,8 @@ export type BasemapWork = {
|
|
|
78
91
|
x: number;
|
|
79
92
|
y: number;
|
|
80
93
|
deepest?: number;
|
|
94
|
+
/** How the buildings' roofs are made (`RoofMode`) */
|
|
95
|
+
roofs?: RoofMode;
|
|
81
96
|
styles?: boolean;
|
|
82
97
|
/** With the prisms of the fills (a relief under them) */
|
|
83
98
|
prism?: boolean;
|
|
@@ -158,11 +173,13 @@ export type BasemapResponse = {
|
|
|
158
173
|
trees: Float64Array;
|
|
159
174
|
} | {
|
|
160
175
|
id: number;
|
|
161
|
-
|
|
176
|
+
lamps: Float64Array;
|
|
162
177
|
} | {
|
|
163
178
|
id: number;
|
|
164
|
-
|
|
165
|
-
} | {
|
|
179
|
+
vectors: TileVectors;
|
|
180
|
+
} | ({
|
|
181
|
+
id: number;
|
|
182
|
+
} & TileStyles) | {
|
|
166
183
|
id: number;
|
|
167
184
|
heights: Float32Array;
|
|
168
185
|
} | {
|
|
@@ -196,6 +213,15 @@ export interface TileVectors {
|
|
|
196
213
|
polygonStart: Uint32Array;
|
|
197
214
|
feature: Uint32Array;
|
|
198
215
|
fillStart: Uint32Array;
|
|
216
|
+
/** Per polygon, its block's roof: its shape's number (`RoofShape::number`, 255 generated) and height (metres) */
|
|
217
|
+
roofs?: Uint8Array;
|
|
218
|
+
roofHeights?: Float32Array;
|
|
219
|
+
/** The whole outlines of the buildings the tile cuts (Mercator, interleaved), where each polygon's starts (and the
|
|
220
|
+
* end; an empty one: whole) */
|
|
221
|
+
roofOutlines?: Float64Array;
|
|
222
|
+
roofOutlineStart?: Uint32Array;
|
|
223
|
+
/** Metres per Mercator unit at the tile */
|
|
224
|
+
roofMetres?: number;
|
|
199
225
|
};
|
|
200
226
|
lines: {
|
|
201
227
|
points: Float64Array;
|
|
@@ -203,8 +229,17 @@ export interface TileVectors {
|
|
|
203
229
|
feature: Uint32Array;
|
|
204
230
|
lineStart: Uint32Array;
|
|
205
231
|
};
|
|
232
|
+
/** The points of the circle sublayers (Mercator), each with its styled feature, and the first of each sublayer (and
|
|
233
|
+
* the end) */
|
|
234
|
+
circles?: {
|
|
235
|
+
points: Float64Array;
|
|
236
|
+
feature: Uint32Array;
|
|
237
|
+
circleStart: Uint32Array;
|
|
238
|
+
};
|
|
206
239
|
/** The style of each styled feature, `FLOATS` (32) each, as the engine's line layers take it */
|
|
207
240
|
styles: Float32Array;
|
|
241
|
+
/** The names of the fills' patterns its styles point at (`resolvePatterns`) */
|
|
242
|
+
patterns?: string[];
|
|
208
243
|
/** The tile's corners (west, north, east, south, Mercator): no wall of a building along its edges, where one cut
|
|
209
244
|
* there goes on in the next tile */
|
|
210
245
|
tile?: Float64Array;
|
|
@@ -215,6 +250,11 @@ export interface TileVectors {
|
|
|
215
250
|
* the engine does that on the main thread */
|
|
216
251
|
mesh?: TileMesh;
|
|
217
252
|
}
|
|
253
|
+
/** The styles alone of a vector tile's features, restyled (as `TileVectors`'s) */
|
|
254
|
+
export interface TileStyles {
|
|
255
|
+
styles: Float32Array;
|
|
256
|
+
patterns: string[];
|
|
257
|
+
}
|
|
218
258
|
/** A vector tile ready for the GPU, as the tessellation module makes it (`TessellatedTile`) */
|
|
219
259
|
export interface TileMesh {
|
|
220
260
|
/** Fill vertices, as bytes */
|
|
@@ -21,6 +21,7 @@ import { setHeaderRules, withHeaders } from "../engine/requests.js";
|
|
|
21
21
|
import { decodeGrids } from "../grid-module.js";
|
|
22
22
|
import { polygons, tess, tessellate, tessellator, vectors } from "./basemap/geometry.js";
|
|
23
23
|
import { labels } from "./basemap/labels.js";
|
|
24
|
+
import { lamps } from "./basemap/lamps.js";
|
|
24
25
|
import { render } from "./basemap/raster.js";
|
|
25
26
|
import { streetFlowOf } from "./basemap/street.js";
|
|
26
27
|
import { aborted, active, cache, cacheShare, renderers } from "./basemap/tiles.js";
|
|
@@ -92,6 +93,13 @@ self.onmessage = async ({ data }) => {
|
|
|
92
93
|
else
|
|
93
94
|
post({ id: data.id, trees: out }, [out.buffer]);
|
|
94
95
|
}
|
|
96
|
+
else if (data.type === 'lamps') {
|
|
97
|
+
const out = await lamps(r, data.z, data.x, data.y, data.id, data.spacing, data.maxLamps, data.priority);
|
|
98
|
+
if (!out)
|
|
99
|
+
post({ id: data.id, missing: true });
|
|
100
|
+
else
|
|
101
|
+
post({ id: data.id, lamps: out }, [out.buffer]);
|
|
102
|
+
}
|
|
95
103
|
else if (data.type === 'street') {
|
|
96
104
|
const street = await streetFlowOf(r, data, data.id);
|
|
97
105
|
post({ id: data.id, street }, [street.eastU, street.eastV, street.northU, street.northV].map((a) => a.buffer));
|
|
@@ -114,15 +122,19 @@ self.onmessage = async ({ data }) => {
|
|
|
114
122
|
const out = await vectors(r, data, data.id, data.styles === true, data.priority);
|
|
115
123
|
if (!out)
|
|
116
124
|
post({ id: data.id, missing: true });
|
|
117
|
-
else if (
|
|
118
|
-
post({ id: data.id,
|
|
125
|
+
else if (!('fills' in out))
|
|
126
|
+
post({ id: data.id, ...out }, [out.styles.buffer]);
|
|
119
127
|
else {
|
|
120
128
|
const raised = Uint8Array.from(r.layers, (l) => (vectorKind(l) === 'extrusion' ? 1 : 0));
|
|
121
129
|
const mesh = (await tessellator()) ? tessellate(out, raised, data.prism === true) : undefined;
|
|
122
130
|
const { fills, lines } = out;
|
|
123
131
|
post({ id: data.id, vectors: mesh ? { ...out, mesh } : out }, [
|
|
124
132
|
...[fills.points, fills.ringStart, fills.polygonStart, fills.feature, fills.fillStart].map((a) => a.buffer),
|
|
133
|
+
...[fills.roofs, fills.roofHeights, fills.roofOutlines, fills.roofOutlineStart].flatMap((a) => a ? [a.buffer] : []),
|
|
125
134
|
...[lines.points, lines.start, lines.feature, lines.lineStart].map((a) => a.buffer),
|
|
135
|
+
...(out.circles
|
|
136
|
+
? [out.circles.points, out.circles.feature, out.circles.circleStart].map((a) => a.buffer)
|
|
137
|
+
: []),
|
|
126
138
|
out.styles.buffer,
|
|
127
139
|
out.sublayer.buffer,
|
|
128
140
|
...(mesh
|