isard 1.4.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 +220 -2
- package/README.md +23 -7
- 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 +46 -0
- package/dist/basemap/vectortiles/context.js +6 -0
- package/dist/basemap/vectortiles/context.js.map +1 -0
- package/dist/basemap/vectortiles/extrusions.d.ts +15 -0
- package/dist/basemap/vectortiles/extrusions.js +61 -0
- package/dist/basemap/vectortiles/extrusions.js.map +1 -0
- package/dist/basemap/vectortiles/labels.d.ts +25 -0
- package/dist/basemap/vectortiles/labels.js +250 -0
- package/dist/basemap/vectortiles/labels.js.map +1 -0
- 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 +28 -0
- package/dist/basemap/vectortiles/requests.js +74 -0
- package/dist/basemap/vectortiles/requests.js.map +1 -0
- package/dist/basemap/vectortiles/street-wind.d.ts +19 -0
- package/dist/basemap/vectortiles/street-wind.js +133 -0
- package/dist/basemap/vectortiles/street-wind.js.map +1 -0
- package/dist/basemap/vectortiles/style.d.ts +47 -0
- package/dist/basemap/vectortiles/style.js +141 -0
- package/dist/basemap/vectortiles/style.js.map +1 -0
- package/dist/basemap/vectortiles/tiles.d.ts +34 -0
- package/dist/basemap/vectortiles/tiles.js +62 -0
- package/dist/basemap/vectortiles/tiles.js.map +1 -0
- package/dist/basemap/vectortiles/trees.d.ts +28 -0
- package/dist/basemap/vectortiles/trees.js +178 -0
- package/dist/basemap/vectortiles/trees.js.map +1 -0
- package/dist/basemap/vectortiles/vectors.d.ts +37 -0
- package/dist/basemap/vectortiles/vectors.js +231 -0
- package/dist/basemap/vectortiles/vectors.js.map +1 -0
- package/dist/basemap/vectortiles.d.ts +49 -96
- package/dist/basemap/vectortiles.js +99 -774
- package/dist/basemap/vectortiles.js.map +1 -1
- package/dist/basemap/workerpool.js +25 -6
- package/dist/basemap/workerpool.js.map +1 -1
- package/dist/basemap.worker.js +2 -2
- package/dist/basemap.worker.js.map +14 -12
- 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 -4
- package/dist/decoder.worker.js.map +8 -6
- package/dist/engine/decoders.d.ts +4 -8
- package/dist/engine/decoders.js +29 -2
- package/dist/engine/decoders.js.map +1 -1
- 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 +15 -2
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/isard_bg.wasm +0 -0
- package/dist/isard_core_bg.wasm +0 -0
- package/dist/isard_grid_bg.wasm +0 -0
- package/dist/isard_tess_bg.wasm +0 -0
- package/dist/layers/extrusions.d.ts +10 -0
- package/dist/layers/extrusions.js +28 -2
- package/dist/layers/extrusions.js.map +1 -1
- package/dist/layers/flow.d.ts +9 -2
- package/dist/layers/flow.js +51 -10
- package/dist/layers/flow.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/panoramas.d.ts +2 -0
- package/dist/layers/panoramas.js +27 -6
- package/dist/layers/panoramas.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/workers.js +3 -0
- package/dist/map/workers.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/read.d.ts +4 -0
- package/dist/util/read.js +28 -0
- package/dist/util/read.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 +74 -22
- package/dist/wasm/isard.js +153 -22
- package/dist/wasm/isard_core.d.ts +62 -22
- package/dist/wasm/isard_core.js +129 -22
- 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/street.d.ts +1 -1
- 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
|
@@ -469,6 +469,14 @@ export class Engine {
|
|
|
469
469
|
const ret = wasm.engine_project(this.__wbg_ptr, lon, lat, !isLikeNone(height), isLikeNone(height) ? 0 : height);
|
|
470
470
|
return ret;
|
|
471
471
|
}
|
|
472
|
+
/**
|
|
473
|
+
* A flow layer's second field becomes its field (the model's next hour reached): only the hour after it is then
|
|
474
|
+
* sent (`setFlowNext`)
|
|
475
|
+
* @param {number} id
|
|
476
|
+
*/
|
|
477
|
+
promoteFlowNext(id) {
|
|
478
|
+
wasm.engine_promoteFlowNext(this.__wbg_ptr, id);
|
|
479
|
+
}
|
|
472
480
|
/**
|
|
473
481
|
* Removes batch `key` of an extrusion layer (nothing if there is none)
|
|
474
482
|
* @param {number} id
|
|
@@ -624,7 +632,7 @@ export class Engine {
|
|
|
624
632
|
}
|
|
625
633
|
/**
|
|
626
634
|
* Adds or replaces batch `key` of an extrusion layer: polygons as for `addFills`, `feature_count` features (the
|
|
627
|
-
* 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`)
|
|
628
636
|
*
|
|
629
637
|
* # Errors
|
|
630
638
|
*
|
|
@@ -637,8 +645,11 @@ export class Engine {
|
|
|
637
645
|
* @param {Uint32Array} polygon_start
|
|
638
646
|
* @param {Uint32Array} feature
|
|
639
647
|
* @param {number} feature_count
|
|
648
|
+
* @param {Uint8Array} roofs
|
|
649
|
+
* @param {Float32Array} roof_heights
|
|
650
|
+
* @param {number} metres
|
|
640
651
|
*/
|
|
641
|
-
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) {
|
|
642
653
|
const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
|
|
643
654
|
const len0 = WASM_VECTOR_LEN;
|
|
644
655
|
const ptr1 = passArray32ToWasm0(ring_start, wasm.__wbindgen_malloc);
|
|
@@ -647,11 +658,23 @@ export class Engine {
|
|
|
647
658
|
const len2 = WASM_VECTOR_LEN;
|
|
648
659
|
const ptr3 = passArray32ToWasm0(feature, wasm.__wbindgen_malloc);
|
|
649
660
|
const len3 = WASM_VECTOR_LEN;
|
|
650
|
-
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);
|
|
651
666
|
if (ret[1]) {
|
|
652
667
|
throw takeFromExternrefTable0(ret[0]);
|
|
653
668
|
}
|
|
654
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
|
+
}
|
|
655
678
|
/**
|
|
656
679
|
* Layer-wide style of a feature layer: opacity as zoom stops (four zooms then four values), the zoom range it
|
|
657
680
|
* shows in (`min_zoom` included, `max_zoom` excluded), whether it shows at all
|
|
@@ -777,8 +800,8 @@ export class Engine {
|
|
|
777
800
|
wasm.engine_setFlowField(this.__wbg_ptr, id, width, height, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
778
801
|
}
|
|
779
802
|
/**
|
|
780
|
-
*
|
|
781
|
-
* row; empty: none), mixed in by `setFlowBlend`
|
|
803
|
+
* A flow layer's second field, on its grid (the model's next hour, or the flow of a wind towards the north: east
|
|
804
|
+
* and north components, row after row; empty: none), mixed in by `setFlowBlend` or `setFlowWeights`
|
|
782
805
|
* @param {number} id
|
|
783
806
|
* @param {Float32Array} u
|
|
784
807
|
* @param {Float32Array} v
|
|
@@ -810,6 +833,16 @@ export class Engine {
|
|
|
810
833
|
const len1 = WASM_VECTOR_LEN;
|
|
811
834
|
wasm.engine_setFlowStyle(this.__wbg_ptr, id, ptr0, len0, ptr1, len1, width, opacity, height, speed, density);
|
|
812
835
|
}
|
|
836
|
+
/**
|
|
837
|
+
* A flow layer's velocity as `a` times its field plus `b` times its second one (a wind of `a` m/s towards the east
|
|
838
|
+
* and `b` towards the north, from the flows of 1 m/s each way): nothing sent again but two numbers
|
|
839
|
+
* @param {number} id
|
|
840
|
+
* @param {number} a
|
|
841
|
+
* @param {number} b
|
|
842
|
+
*/
|
|
843
|
+
setFlowWeights(id, a, b) {
|
|
844
|
+
wasm.engine_setFlowWeights(this.__wbg_ptr, id, a, b);
|
|
845
|
+
}
|
|
813
846
|
/**
|
|
814
847
|
* Color of the globe under the tiles (polar caps)
|
|
815
848
|
* @param {number} r
|
|
@@ -1120,25 +1153,27 @@ export class Engine {
|
|
|
1120
1153
|
}
|
|
1121
1154
|
/**
|
|
1122
1155
|
* Layer-wide style of a symbol layer: size scale and opacity as zoom stops (four zooms then four values each),
|
|
1123
|
-
* zoom range, visibility
|
|
1156
|
+
* zoom range, visibility, hidden by the buildings
|
|
1124
1157
|
* @param {number} id
|
|
1125
1158
|
* @param {Float32Array} size
|
|
1126
1159
|
* @param {Float32Array} opacity
|
|
1127
1160
|
* @param {number} min_zoom
|
|
1128
1161
|
* @param {number} max_zoom
|
|
1129
1162
|
* @param {boolean} visible
|
|
1163
|
+
* @param {boolean} occluded
|
|
1130
1164
|
*/
|
|
1131
|
-
setSymbolLayer(id, size, opacity, min_zoom, max_zoom, visible) {
|
|
1165
|
+
setSymbolLayer(id, size, opacity, min_zoom, max_zoom, visible, occluded) {
|
|
1132
1166
|
const ptr0 = passArrayF32ToWasm0(size, wasm.__wbindgen_malloc);
|
|
1133
1167
|
const len0 = WASM_VECTOR_LEN;
|
|
1134
1168
|
const ptr1 = passArrayF32ToWasm0(opacity, wasm.__wbindgen_malloc);
|
|
1135
1169
|
const len1 = WASM_VECTOR_LEN;
|
|
1136
|
-
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);
|
|
1137
1171
|
}
|
|
1138
1172
|
/**
|
|
1139
1173
|
* Labels of a symbol layer, shaped by the page: anchors (Mercator, interleaved), their texts' boxes (min x, min y,
|
|
1140
|
-
* max x, max y, CSS pixels from the anchor), styles (
|
|
1141
|
-
* (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)
|
|
1142
1177
|
*
|
|
1143
1178
|
* # Errors
|
|
1144
1179
|
*
|
|
@@ -1149,8 +1184,9 @@ export class Engine {
|
|
|
1149
1184
|
* @param {Float32Array} boxes
|
|
1150
1185
|
* @param {Float32Array} styles
|
|
1151
1186
|
* @param {Float32Array} quads
|
|
1187
|
+
* @param {Float64Array} paths
|
|
1152
1188
|
*/
|
|
1153
|
-
setSymbols(id, anchors, boxes, styles, quads) {
|
|
1189
|
+
setSymbols(id, anchors, boxes, styles, quads, paths) {
|
|
1154
1190
|
const ptr0 = passArrayF64ToWasm0(anchors, wasm.__wbindgen_malloc);
|
|
1155
1191
|
const len0 = WASM_VECTOR_LEN;
|
|
1156
1192
|
const ptr1 = passArrayF32ToWasm0(boxes, wasm.__wbindgen_malloc);
|
|
@@ -1159,7 +1195,9 @@ export class Engine {
|
|
|
1159
1195
|
const len2 = WASM_VECTOR_LEN;
|
|
1160
1196
|
const ptr3 = passArrayF32ToWasm0(quads, wasm.__wbindgen_malloc);
|
|
1161
1197
|
const len3 = WASM_VECTOR_LEN;
|
|
1162
|
-
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);
|
|
1163
1201
|
if (ret[1]) {
|
|
1164
1202
|
throw takeFromExternrefTable0(ret[0]);
|
|
1165
1203
|
}
|
|
@@ -1192,11 +1230,15 @@ export class Engine {
|
|
|
1192
1230
|
}
|
|
1193
1231
|
}
|
|
1194
1232
|
/**
|
|
1195
|
-
* 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
|
|
1196
1235
|
* (two numbers: shown from the first, included, to the second, excluded), whether it shows (0 or 1), its dashes
|
|
1197
1236
|
* (four numbers: dash, gap, dash, gap, in line widths; 0: solid), its opacity as zoom stops (four zooms then four
|
|
1198
1237
|
* values; missing: opaque), the caps of its lines' ends (0 butt, 1 round, 2 square; missing: round), whether its
|
|
1199
|
-
* 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)
|
|
1200
1242
|
* @param {number} id
|
|
1201
1243
|
* @param {Uint8Array} kinds
|
|
1202
1244
|
* @param {Float64Array} zooms
|
|
@@ -1205,8 +1247,11 @@ export class Engine {
|
|
|
1205
1247
|
* @param {Float32Array} opacities
|
|
1206
1248
|
* @param {Uint8Array} caps
|
|
1207
1249
|
* @param {Uint8Array} lit
|
|
1250
|
+
* @param {Float32Array} joins
|
|
1251
|
+
* @param {Float32Array} translates
|
|
1252
|
+
* @param {Uint8Array} patterned
|
|
1208
1253
|
*/
|
|
1209
|
-
setVectorSublayers(id, kinds, zooms, visible, dashes, opacities, caps, lit) {
|
|
1254
|
+
setVectorSublayers(id, kinds, zooms, visible, dashes, opacities, caps, lit, joins, translates, patterned) {
|
|
1210
1255
|
const ptr0 = passArray8ToWasm0(kinds, wasm.__wbindgen_malloc);
|
|
1211
1256
|
const len0 = WASM_VECTOR_LEN;
|
|
1212
1257
|
const ptr1 = passArrayF64ToWasm0(zooms, wasm.__wbindgen_malloc);
|
|
@@ -1221,7 +1266,13 @@ export class Engine {
|
|
|
1221
1266
|
const len5 = WASM_VECTOR_LEN;
|
|
1222
1267
|
const ptr6 = passArray8ToWasm0(lit, wasm.__wbindgen_malloc);
|
|
1223
1268
|
const len6 = WASM_VECTOR_LEN;
|
|
1224
|
-
|
|
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);
|
|
1225
1276
|
}
|
|
1226
1277
|
/**
|
|
1227
1278
|
* Adds or replaces tile `key` of a vector tile layer ready for the GPU, as the basemap workers make it (the
|
|
@@ -1293,13 +1344,36 @@ export class Engine {
|
|
|
1293
1344
|
throw takeFromExternrefTable0(ret[0]);
|
|
1294
1345
|
}
|
|
1295
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
|
+
}
|
|
1296
1366
|
/**
|
|
1297
1367
|
* Adds or replaces tile `key` of a vector tile layer: its polygons as for `addFills` (`fill_start`: the first
|
|
1298
1368
|
* polygon of each sublayer, and the end; those of an extrusion sublayer raised into blocks), its lines as for
|
|
1299
1369
|
* `addLines` (`line_start`: the first line of each sublayer, and the end), `feature_count` features, styled as an
|
|
1300
1370
|
* extrusion layer's (`setFeatureStyle` with the key: a color, then a line's width or a block's height and base);
|
|
1301
1371
|
* `tile`: the corners of the tile they are cut to (west, north, east, south; empty: none), along whose edges no
|
|
1302
|
-
* 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
|
|
1303
1377
|
*
|
|
1304
1378
|
* # Errors
|
|
1305
1379
|
*
|
|
@@ -1318,8 +1392,13 @@ export class Engine {
|
|
|
1318
1392
|
* @param {Uint32Array} line_start
|
|
1319
1393
|
* @param {number} feature_count
|
|
1320
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
|
|
1321
1400
|
*/
|
|
1322
|
-
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) {
|
|
1323
1402
|
const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
|
|
1324
1403
|
const len0 = WASM_VECTOR_LEN;
|
|
1325
1404
|
const ptr1 = passArray32ToWasm0(ring_start, wasm.__wbindgen_malloc);
|
|
@@ -1340,7 +1419,15 @@ export class Engine {
|
|
|
1340
1419
|
const len8 = WASM_VECTOR_LEN;
|
|
1341
1420
|
const ptr9 = passArrayF64ToWasm0(tile, wasm.__wbindgen_malloc);
|
|
1342
1421
|
const len9 = WASM_VECTOR_LEN;
|
|
1343
|
-
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);
|
|
1344
1431
|
if (ret[1]) {
|
|
1345
1432
|
throw takeFromExternrefTable0(ret[0]);
|
|
1346
1433
|
}
|
|
@@ -1393,12 +1480,15 @@ export class Engine {
|
|
|
1393
1480
|
return ret;
|
|
1394
1481
|
}
|
|
1395
1482
|
/**
|
|
1396
|
-
* Moves a flow layer's particles by `seconds` of the page's time (one animation frame), in the current view
|
|
1483
|
+
* Moves a flow layer's particles by `seconds` of the page's time (one animation frame), in the current view;
|
|
1484
|
+
* whether they moved (none in view, or no field: the map need not be drawn again)
|
|
1397
1485
|
* @param {number} id
|
|
1398
1486
|
* @param {number} seconds
|
|
1487
|
+
* @returns {boolean}
|
|
1399
1488
|
*/
|
|
1400
1489
|
stepFlow(id, seconds) {
|
|
1401
|
-
wasm.engine_stepFlow(this.__wbg_ptr, id, seconds);
|
|
1490
|
+
const ret = wasm.engine_stepFlow(this.__wbg_ptr, id, seconds);
|
|
1491
|
+
return ret !== 0;
|
|
1402
1492
|
}
|
|
1403
1493
|
/**
|
|
1404
1494
|
* The height above the relief (metres) of the top of what stands at a position (degrees): a roof, a mesh, 0 on
|
|
@@ -1490,6 +1580,17 @@ export class Engine {
|
|
|
1490
1580
|
const len0 = WASM_VECTOR_LEN;
|
|
1491
1581
|
wasm.engine_updateIconAtlas(this.__wbg_ptr, x, y, width, height, ptr0, len0);
|
|
1492
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
|
+
}
|
|
1493
1594
|
/**
|
|
1494
1595
|
* Vector tiles (512 CSS pixels across at their level, as `MapLibre`'s) for the view of the last frame (else the
|
|
1495
1596
|
* camera's), levels `min_z` to `max_z`, three numbers per tile (z, x, y), the nearest to the eye first: what a
|
|
@@ -1661,6 +1762,12 @@ function __wbg_get_imports() {
|
|
|
1661
1762
|
__wbg_bufferData_bad7ce562b6a9eac: function(arg0, arg1, arg2, arg3) {
|
|
1662
1763
|
arg0.bufferData(arg1 >>> 0, arg2, arg3 >>> 0);
|
|
1663
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
|
+
},
|
|
1664
1771
|
__wbg_byteLength_27689b065d089962: function(arg0) {
|
|
1665
1772
|
const ret = arg0.byteLength;
|
|
1666
1773
|
return ret;
|
|
@@ -2529,7 +2636,7 @@ function __wbg_get_imports() {
|
|
|
2529
2636
|
return ret;
|
|
2530
2637
|
},
|
|
2531
2638
|
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
2532
|
-
// 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`.
|
|
2533
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_);
|
|
2534
2641
|
return ret;
|
|
2535
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>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* the flow round them for a wind towards the east and one towards the north (the grid module) */
|
|
3
3
|
import { type StreetFlows } from '../../grid-module.ts';
|
|
4
4
|
import type { Priority } from '../basemap.worker.ts';
|
|
5
|
-
import type
|
|
5
|
+
import { type Renderer } from './tiles.ts';
|
|
6
6
|
/** What a street flow is asked with: its square (Mercator: west, north, east, south) and grid, the tiles of level `z`
|
|
7
7
|
* over it (x, y pairs), the sweeps, the grid module's URL */
|
|
8
8
|
export interface StreetWork {
|
|
@@ -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 */
|