isard 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +88 -0
- package/README.md +44 -39
- package/dist/basemap/pmtileslayer.d.ts +33 -0
- package/dist/basemap/pmtileslayer.js +97 -0
- package/dist/basemap/pmtileslayer.js.map +1 -0
- package/dist/basemap/trees.d.ts +26 -0
- package/dist/basemap/trees.js +141 -0
- package/dist/basemap/trees.js.map +1 -0
- package/dist/basemap/vectorstyle.d.ts +10 -0
- package/dist/basemap/vectorstyle.js +35 -0
- package/dist/basemap/vectorstyle.js.map +1 -1
- package/dist/basemap/vectortiles.d.ts +67 -44
- package/dist/basemap/vectortiles.js +386 -302
- package/dist/basemap/vectortiles.js.map +1 -1
- package/dist/basemap/workerpool.d.ts +17 -0
- package/dist/basemap/workerpool.js +194 -0
- package/dist/basemap/workerpool.js.map +1 -0
- package/dist/basemap.worker.js +2 -2
- package/dist/basemap.worker.js.map +15 -8
- package/dist/decoder.worker.js +4 -4
- package/dist/decoder.worker.js.map +3 -3
- package/dist/engine-loader.d.ts +5 -1
- package/dist/engine-loader.js +11 -1
- package/dist/engine-loader.js.map +1 -1
- package/dist/geoplateforme.d.ts +16 -0
- package/dist/geoplateforme.js +23 -0
- package/dist/geoplateforme.js.map +1 -1
- package/dist/index.d.ts +11 -4
- package/dist/index.js +9 -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_tess_bg.wasm +0 -0
- package/dist/layers/layers.js +9 -0
- package/dist/layers/layers.js.map +1 -1
- package/dist/layers/vectors.d.ts +60 -0
- package/dist/layers/vectors.js +130 -0
- package/dist/layers/vectors.js.map +1 -0
- package/dist/map/frame-loop.d.ts +3 -0
- package/dist/map/frame-loop.js +6 -0
- package/dist/map/frame-loop.js.map +1 -1
- package/dist/map/raster-source.js +1 -1
- package/dist/map/raster-source.js.map +1 -1
- package/dist/map/workers.d.ts +1 -1
- package/dist/map/workers.js +1 -1
- package/dist/map/workers.js.map +1 -1
- package/dist/map.d.ts +21 -6
- package/dist/map.js +65 -11
- package/dist/map.js.map +1 -1
- package/dist/react/IsardMap.js +1 -0
- package/dist/react/IsardMap.js.map +1 -1
- package/dist/react/Swipe.d.ts +11 -4
- package/dist/react/Swipe.js +26 -15
- package/dist/react/Swipe.js.map +1 -1
- package/dist/react/VectorGeometry.d.ts +35 -0
- package/dist/react/VectorGeometry.js +82 -0
- package/dist/react/VectorGeometry.js.map +1 -0
- package/dist/react/context.d.ts +2 -1
- package/dist/react/context.js.map +1 -1
- package/dist/react/index.d.ts +2 -1
- package/dist/react/index.js +2 -1
- package/dist/react/index.js.map +1 -1
- package/dist/types.d.ts +24 -1
- package/dist/types.js.map +1 -1
- package/dist/ui/minimap.d.ts +25 -0
- package/dist/ui/minimap.js +90 -0
- package/dist/ui/minimap.js.map +1 -0
- package/dist/ui/scale.d.ts +19 -0
- package/dist/ui/scale.js +44 -0
- package/dist/ui/scale.js.map +1 -0
- package/dist/ui/search.d.ts +25 -0
- package/dist/ui/search.js +119 -0
- package/dist/ui/search.js.map +1 -0
- package/dist/ui/style.js +17 -0
- package/dist/ui/style.js.map +1 -1
- package/dist/util/sun.d.ts +11 -0
- package/dist/util/sun.js +26 -0
- package/dist/util/sun.js.map +1 -0
- package/dist/wasm/isard.d.ts +82 -7
- package/dist/wasm/isard.js +229 -8
- package/dist/wasm/isard_core.d.ts +82 -7
- package/dist/wasm/isard_core.js +229 -8
- package/dist/wasm/isard_tess.d.ts +109 -0
- package/dist/wasm/isard_tess.js +398 -0
- package/dist/workers/basemap/geometry.d.ts +72 -0
- package/dist/workers/basemap/labels.d.ts +8 -0
- package/dist/workers/basemap/raster.d.ts +10 -0
- package/dist/workers/basemap/tiles.d.ts +65 -0
- package/dist/workers/basemap/trees.d.ts +19 -0
- package/dist/workers/basemap.worker.d.ts +126 -22
- package/dist/workers/basemap.worker.js +72 -551
- package/dist/workers/basemap.worker.js.map +1 -1
- package/package.json +5 -4
- package/vite.js +10 -2
package/dist/wasm/isard_core.js
CHANGED
|
@@ -231,6 +231,22 @@ export class Engine {
|
|
|
231
231
|
}
|
|
232
232
|
return ret[0] >>> 0;
|
|
233
233
|
}
|
|
234
|
+
/**
|
|
235
|
+
* An empty layer of vector tiles drawn as geometry: its style layers come with `setVectorSublayers`, its tiles
|
|
236
|
+
* with `setVectorTile`
|
|
237
|
+
*
|
|
238
|
+
* # Errors
|
|
239
|
+
*
|
|
240
|
+
* Throws (to JavaScript) when a shader fails to compile (the error carries its info log)
|
|
241
|
+
* @returns {number}
|
|
242
|
+
*/
|
|
243
|
+
addVectorTiles() {
|
|
244
|
+
const ret = wasm.engine_addVectorTiles(this.__wbg_ptr);
|
|
245
|
+
if (ret[2]) {
|
|
246
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
247
|
+
}
|
|
248
|
+
return ret[0] >>> 0;
|
|
249
|
+
}
|
|
234
250
|
/**
|
|
235
251
|
* Longitudes and latitudes the view covers on the ground, `[west, south, east, north]` (degrees): the screen's
|
|
236
252
|
* border cast on the ground, or on the far plane where it passes the horizon
|
|
@@ -449,6 +465,14 @@ export class Engine {
|
|
|
449
465
|
removeLayer(id) {
|
|
450
466
|
wasm.engine_removeLayer(this.__wbg_ptr, id);
|
|
451
467
|
}
|
|
468
|
+
/**
|
|
469
|
+
* Removes tile `key` of a vector tile layer (nothing if there is none)
|
|
470
|
+
* @param {number} id
|
|
471
|
+
* @param {number} key
|
|
472
|
+
*/
|
|
473
|
+
removeVectorTile(id, key) {
|
|
474
|
+
wasm.engine_removeVectorTile(this.__wbg_ptr, id, key);
|
|
475
|
+
}
|
|
452
476
|
/**
|
|
453
477
|
* Draws a frame: the backdrop, the ground and the layers over it bottom to top, then the panorama and the
|
|
454
478
|
* viewshed; returns true while tiles are still loading (a new frame will be asked through `redraw`)
|
|
@@ -647,10 +671,10 @@ export class Engine {
|
|
|
647
671
|
wasm.engine_setFeatureRamp(this.__wbg_ptr, id, ptr0, len0, min, max);
|
|
648
672
|
}
|
|
649
673
|
/**
|
|
650
|
-
* Style of the features of a line, circle, fill or
|
|
651
|
-
* feature, its color (RGBA 0-1), its second color (a circle's stroke), then two sizes as zoom
|
|
652
|
-
* four values each): a line's width; a circle's radius and stroke width, CSS pixels; a block's
|
|
653
|
-
* height, metres
|
|
674
|
+
* Style of the features of a line, circle, fill, extrusion or vector tile layer (batch or tile `key` of the last
|
|
675
|
+
* two): 32 floats per feature, its color (RGBA 0-1), its second color (a circle's stroke), then two sizes as zoom
|
|
676
|
+
* stops (four zooms, four values each): a line's width; a circle's radius and stroke width, CSS pixels; a block's
|
|
677
|
+
* height and base height, metres
|
|
654
678
|
* @param {number} id
|
|
655
679
|
* @param {Float32Array} style
|
|
656
680
|
* @param {number | null} [key]
|
|
@@ -977,17 +1001,40 @@ export class Engine {
|
|
|
977
1001
|
setSky(enabled) {
|
|
978
1002
|
wasm.engine_setSky(this.__wbg_ptr, enabled);
|
|
979
1003
|
}
|
|
1004
|
+
/**
|
|
1005
|
+
* The sun casting shadows and the night: its azimuth (degrees clockwise from north) and altitude (degrees above
|
|
1006
|
+
* the horizon), the shadows' opacity (0 to 1; none under the horizon or not a number), how dark the night is (0 to
|
|
1007
|
+
* 1: the frame tinted, the lights of the layers on). Neither shadows nor night: nothing drawn
|
|
1008
|
+
*
|
|
1009
|
+
* # Errors
|
|
1010
|
+
*
|
|
1011
|
+
* Throws (to JavaScript) when a WebGL object cannot be created or the pass fails to compile
|
|
1012
|
+
* @param {number} azimuth
|
|
1013
|
+
* @param {number} altitude
|
|
1014
|
+
* @param {number} opacity
|
|
1015
|
+
* @param {number} night
|
|
1016
|
+
*/
|
|
1017
|
+
setSun(azimuth, altitude, opacity, night) {
|
|
1018
|
+
const ret = wasm.engine_setSun(this.__wbg_ptr, azimuth, altitude, opacity, night);
|
|
1019
|
+
if (ret[1]) {
|
|
1020
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
980
1023
|
/**
|
|
981
1024
|
* Shows `layers` on one side of a vertical line only, the others beneath on the other side (comparing two states
|
|
982
|
-
* of a place): left of `x` (CSS pixels from the left of the canvas), or right of it;
|
|
1025
|
+
* of a place): left of `x` (CSS pixels from the left of the canvas), or right of it; `others` on the other side
|
|
1026
|
+
* only (two meshes of the same place, each on its side, never drawn over each other); a non-finite `x` stops
|
|
983
1027
|
* @param {number} x
|
|
984
1028
|
* @param {boolean} right
|
|
985
1029
|
* @param {Uint32Array} layers
|
|
1030
|
+
* @param {Uint32Array} others
|
|
986
1031
|
*/
|
|
987
|
-
setSwipe(x, right, layers) {
|
|
1032
|
+
setSwipe(x, right, layers, others) {
|
|
988
1033
|
const ptr0 = passArray32ToWasm0(layers, wasm.__wbindgen_malloc);
|
|
989
1034
|
const len0 = WASM_VECTOR_LEN;
|
|
990
|
-
|
|
1035
|
+
const ptr1 = passArray32ToWasm0(others, wasm.__wbindgen_malloc);
|
|
1036
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1037
|
+
wasm.engine_setSwipe(this.__wbg_ptr, x, right, ptr0, len0, ptr1, len1);
|
|
991
1038
|
}
|
|
992
1039
|
/**
|
|
993
1040
|
* Layer-wide style of a symbol layer: size scale and opacity as zoom stops (four zooms then four values each),
|
|
@@ -1062,6 +1109,160 @@ export class Engine {
|
|
|
1062
1109
|
throw takeFromExternrefTable0(ret[0]);
|
|
1063
1110
|
}
|
|
1064
1111
|
}
|
|
1112
|
+
/**
|
|
1113
|
+
* The style layers of a vector tile layer, in drawing order: per layer, its kind (0 fill, 1 line, 2 extrusion), its zoom range
|
|
1114
|
+
* (two numbers: shown from the first, included, to the second, excluded), whether it shows (0 or 1), its dashes
|
|
1115
|
+
* (four numbers: dash, gap, dash, gap, in line widths; 0: solid), its opacity as zoom stops (four zooms then four
|
|
1116
|
+
* values; missing: opaque), the caps of its lines' ends (0 butt, 1 round, 2 square; missing: round), whether its
|
|
1117
|
+
* lines glow at night (streets; 0 or 1)
|
|
1118
|
+
* @param {number} id
|
|
1119
|
+
* @param {Uint8Array} kinds
|
|
1120
|
+
* @param {Float64Array} zooms
|
|
1121
|
+
* @param {Uint8Array} visible
|
|
1122
|
+
* @param {Float32Array} dashes
|
|
1123
|
+
* @param {Float32Array} opacities
|
|
1124
|
+
* @param {Uint8Array} caps
|
|
1125
|
+
* @param {Uint8Array} lit
|
|
1126
|
+
*/
|
|
1127
|
+
setVectorSublayers(id, kinds, zooms, visible, dashes, opacities, caps, lit) {
|
|
1128
|
+
const ptr0 = passArray8ToWasm0(kinds, wasm.__wbindgen_malloc);
|
|
1129
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1130
|
+
const ptr1 = passArrayF64ToWasm0(zooms, wasm.__wbindgen_malloc);
|
|
1131
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1132
|
+
const ptr2 = passArray8ToWasm0(visible, wasm.__wbindgen_malloc);
|
|
1133
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1134
|
+
const ptr3 = passArrayF32ToWasm0(dashes, wasm.__wbindgen_malloc);
|
|
1135
|
+
const len3 = WASM_VECTOR_LEN;
|
|
1136
|
+
const ptr4 = passArrayF32ToWasm0(opacities, wasm.__wbindgen_malloc);
|
|
1137
|
+
const len4 = WASM_VECTOR_LEN;
|
|
1138
|
+
const ptr5 = passArray8ToWasm0(caps, wasm.__wbindgen_malloc);
|
|
1139
|
+
const len5 = WASM_VECTOR_LEN;
|
|
1140
|
+
const ptr6 = passArray8ToWasm0(lit, wasm.__wbindgen_malloc);
|
|
1141
|
+
const len6 = WASM_VECTOR_LEN;
|
|
1142
|
+
wasm.engine_setVectorSublayers(this.__wbg_ptr, id, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6);
|
|
1143
|
+
}
|
|
1144
|
+
/**
|
|
1145
|
+
* Adds or replaces tile `key` of a vector tile layer ready for the GPU, as the basemap workers make it (the
|
|
1146
|
+
* tessellation module): its polygons as for `setVectorTile` (picked here; their prisms built here if drawn in
|
|
1147
|
+
* relief while `prism` is false), the vertices of its fills (`shapes::Vertex` as bytes, each with its feature),
|
|
1148
|
+
* their triangles, per sublayer its top cap and the rest of its prism (`fill_ranges`: four numbers, first and
|
|
1149
|
+
* end of each), its line pieces (`pieces::Piece` as bytes), the line table (feature and length of each line),
|
|
1150
|
+
* per sublayer its pieces (`line_ranges`: first, end), the blocks of its extrusion sublayers (`shapes::Block` as
|
|
1151
|
+
* bytes), their triangles, per sublayer its blocks' triangles (`block_ranges`: first, end), the extent of its
|
|
1152
|
+
* points (`bounds`: min x, min y, max x, max y), `feature_count` features
|
|
1153
|
+
*
|
|
1154
|
+
* # Errors
|
|
1155
|
+
*
|
|
1156
|
+
* Throws (to JavaScript) when the vertices, pieces or blocks are cut short, when a WebGL object of the tile cannot be
|
|
1157
|
+
* created, or when its features or lines need a table texture past the GPU's `MAX_TEXTURE_SIZE`
|
|
1158
|
+
* @param {number} id
|
|
1159
|
+
* @param {number} key
|
|
1160
|
+
* @param {Float64Array} points
|
|
1161
|
+
* @param {Uint32Array} ring_start
|
|
1162
|
+
* @param {Uint32Array} polygon_start
|
|
1163
|
+
* @param {Uint32Array} polygon_feature
|
|
1164
|
+
* @param {Uint32Array} fill_start
|
|
1165
|
+
* @param {Uint8Array} vertices
|
|
1166
|
+
* @param {Uint32Array} indices
|
|
1167
|
+
* @param {Uint32Array} fill_ranges
|
|
1168
|
+
* @param {boolean} prism
|
|
1169
|
+
* @param {Uint8Array} pieces
|
|
1170
|
+
* @param {Float32Array} line_table
|
|
1171
|
+
* @param {Uint32Array} line_ranges
|
|
1172
|
+
* @param {Uint8Array} blocks
|
|
1173
|
+
* @param {Uint32Array} block_indices
|
|
1174
|
+
* @param {Uint32Array} block_ranges
|
|
1175
|
+
* @param {Float64Array} bounds
|
|
1176
|
+
* @param {number} feature_count
|
|
1177
|
+
*/
|
|
1178
|
+
setVectorTileMesh(id, key, points, ring_start, polygon_start, polygon_feature, fill_start, vertices, indices, fill_ranges, prism, pieces, line_table, line_ranges, blocks, block_indices, block_ranges, bounds, feature_count) {
|
|
1179
|
+
const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
|
|
1180
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1181
|
+
const ptr1 = passArray32ToWasm0(ring_start, wasm.__wbindgen_malloc);
|
|
1182
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1183
|
+
const ptr2 = passArray32ToWasm0(polygon_start, wasm.__wbindgen_malloc);
|
|
1184
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1185
|
+
const ptr3 = passArray32ToWasm0(polygon_feature, wasm.__wbindgen_malloc);
|
|
1186
|
+
const len3 = WASM_VECTOR_LEN;
|
|
1187
|
+
const ptr4 = passArray32ToWasm0(fill_start, wasm.__wbindgen_malloc);
|
|
1188
|
+
const len4 = WASM_VECTOR_LEN;
|
|
1189
|
+
const ptr5 = passArray8ToWasm0(vertices, wasm.__wbindgen_malloc);
|
|
1190
|
+
const len5 = WASM_VECTOR_LEN;
|
|
1191
|
+
const ptr6 = passArray32ToWasm0(indices, wasm.__wbindgen_malloc);
|
|
1192
|
+
const len6 = WASM_VECTOR_LEN;
|
|
1193
|
+
const ptr7 = passArray32ToWasm0(fill_ranges, wasm.__wbindgen_malloc);
|
|
1194
|
+
const len7 = WASM_VECTOR_LEN;
|
|
1195
|
+
const ptr8 = passArray8ToWasm0(pieces, wasm.__wbindgen_malloc);
|
|
1196
|
+
const len8 = WASM_VECTOR_LEN;
|
|
1197
|
+
const ptr9 = passArrayF32ToWasm0(line_table, wasm.__wbindgen_malloc);
|
|
1198
|
+
const len9 = WASM_VECTOR_LEN;
|
|
1199
|
+
const ptr10 = passArray32ToWasm0(line_ranges, wasm.__wbindgen_malloc);
|
|
1200
|
+
const len10 = WASM_VECTOR_LEN;
|
|
1201
|
+
const ptr11 = passArray8ToWasm0(blocks, wasm.__wbindgen_malloc);
|
|
1202
|
+
const len11 = WASM_VECTOR_LEN;
|
|
1203
|
+
const ptr12 = passArray32ToWasm0(block_indices, wasm.__wbindgen_malloc);
|
|
1204
|
+
const len12 = WASM_VECTOR_LEN;
|
|
1205
|
+
const ptr13 = passArray32ToWasm0(block_ranges, wasm.__wbindgen_malloc);
|
|
1206
|
+
const len13 = WASM_VECTOR_LEN;
|
|
1207
|
+
const ptr14 = passArrayF64ToWasm0(bounds, wasm.__wbindgen_malloc);
|
|
1208
|
+
const len14 = WASM_VECTOR_LEN;
|
|
1209
|
+
const ret = wasm.engine_setVectorTileMesh(this.__wbg_ptr, id, key, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6, ptr7, len7, prism, ptr8, len8, ptr9, len9, ptr10, len10, ptr11, len11, ptr12, len12, ptr13, len13, ptr14, len14, feature_count);
|
|
1210
|
+
if (ret[1]) {
|
|
1211
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
/**
|
|
1215
|
+
* Adds or replaces tile `key` of a vector tile layer: its polygons as for `addFills` (`fill_start`: the first
|
|
1216
|
+
* polygon of each sublayer, and the end; those of an extrusion sublayer raised into blocks), its lines as for
|
|
1217
|
+
* `addLines` (`line_start`: the first line of each sublayer, and the end), `feature_count` features, styled as an
|
|
1218
|
+
* extrusion layer's (`setFeatureStyle` with the key: a color, then a line's width or a block's height and base);
|
|
1219
|
+
* `tile`: the corners of the tile they are cut to (west, north, east, south; empty: none), along whose edges no
|
|
1220
|
+
* wall of a block rises
|
|
1221
|
+
*
|
|
1222
|
+
* # Errors
|
|
1223
|
+
*
|
|
1224
|
+
* Throws (to JavaScript) when a WebGL object of the tile cannot be created, or when its features or lines need a
|
|
1225
|
+
* table texture past the GPU's `MAX_TEXTURE_SIZE`
|
|
1226
|
+
* @param {number} id
|
|
1227
|
+
* @param {number} key
|
|
1228
|
+
* @param {Float64Array} points
|
|
1229
|
+
* @param {Uint32Array} ring_start
|
|
1230
|
+
* @param {Uint32Array} polygon_start
|
|
1231
|
+
* @param {Uint32Array} polygon_feature
|
|
1232
|
+
* @param {Uint32Array} fill_start
|
|
1233
|
+
* @param {Float64Array} line_points
|
|
1234
|
+
* @param {Uint32Array} line_first
|
|
1235
|
+
* @param {Uint32Array} line_feature
|
|
1236
|
+
* @param {Uint32Array} line_start
|
|
1237
|
+
* @param {number} feature_count
|
|
1238
|
+
* @param {Float64Array} tile
|
|
1239
|
+
*/
|
|
1240
|
+
setVectorTile(id, key, points, ring_start, polygon_start, polygon_feature, fill_start, line_points, line_first, line_feature, line_start, feature_count, tile) {
|
|
1241
|
+
const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
|
|
1242
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1243
|
+
const ptr1 = passArray32ToWasm0(ring_start, wasm.__wbindgen_malloc);
|
|
1244
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1245
|
+
const ptr2 = passArray32ToWasm0(polygon_start, wasm.__wbindgen_malloc);
|
|
1246
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1247
|
+
const ptr3 = passArray32ToWasm0(polygon_feature, wasm.__wbindgen_malloc);
|
|
1248
|
+
const len3 = WASM_VECTOR_LEN;
|
|
1249
|
+
const ptr4 = passArray32ToWasm0(fill_start, wasm.__wbindgen_malloc);
|
|
1250
|
+
const len4 = WASM_VECTOR_LEN;
|
|
1251
|
+
const ptr5 = passArrayF64ToWasm0(line_points, wasm.__wbindgen_malloc);
|
|
1252
|
+
const len5 = WASM_VECTOR_LEN;
|
|
1253
|
+
const ptr6 = passArray32ToWasm0(line_first, wasm.__wbindgen_malloc);
|
|
1254
|
+
const len6 = WASM_VECTOR_LEN;
|
|
1255
|
+
const ptr7 = passArray32ToWasm0(line_feature, wasm.__wbindgen_malloc);
|
|
1256
|
+
const len7 = WASM_VECTOR_LEN;
|
|
1257
|
+
const ptr8 = passArray32ToWasm0(line_start, wasm.__wbindgen_malloc);
|
|
1258
|
+
const len8 = WASM_VECTOR_LEN;
|
|
1259
|
+
const ptr9 = passArrayF64ToWasm0(tile, wasm.__wbindgen_malloc);
|
|
1260
|
+
const len9 = WASM_VECTOR_LEN;
|
|
1261
|
+
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);
|
|
1262
|
+
if (ret[1]) {
|
|
1263
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1065
1266
|
/**
|
|
1066
1267
|
* Shows what can be seen from points, each within its range: `observers` holds 8 numbers per observer
|
|
1067
1268
|
* (16 at most): longitude, latitude (degrees), metres above the ground, range (metres), then to look one way
|
|
@@ -1199,6 +1400,20 @@ export class Engine {
|
|
|
1199
1400
|
const len0 = WASM_VECTOR_LEN;
|
|
1200
1401
|
wasm.engine_updateIconAtlas(this.__wbg_ptr, x, y, width, height, ptr0, len0);
|
|
1201
1402
|
}
|
|
1403
|
+
/**
|
|
1404
|
+
* Vector tiles (512 CSS pixels across at their level, as `MapLibre`'s) for the view of the last frame (else the
|
|
1405
|
+
* camera's), levels `min_z` to `max_z`, three numbers per tile (z, x, y), the nearest to the eye first: what a
|
|
1406
|
+
* vector tile layer draws (`addVectorTiles`), coarser far away in a tilted view as the raster layers
|
|
1407
|
+
* @param {number} min_z
|
|
1408
|
+
* @param {number} max_z
|
|
1409
|
+
* @returns {Uint32Array}
|
|
1410
|
+
*/
|
|
1411
|
+
vectorTilesInView(min_z, max_z) {
|
|
1412
|
+
const ret = wasm.engine_vectorTilesInView(this.__wbg_ptr, min_z, max_z);
|
|
1413
|
+
var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
|
|
1414
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
1415
|
+
return v1;
|
|
1416
|
+
}
|
|
1202
1417
|
/**
|
|
1203
1418
|
* Tiles a raster layer wants for the view of the last frame, three numbers per tile (z, x, y), the nearest to
|
|
1204
1419
|
* the eye first: the level each area of the ground is drawn at, for the labels of a vector style to follow it
|
|
@@ -1880,6 +2095,12 @@ function __wbg_get_imports() {
|
|
|
1880
2095
|
__wbg_pixelStorei_cb4e43466f5b8703: function(arg0, arg1, arg2) {
|
|
1881
2096
|
arg0.pixelStorei(arg1 >>> 0, arg2);
|
|
1882
2097
|
},
|
|
2098
|
+
__wbg_polygonOffset_81dc8ca84e29572b: function(arg0, arg1, arg2) {
|
|
2099
|
+
arg0.polygonOffset(arg1, arg2);
|
|
2100
|
+
},
|
|
2101
|
+
__wbg_polygonOffset_8f922d9173d8849d: function(arg0, arg1, arg2) {
|
|
2102
|
+
arg0.polygonOffset(arg1, arg2);
|
|
2103
|
+
},
|
|
1883
2104
|
__wbg_prototypesetcall_8b03c01e2c0f8066: function(arg0, arg1, arg2) {
|
|
1884
2105
|
Float32Array.prototype.set.call(getArrayF32FromWasm0(arg0, arg1), arg2);
|
|
1885
2106
|
},
|
|
@@ -2218,7 +2439,7 @@ function __wbg_get_imports() {
|
|
|
2218
2439
|
return ret;
|
|
2219
2440
|
},
|
|
2220
2441
|
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
2221
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
2442
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 106, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
2222
2443
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_2e566c63402fe7fa___convert__closures_____invoke___wasm_bindgen_2e566c63402fe7fa___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_2e566c63402fe7fa___JsError___true_);
|
|
2223
2444
|
return ret;
|
|
2224
2445
|
},
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A vector tile ready for the GPU (`geo::mesh::vector_tiles::TileMesh`), as the engine's `setVectorTileMesh` takes it
|
|
6
|
+
*/
|
|
7
|
+
export class TessellatedTile {
|
|
8
|
+
private constructor();
|
|
9
|
+
free(): void;
|
|
10
|
+
/**
|
|
11
|
+
* Their triangles
|
|
12
|
+
*/
|
|
13
|
+
blockIndices(): Uint32Array;
|
|
14
|
+
/**
|
|
15
|
+
* Per sublayer: its blocks' indices, first and end
|
|
16
|
+
*/
|
|
17
|
+
blockRanges(): Uint32Array;
|
|
18
|
+
/**
|
|
19
|
+
* The blocks of the raised sublayers (`shapes::Block`, 32 bytes each), as bytes
|
|
20
|
+
*/
|
|
21
|
+
blocks(): Uint8Array;
|
|
22
|
+
/**
|
|
23
|
+
* The extent of the tile's points: min x, min y, max x, max y
|
|
24
|
+
*/
|
|
25
|
+
bounds(): Float64Array;
|
|
26
|
+
/**
|
|
27
|
+
* Per sublayer: its top cap and the rest of its prism, first and end of each (four numbers)
|
|
28
|
+
*/
|
|
29
|
+
fillRanges(): Uint32Array;
|
|
30
|
+
/**
|
|
31
|
+
* The fill triangles
|
|
32
|
+
*/
|
|
33
|
+
indices(): Uint32Array;
|
|
34
|
+
/**
|
|
35
|
+
* Per sublayer: its pieces, first and end
|
|
36
|
+
*/
|
|
37
|
+
lineRanges(): Uint32Array;
|
|
38
|
+
/**
|
|
39
|
+
* Feature and length of each line
|
|
40
|
+
*/
|
|
41
|
+
lineTable(): Float32Array;
|
|
42
|
+
/**
|
|
43
|
+
* The line pieces (`pieces::Piece`, 28 bytes each), as bytes
|
|
44
|
+
*/
|
|
45
|
+
pieces(): Uint8Array;
|
|
46
|
+
/**
|
|
47
|
+
* Whether the prisms were built
|
|
48
|
+
*/
|
|
49
|
+
prism(): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* The fill vertices (`shapes::Vertex`, 24 bytes each), as bytes
|
|
52
|
+
*/
|
|
53
|
+
vertices(): Uint8Array;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The geometry of a vector tile made ready for the GPU, as the engine's `setVectorTile` takes it: its polygons
|
|
58
|
+
* (interleaved points, `ring_start`, `polygon_start`, the feature of each, `fill_start`: the first polygon of each
|
|
59
|
+
* sublayer and the end), its lines (interleaved points, `line_first`: the first point of each, the feature of each,
|
|
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; `prism`: with the prisms the fills need over the relief; `tile`: the corners of the
|
|
62
|
+
* tile they are cut to (west, north, east, south, Mercator; empty: none), along whose edges no wall of a block rises
|
|
63
|
+
*/
|
|
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;
|
|
65
|
+
|
|
66
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
67
|
+
|
|
68
|
+
export interface InitOutput {
|
|
69
|
+
readonly memory: WebAssembly.Memory;
|
|
70
|
+
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;
|
|
72
|
+
readonly tessellatedtile_blockIndices: (a: number) => any;
|
|
73
|
+
readonly tessellatedtile_blockRanges: (a: number) => [number, number];
|
|
74
|
+
readonly tessellatedtile_blocks: (a: number) => any;
|
|
75
|
+
readonly tessellatedtile_bounds: (a: number) => [number, number];
|
|
76
|
+
readonly tessellatedtile_fillRanges: (a: number) => [number, number];
|
|
77
|
+
readonly tessellatedtile_indices: (a: number) => any;
|
|
78
|
+
readonly tessellatedtile_lineRanges: (a: number) => [number, number];
|
|
79
|
+
readonly tessellatedtile_lineTable: (a: number) => any;
|
|
80
|
+
readonly tessellatedtile_pieces: (a: number) => any;
|
|
81
|
+
readonly tessellatedtile_prism: (a: number) => number;
|
|
82
|
+
readonly tessellatedtile_vertices: (a: number) => any;
|
|
83
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
84
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
85
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
86
|
+
readonly __wbindgen_start: () => void;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
93
|
+
* a precompiled `WebAssembly.Module`.
|
|
94
|
+
*
|
|
95
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
96
|
+
*
|
|
97
|
+
* @returns {InitOutput}
|
|
98
|
+
*/
|
|
99
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
103
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
104
|
+
*
|
|
105
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
106
|
+
*
|
|
107
|
+
* @returns {Promise<InitOutput>}
|
|
108
|
+
*/
|
|
109
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|