isard 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (254) hide show
  1. package/CHANGELOG.md +121 -0
  2. package/README.md +44 -39
  3. package/dist/basemap/basemaps.d.ts +1 -1
  4. package/dist/basemap/basemaps.js +2 -2
  5. package/dist/basemap/basemaps.js.map +1 -1
  6. package/dist/basemap/grid.d.ts +5 -5
  7. package/dist/basemap/grid.js +59 -65
  8. package/dist/basemap/grid.js.map +1 -1
  9. package/dist/basemap/mvt.d.ts +1 -1
  10. package/dist/basemap/mvt.js +6 -6
  11. package/dist/basemap/mvt.js.map +1 -1
  12. package/dist/basemap/pmtiles.d.ts +10 -10
  13. package/dist/basemap/pmtiles.js +39 -31
  14. package/dist/basemap/pmtiles.js.map +1 -1
  15. package/dist/basemap/pmtileslayer.d.ts +33 -0
  16. package/dist/basemap/pmtileslayer.js +97 -0
  17. package/dist/basemap/pmtileslayer.js.map +1 -0
  18. package/dist/basemap/resample.d.ts +2 -2
  19. package/dist/basemap/resample.js +16 -14
  20. package/dist/basemap/resample.js.map +1 -1
  21. package/dist/basemap/terrain.d.ts +3 -3
  22. package/dist/basemap/terrain.js +6 -6
  23. package/dist/basemap/terrain.js.map +1 -1
  24. package/dist/basemap/trees.d.ts +26 -0
  25. package/dist/basemap/trees.js +141 -0
  26. package/dist/basemap/trees.js.map +1 -0
  27. package/dist/basemap/vectorstyle.d.ts +22 -10
  28. package/dist/basemap/vectorstyle.js +163 -110
  29. package/dist/basemap/vectorstyle.js.map +1 -1
  30. package/dist/basemap/vectortiles.d.ts +70 -47
  31. package/dist/basemap/vectortiles.js +480 -358
  32. package/dist/basemap/vectortiles.js.map +1 -1
  33. package/dist/basemap/wmts.d.ts +3 -3
  34. package/dist/basemap/wmts.js +16 -11
  35. package/dist/basemap/wmts.js.map +1 -1
  36. package/dist/basemap/workerpool.d.ts +17 -0
  37. package/dist/basemap/workerpool.js +194 -0
  38. package/dist/basemap/workerpool.js.map +1 -0
  39. package/dist/basemap.worker.js +2 -2
  40. package/dist/basemap.worker.js.map +21 -13
  41. package/dist/bind/layers.d.ts +13 -4
  42. package/dist/bind/layers.js +64 -40
  43. package/dist/bind/layers.js.map +1 -1
  44. package/dist/data/crs.d.ts +10 -10
  45. package/dist/data/crs.js +38 -34
  46. package/dist/data/crs.js.map +1 -1
  47. package/dist/data/gpx.d.ts +1 -1
  48. package/dist/data/gpx.js +20 -20
  49. package/dist/data/gpx.js.map +1 -1
  50. package/dist/data/kml.d.ts +1 -1
  51. package/dist/data/kml.js +42 -39
  52. package/dist/data/kml.js.map +1 -1
  53. package/dist/data/topojson.d.ts +1 -1
  54. package/dist/data/topojson.js +15 -10
  55. package/dist/data/topojson.js.map +1 -1
  56. package/dist/data/xml.d.ts +5 -5
  57. package/dist/data/xml.js +19 -18
  58. package/dist/data/xml.js.map +1 -1
  59. package/dist/decoder.worker.js +4 -4
  60. package/dist/decoder.worker.js.map +6 -6
  61. package/dist/engine/decoders.d.ts +2 -2
  62. package/dist/engine/decoders.js +28 -25
  63. package/dist/engine/decoders.js.map +1 -1
  64. package/dist/engine/loader.js +13 -14
  65. package/dist/engine/loader.js.map +1 -1
  66. package/dist/engine/requests.d.ts +1 -1
  67. package/dist/engine/requests.js +19 -16
  68. package/dist/engine/requests.js.map +1 -1
  69. package/dist/engine-loader.d.ts +13 -9
  70. package/dist/engine-loader.js +38 -28
  71. package/dist/engine-loader.js.map +1 -1
  72. package/dist/geoplateforme.d.ts +26 -10
  73. package/dist/geoplateforme.js +45 -20
  74. package/dist/geoplateforme.js.map +1 -1
  75. package/dist/index.d.ts +12 -4
  76. package/dist/index.js +9 -2
  77. package/dist/index.js.map +1 -1
  78. package/dist/isard_bg.wasm +0 -0
  79. package/dist/isard_core_bg.wasm +0 -0
  80. package/dist/isard_points_bg.wasm +0 -0
  81. package/dist/isard_tess_bg.wasm +0 -0
  82. package/dist/layers/extrusions.d.ts +1 -1
  83. package/dist/layers/extrusions.js +10 -5
  84. package/dist/layers/extrusions.js.map +1 -1
  85. package/dist/layers/features.d.ts +10 -10
  86. package/dist/layers/features.js +41 -42
  87. package/dist/layers/features.js.map +1 -1
  88. package/dist/layers/glyphs.d.ts +3 -3
  89. package/dist/layers/glyphs.js +34 -40
  90. package/dist/layers/glyphs.js.map +1 -1
  91. package/dist/layers/icons.d.ts +8 -8
  92. package/dist/layers/icons.js +76 -68
  93. package/dist/layers/icons.js.map +1 -1
  94. package/dist/layers/layers.d.ts +1 -1
  95. package/dist/layers/layers.js +42 -29
  96. package/dist/layers/layers.js.map +1 -1
  97. package/dist/layers/panoramas.d.ts +2 -2
  98. package/dist/layers/panoramas.js +52 -41
  99. package/dist/layers/panoramas.js.map +1 -1
  100. package/dist/layers/pointclouds.d.ts +3 -3
  101. package/dist/layers/pointclouds.js +25 -33
  102. package/dist/layers/pointclouds.js.map +1 -1
  103. package/dist/layers/symbols.d.ts +1 -1
  104. package/dist/layers/symbols.js +68 -71
  105. package/dist/layers/symbols.js.map +1 -1
  106. package/dist/layers/vectors.d.ts +60 -0
  107. package/dist/layers/vectors.js +130 -0
  108. package/dist/layers/vectors.js.map +1 -0
  109. package/dist/map/basemap-layers.d.ts +26 -0
  110. package/dist/map/basemap-layers.js +61 -0
  111. package/dist/map/basemap-layers.js.map +1 -0
  112. package/dist/map/canvas.d.ts +17 -0
  113. package/dist/map/canvas.js +56 -0
  114. package/dist/map/canvas.js.map +1 -0
  115. package/dist/map/checks.d.ts +11 -0
  116. package/dist/map/checks.js +39 -0
  117. package/dist/map/checks.js.map +1 -0
  118. package/dist/map/credits.d.ts +17 -0
  119. package/dist/map/credits.js +34 -0
  120. package/dist/map/credits.js.map +1 -0
  121. package/dist/map/engine-settings.d.ts +15 -0
  122. package/dist/map/engine-settings.js +45 -0
  123. package/dist/map/engine-settings.js.map +1 -0
  124. package/dist/map/engines.d.ts +41 -0
  125. package/dist/map/engines.js +77 -0
  126. package/dist/map/engines.js.map +1 -0
  127. package/dist/map/events.d.ts +14 -0
  128. package/dist/map/events.js +46 -0
  129. package/dist/map/events.js.map +1 -0
  130. package/dist/map/frame-loop.d.ts +64 -0
  131. package/dist/map/frame-loop.js +145 -0
  132. package/dist/map/frame-loop.js.map +1 -0
  133. package/dist/map/hover-pick.d.ts +30 -0
  134. package/dist/map/hover-pick.js +56 -0
  135. package/dist/map/hover-pick.js.map +1 -0
  136. package/dist/map/layer-spec.d.ts +42 -0
  137. package/dist/map/layer-spec.js +34 -0
  138. package/dist/map/layer-spec.js.map +1 -0
  139. package/dist/map/layer-stack.d.ts +36 -0
  140. package/dist/map/layer-stack.js +101 -0
  141. package/dist/map/layer-stack.js.map +1 -0
  142. package/dist/map/overlay-host.d.ts +36 -0
  143. package/dist/map/overlay-host.js +101 -0
  144. package/dist/map/overlay-host.js.map +1 -0
  145. package/dist/map/panorama-host.d.ts +5 -0
  146. package/dist/map/panorama-host.js +32 -0
  147. package/dist/map/panorama-host.js.map +1 -0
  148. package/dist/map/raster-source.d.ts +11 -0
  149. package/dist/map/raster-source.js +26 -0
  150. package/dist/map/raster-source.js.map +1 -0
  151. package/dist/map/symbol-atlases.d.ts +26 -0
  152. package/dist/map/symbol-atlases.js +59 -0
  153. package/dist/map/symbol-atlases.js.map +1 -0
  154. package/dist/map/viewshed.d.ts +5 -0
  155. package/dist/map/viewshed.js +28 -0
  156. package/dist/map/viewshed.js.map +1 -0
  157. package/dist/map/workers.d.ts +46 -0
  158. package/dist/map/workers.js +73 -0
  159. package/dist/map/workers.js.map +1 -0
  160. package/dist/map.d.ts +54 -126
  161. package/dist/map.js +227 -698
  162. package/dist/map.js.map +1 -1
  163. package/dist/react/Control.d.ts +11 -0
  164. package/dist/react/Control.js +18 -0
  165. package/dist/react/Control.js.map +1 -0
  166. package/dist/react/CustomLayer.d.ts +11 -0
  167. package/dist/react/CustomLayer.js +30 -0
  168. package/dist/react/CustomLayer.js.map +1 -0
  169. package/dist/react/IsardMap.d.ts +43 -0
  170. package/dist/react/IsardMap.js +147 -0
  171. package/dist/react/IsardMap.js.map +1 -0
  172. package/dist/react/Layer.d.ts +42 -0
  173. package/dist/react/Layer.js +74 -0
  174. package/dist/react/Layer.js.map +1 -0
  175. package/dist/react/Marker.d.ts +24 -0
  176. package/dist/react/Marker.js +53 -0
  177. package/dist/react/Marker.js.map +1 -0
  178. package/dist/react/Panel.d.ts +11 -0
  179. package/dist/react/Panel.js +37 -0
  180. package/dist/react/Panel.js.map +1 -0
  181. package/dist/react/Popup.d.ts +18 -0
  182. package/dist/react/Popup.js +60 -0
  183. package/dist/react/Popup.js.map +1 -0
  184. package/dist/react/Swipe.d.ts +16 -0
  185. package/dist/react/Swipe.js +52 -0
  186. package/dist/react/Swipe.js.map +1 -0
  187. package/dist/react/VectorGeometry.d.ts +35 -0
  188. package/dist/react/VectorGeometry.js +82 -0
  189. package/dist/react/VectorGeometry.js.map +1 -0
  190. package/dist/react/Viewshed.d.ts +5 -0
  191. package/dist/react/Viewshed.js +28 -0
  192. package/dist/react/Viewshed.js.map +1 -0
  193. package/dist/react/context.d.ts +33 -0
  194. package/dist/react/context.js +20 -0
  195. package/dist/react/context.js.map +1 -0
  196. package/dist/react/index.d.ts +16 -108
  197. package/dist/react/index.js +11 -397
  198. package/dist/react/index.js.map +1 -1
  199. package/dist/settings.d.ts +5 -9
  200. package/dist/settings.js +17 -15
  201. package/dist/settings.js.map +1 -1
  202. package/dist/types.d.ts +27 -4
  203. package/dist/types.js.map +1 -1
  204. package/dist/ui/controls.js +6 -4
  205. package/dist/ui/controls.js.map +1 -1
  206. package/dist/ui/interaction.d.ts +2 -2
  207. package/dist/ui/interaction.js +8 -7
  208. package/dist/ui/interaction.js.map +1 -1
  209. package/dist/ui/minimap.d.ts +25 -0
  210. package/dist/ui/minimap.js +90 -0
  211. package/dist/ui/minimap.js.map +1 -0
  212. package/dist/ui/overlay.js +18 -20
  213. package/dist/ui/overlay.js.map +1 -1
  214. package/dist/ui/scale.d.ts +19 -0
  215. package/dist/ui/scale.js +44 -0
  216. package/dist/ui/scale.js.map +1 -0
  217. package/dist/ui/search.d.ts +25 -0
  218. package/dist/ui/search.js +119 -0
  219. package/dist/ui/search.js.map +1 -0
  220. package/dist/ui/style.d.ts +1 -1
  221. package/dist/ui/style.js +19 -2
  222. package/dist/ui/style.js.map +1 -1
  223. package/dist/util/animation.d.ts +3 -3
  224. package/dist/util/animation.js +6 -6
  225. package/dist/util/animation.js.map +1 -1
  226. package/dist/util/color.d.ts +1 -1
  227. package/dist/util/color.js +14 -16
  228. package/dist/util/color.js.map +1 -1
  229. package/dist/util/geo.d.ts +6 -6
  230. package/dist/util/geo.js +12 -12
  231. package/dist/util/geo.js.map +1 -1
  232. package/dist/util/guards.d.ts +7 -0
  233. package/dist/util/guards.js +8 -0
  234. package/dist/util/guards.js.map +1 -0
  235. package/dist/util/lru.js.map +1 -1
  236. package/dist/util/sun.d.ts +11 -0
  237. package/dist/util/sun.js +26 -0
  238. package/dist/util/sun.js.map +1 -0
  239. package/dist/wasm/isard.d.ts +250 -7
  240. package/dist/wasm/isard.js +375 -8
  241. package/dist/wasm/isard_core.d.ts +226 -7
  242. package/dist/wasm/isard_core.js +351 -8
  243. package/dist/wasm/isard_tess.d.ts +109 -0
  244. package/dist/wasm/isard_tess.js +398 -0
  245. package/dist/workers/basemap/geometry.d.ts +72 -0
  246. package/dist/workers/basemap/labels.d.ts +8 -0
  247. package/dist/workers/basemap/raster.d.ts +10 -0
  248. package/dist/workers/basemap/tiles.d.ts +65 -0
  249. package/dist/workers/basemap/trees.d.ts +19 -0
  250. package/dist/workers/basemap.worker.d.ts +126 -22
  251. package/dist/workers/basemap.worker.js +76 -544
  252. package/dist/workers/basemap.worker.js.map +1 -1
  253. package/package.json +5 -4
  254. package/vite.js +10 -2
@@ -1,5 +1,9 @@
1
1
  /* @ts-self-types="./isard.d.ts" */
2
2
 
3
+ /**
4
+ * A map on one canvas: its WebGL2 context, camera, ground (raster layers over the relief) and the layers over it.
5
+ * Draws only when `render` is called (the JavaScript side calls it after `redraw` asks for a frame)
6
+ */
3
7
  export class Engine {
4
8
  __destroy_into_raw() {
5
9
  const ptr = this.__wbg_ptr;
@@ -13,6 +17,11 @@ export class Engine {
13
17
  }
14
18
  /**
15
19
  * Circle layer of `feature_count` features: points (Mercator [0, 1], interleaved) and the feature of each
20
+ *
21
+ * # Errors
22
+ *
23
+ * Throws (to JavaScript) when a WebGL object cannot be created or a shader fails to compile (the error carries its
24
+ * info log), or when `feature_count` features need a table texture past the GPU's `MAX_TEXTURE_SIZE`
16
25
  * @param {Float64Array} points
17
26
  * @param {Uint32Array} feature
18
27
  * @param {number} feature_count
@@ -43,6 +52,11 @@ export class Engine {
43
52
  }
44
53
  /**
45
54
  * An empty extrusion layer: its blocks come in batches (`setExtrusionBatch`)
55
+ *
56
+ * # Errors
57
+ *
58
+ * Throws (to JavaScript) when a WebGL object cannot be created or a shader fails to compile (the error carries its
59
+ * info log)
46
60
  * @returns {number}
47
61
  */
48
62
  addExtrusions() {
@@ -56,6 +70,11 @@ export class Engine {
56
70
  * Fill layer of `feature_count` features: polygons given by their points (Mercator [0, 1], interleaved), the first
57
71
  * point of each ring (`ring_start`, one more entry than rings), the first ring of each polygon (`polygon_start`,
58
72
  * one more entry than polygons; the first ring is the outer one, the others holes) and the feature of each polygon
73
+ *
74
+ * # Errors
75
+ *
76
+ * Throws (to JavaScript) when a WebGL object cannot be created or a shader fails to compile (the error carries its
77
+ * info log), or when `feature_count` features need a table texture past the GPU's `MAX_TEXTURE_SIZE`
59
78
  * @param {Float64Array} points
60
79
  * @param {Uint32Array} ring_start
61
80
  * @param {Uint32Array} polygon_start
@@ -82,6 +101,10 @@ export class Engine {
82
101
  * Ground layer running `code` (GLSL ES 3.0 defining `vec4 ground(vec2 offset)`, see `render::ground`) over the
83
102
  * ground; `anchor`: Mercator point the offsets are taken from; bounds: Mercator box it shows in. Compilation errors
84
103
  * come back with the shader's info log (line numbers of `code`)
104
+ *
105
+ * # Errors
106
+ *
107
+ * Throws (to JavaScript) when `code` does not compile or link, with the shader's info log
85
108
  * @param {string} code
86
109
  * @param {number} anchor_x
87
110
  * @param {number} anchor_y
@@ -103,6 +126,11 @@ export class Engine {
103
126
  /**
104
127
  * Line layer of `feature_count` features: polylines given by their points (Mercator [0, 1], interleaved), the
105
128
  * first point of each (`start`, one more entry than lines) and the feature each one belongs to
129
+ *
130
+ * # Errors
131
+ *
132
+ * Throws (to JavaScript) when a WebGL object cannot be created or a shader fails to compile (the error carries its
133
+ * info log), or when the features or the lines need a table texture past the GPU's `MAX_TEXTURE_SIZE`
106
134
  * @param {Float64Array} points
107
135
  * @param {Uint32Array} start
108
136
  * @param {Uint32Array} feature
@@ -126,6 +154,11 @@ export class Engine {
126
154
  * A glTF / GLB model (its URL, a `blob:` one for data of the page) drawn at each instance of `instances`
127
155
  * (`INSTANCE_NUMBERS` numbers each: longitude, latitude, altitude, heading, pitch, roll in degrees, scale);
128
156
  * `ground`: altitudes above the relief, else above the ellipsoid
157
+ *
158
+ * # Errors
159
+ *
160
+ * Throws (to JavaScript) when a WebGL object cannot be created or a shader fails to compile (the error carries its
161
+ * info log). A model that fails to load or decode does not throw: the layer stays empty
129
162
  * @param {string} url
130
163
  * @param {Float64Array} instances
131
164
  * @param {boolean} ground
@@ -148,6 +181,12 @@ export class Engine {
148
181
  * edges (node index pairs, interleaved). `line_start` and `line_points`: the line of each edge from A to B, points
149
182
  * `line_start[e] .. line_start[e + 1]` of `line_points` (Mercator, interleaved; straight if fewer than two). `costs`: per edge, the
150
183
  * cost of travelling it from A to B then from B to A; without, values are interpolated along the edges.
184
+ *
185
+ * # Errors
186
+ *
187
+ * Throws (to JavaScript) when `style` is not 25 numbers, `edges` is not node pairs or names a node past
188
+ * those of `mercator`, the nodes or edges need a table texture past the GPU's `MAX_TEXTURE_SIZE`, or when
189
+ * a WebGL object cannot be created or a shader fails to compile (the error carries its info log)
151
190
  * @param {Float64Array} mercator
152
191
  * @param {Uint32Array} edges
153
192
  * @param {Uint32Array | null | undefined} line_start
@@ -179,6 +218,11 @@ export class Engine {
179
218
  * A COPC point cloud from its URL (HTTP range requests). `resolve(wkt)` gives the CRS of the file from its WKT
180
219
  * (undefined if it has none): its inverse projection, whether its altitudes are above the geoid, the metres of
181
220
  * a unit of z; it may throw (an unknown CRS), the layer then stays empty
221
+ *
222
+ * # Errors
223
+ *
224
+ * Throws (to JavaScript) when a WebGL object cannot be created or a shader fails to compile (the error carries its
225
+ * info log). The file itself is read later: a bad file, or a `resolve` that throws, leaves the layer empty
182
226
  * @param {string} url
183
227
  * @param {(wkt: string | undefined) => PointCloudCrs} resolve
184
228
  * @returns {number}
@@ -196,6 +240,10 @@ export class Engine {
196
240
  * Raster tiles in Web Mercator; `url` holds {z}, {x} and {y}. `size`: side of the tiles' textures (256 by
197
241
  * default); `loader`: draws each tile instead of fetching `url`, `(z, x, y, signal) => Promise<ImageBitmap |
198
242
  * null>`, an image of `size` × `size` (null: nothing there)
243
+ *
244
+ * # Errors
245
+ *
246
+ * Throws (to JavaScript) when the texture holding the layer's tiles cannot be created
199
247
  * @param {string} url
200
248
  * @param {number} min_z
201
249
  * @param {number} max_z
@@ -216,6 +264,11 @@ export class Engine {
216
264
  }
217
265
  /**
218
266
  * An empty symbol layer
267
+ *
268
+ * # Errors
269
+ *
270
+ * Throws (to JavaScript) when a WebGL object cannot be created or a shader fails to compile (the error carries its
271
+ * info log)
219
272
  * @returns {number}
220
273
  */
221
274
  addSymbols() {
@@ -229,6 +282,11 @@ export class Engine {
229
282
  * 3D Tiles (b3dm / glb textured meshes, external tilesets) from the URL of a `tileset.json`. `max_error`:
230
283
  * screen-space error (CSS pixels) above which a tile is refined; 16 is the usual value, lower is finer.
231
284
  * `geoid`: its heights are altitudes (NGF-IGN69), each tile raised by the RAF20 geoid onto the relief.
285
+ *
286
+ * # Errors
287
+ *
288
+ * Throws (to JavaScript) when one of the layer's programs fails to compile or link (the error carries
289
+ * its info log). The tileset itself is read later: a bad one leaves the layer empty, it does not throw
232
290
  * @param {string} url
233
291
  * @param {number} max_error
234
292
  * @param {boolean | null} [geoid]
@@ -243,6 +301,22 @@ export class Engine {
243
301
  }
244
302
  return ret[0] >>> 0;
245
303
  }
304
+ /**
305
+ * An empty layer of vector tiles drawn as geometry: its style layers come with `setVectorSublayers`, its tiles
306
+ * with `setVectorTile`
307
+ *
308
+ * # Errors
309
+ *
310
+ * Throws (to JavaScript) when a shader fails to compile (the error carries its info log)
311
+ * @returns {number}
312
+ */
313
+ addVectorTiles() {
314
+ const ret = wasm.engine_addVectorTiles(this.__wbg_ptr);
315
+ if (ret[2]) {
316
+ throw takeFromExternrefTable0(ret[1]);
317
+ }
318
+ return ret[0] >>> 0;
319
+ }
246
320
  /**
247
321
  * Longitudes and latitudes the view covers on the ground, `[west, south, east, north]` (degrees): the screen's
248
322
  * border cast on the ground, or on the far plane where it passes the horizon
@@ -255,6 +329,7 @@ export class Engine {
255
329
  return v1;
256
330
  }
257
331
  /**
332
+ * The camera as set or moved: center (degrees), zoom, pitch and bearing (degrees)
258
333
  * @returns {Camera}
259
334
  */
260
335
  camera() {
@@ -267,6 +342,9 @@ export class Engine {
267
342
  clearPanorama() {
268
343
  wasm.engine_clearPanorama(this.__wbg_ptr);
269
344
  }
345
+ /**
346
+ * Stops loading the tiles of the flight's destination (`preload`)
347
+ */
270
348
  clearPreload() {
271
349
  wasm.engine_clearPreload(this.__wbg_ptr);
272
350
  }
@@ -371,6 +449,11 @@ export class Engine {
371
449
  }
372
450
  /**
373
451
  * `redraw` is called when the engine needs a new frame (a tile arrived)
452
+ *
453
+ * # Errors
454
+ *
455
+ * Throws (to JavaScript) when the canvas gives no WebGL2 context ("WebGL2 is not available"), or when a WebGL
456
+ * object of the globe, the sky or the raster pass cannot be created or one of their shaders fails to compile
374
457
  * @param {HTMLCanvasElement} canvas
375
458
  * @param {() => void} redraw
376
459
  */
@@ -473,6 +556,7 @@ export class Engine {
473
556
  return ret;
474
557
  }
475
558
  /**
559
+ * Removes batch `key` of an extrusion layer (nothing if there is none)
476
560
  * @param {number} id
477
561
  * @param {number} key
478
562
  */
@@ -480,12 +564,23 @@ export class Engine {
480
564
  wasm.engine_removeExtrusionBatch(this.__wbg_ptr, id, key);
481
565
  }
482
566
  /**
567
+ * Removes a layer and frees its GPU objects; the other layers forget it (a layer that referred to it)
483
568
  * @param {number} id
484
569
  */
485
570
  removeLayer(id) {
486
571
  wasm.engine_removeLayer(this.__wbg_ptr, id);
487
572
  }
488
573
  /**
574
+ * Removes tile `key` of a vector tile layer (nothing if there is none)
575
+ * @param {number} id
576
+ * @param {number} key
577
+ */
578
+ removeVectorTile(id, key) {
579
+ wasm.engine_removeVectorTile(this.__wbg_ptr, id, key);
580
+ }
581
+ /**
582
+ * Draws a frame: the backdrop, the ground and the layers over it bottom to top, then the panorama and the
583
+ * viewshed; returns true while tiles are still loading (a new frame will be asked through `redraw`)
489
584
  * @returns {boolean}
490
585
  */
491
586
  render() {
@@ -536,6 +631,7 @@ export class Engine {
536
631
  wasm.engine_setAtmosphere(this.__wbg_ptr, ptr0, len0);
537
632
  }
538
633
  /**
634
+ * Color the canvas is cleared to (RGB 0-1), where neither ground nor sky is drawn
539
635
  * @param {number} r
540
636
  * @param {number} g
541
637
  * @param {number} b
@@ -561,6 +657,8 @@ export class Engine {
561
657
  wasm.engine_setBody(this.__wbg_ptr, radius, flattening, ptr0, len0, lowest, highest);
562
658
  }
563
659
  /**
660
+ * Sets the camera (degrees, the conventions of `MapLibre`): leaves a street-level view, and the camera keeps this
661
+ * center as the relief comes in
564
662
  * @param {number} lon
565
663
  * @param {number} lat
566
664
  * @param {number} zoom
@@ -593,6 +691,11 @@ export class Engine {
593
691
  }
594
692
  /**
595
693
  * Anchors of batch `key` on the linked network: per feature, node A, node B, cost from A, cost from B
694
+ *
695
+ * # Errors
696
+ *
697
+ * Throws (to JavaScript) when the batch's features need an anchor texture past the GPU's
698
+ * `MAX_TEXTURE_SIZE`, or when it cannot be created
596
699
  * @param {number} id
597
700
  * @param {number} key
598
701
  * @param {Float32Array} anchors
@@ -608,6 +711,11 @@ export class Engine {
608
711
  /**
609
712
  * Adds or replaces batch `key` of an extrusion layer: polygons as for `addFills`, `feature_count` features (the
610
713
  * feature style gives each its height and base height as its two sizes, metres)
714
+ *
715
+ * # Errors
716
+ *
717
+ * Throws (to JavaScript) when a WebGL buffer or vertex array of the batch cannot be created, or when
718
+ * `feature_count` features need a table texture past the GPU's `MAX_TEXTURE_SIZE`
611
719
  * @param {number} id
612
720
  * @param {number} key
613
721
  * @param {Float64Array} points
@@ -668,10 +776,10 @@ export class Engine {
668
776
  wasm.engine_setFeatureRamp(this.__wbg_ptr, id, ptr0, len0, min, max);
669
777
  }
670
778
  /**
671
- * Style of the features of a line, circle, fill or extrusion layer (batch `key` of the latter): 32 floats per
672
- * feature, its color (RGBA 0-1), its second color (a circle's stroke), then two sizes as zoom stops (four zooms,
673
- * four values each): a line's width; a circle's radius and stroke width, CSS pixels; a block's height and base
674
- * height, metres
779
+ * Style of the features of a line, circle, fill, extrusion or vector tile layer (batch or tile `key` of the last
780
+ * two): 32 floats per feature, its color (RGBA 0-1), its second color (a circle's stroke), then two sizes as zoom
781
+ * stops (four zooms, four values each): a line's width; a circle's radius and stroke width, CSS pixels; a block's
782
+ * height and base height, metres
675
783
  * @param {number} id
676
784
  * @param {Float32Array} style
677
785
  * @param {number | null} [key]
@@ -744,6 +852,10 @@ export class Engine {
744
852
  /**
745
853
  * The glyph atlas shared by the symbol layers, one page: `width` × `height` bytes of signed distances
746
854
  * (allocated again, filled with `data` if given)
855
+ *
856
+ * # Errors
857
+ *
858
+ * Throws (to JavaScript) as `setGlyphPages` does: a size that is not positive, or the texture not created
747
859
  * @param {number} width
748
860
  * @param {number} height
749
861
  * @param {Uint8Array | null} [data]
@@ -760,6 +872,11 @@ export class Engine {
760
872
  * The glyph atlas shared by the symbol layers, `pages` pages of `width` × `height` bytes of signed distances,
761
873
  * allocated again and empty (`updateGlyphPage` fills them). A glyph on page `p` at row `v` has the atlas
762
874
  * coordinate `v + p × height`
875
+ *
876
+ * # Errors
877
+ *
878
+ * Throws (to JavaScript) when `width` or `height` is not positive (or their product overflows), `pages`
879
+ * is not 1 to 256, or the atlas texture cannot be created
763
880
  * @param {number} width
764
881
  * @param {number} height
765
882
  * @param {number} pages
@@ -771,6 +888,7 @@ export class Engine {
771
888
  }
772
889
  }
773
890
  /**
891
+ * Moves the Mercator box (0-1) a ground layer shows in
774
892
  * @param {number} id
775
893
  * @param {number} min_x
776
894
  * @param {number} min_y
@@ -784,6 +902,11 @@ export class Engine {
784
902
  * Creates the texture of sampler `name` (`format`: r8, r8ui, r16ui, r16i, r32ui, r32f, rg16ui, rg32f, rgba8,
785
903
  * rgba8ui, rgba16ui, rgba32f; `depth` 0 for 2D, else a 2D array of that many layers; `linear` filtering for the
786
904
  * non-integer formats); `data`: its texels as bytes, or undefined for an empty texture
905
+ *
906
+ * # Errors
907
+ *
908
+ * Throws (to JavaScript) on an unknown `format`, a size not positive (or overflowing), `data` shorter
909
+ * than the texels, more textures than the layer takes, or a texture WebGL cannot create
787
910
  * @param {number} id
788
911
  * @param {string} name
789
912
  * @param {string} format
@@ -807,6 +930,11 @@ export class Engine {
807
930
  }
808
931
  /**
809
932
  * A uniform of a ground layer's code, as numbers
933
+ *
934
+ * # Errors
935
+ *
936
+ * Throws (to JavaScript) when the shader has no uniform `name` (one its code does not use is removed
937
+ * by the compiler)
810
938
  * @param {number} id
811
939
  * @param {string} name
812
940
  * @param {Float64Array} values
@@ -822,6 +950,7 @@ export class Engine {
822
950
  }
823
951
  }
824
952
  /**
953
+ * Shows or hides a ground layer (kept, with its uniforms and textures)
825
954
  * @param {number} id
826
955
  * @param {boolean} visible
827
956
  */
@@ -831,6 +960,11 @@ export class Engine {
831
960
  /**
832
961
  * The icon atlas shared by the symbol layers: `width` × `height` RGBA texels, premultiplied, allocated again
833
962
  * and empty (`updateIconAtlas` fills it)
963
+ *
964
+ * # Errors
965
+ *
966
+ * Throws (to JavaScript) when `width` or `height` is not positive (or their product overflows), or the
967
+ * atlas texture cannot be created
834
968
  * @param {number} width
835
969
  * @param {number} height
836
970
  */
@@ -859,6 +993,11 @@ export class Engine {
859
993
  }
860
994
  /**
861
995
  * New lines for a line layer (same arguments as `addLines`, the same features)
996
+ *
997
+ * # Errors
998
+ *
999
+ * Throws (to JavaScript) when the lines need a table texture past the GPU's `MAX_TEXTURE_SIZE`, or
1000
+ * when it cannot be created; the layer then keeps its lines
862
1001
  * @param {number} id
863
1002
  * @param {Float64Array} points
864
1003
  * @param {Uint32Array} start
@@ -948,6 +1087,10 @@ export class Engine {
948
1087
  }
949
1088
  /**
950
1089
  * The image of camera `index` of the panorama (the images sharing the size of the first)
1090
+ *
1091
+ * # Errors
1092
+ *
1093
+ * Throws (to JavaScript) when WebGL refuses the upload of `image` into the panorama's texture
951
1094
  * @param {number} index
952
1095
  * @param {ImageBitmap} image
953
1096
  */
@@ -963,6 +1106,11 @@ export class Engine {
963
1106
  * frame, row-major, 9; position in it, 3; focal x, y; center x, y; skew; image width, height; principal point of
964
1107
  * the distortion x, y; its coefficients r³, r⁵, r⁷; its limit, pixels), a backdrop sphere of `radius` metres, at
965
1108
  * `opacity`. Its images come after (`setPanoramaImage`)
1109
+ *
1110
+ * # Errors
1111
+ *
1112
+ * Throws (to JavaScript) when `rotation` holds fewer than 9 numbers, or when a WebGL object cannot be created or a
1113
+ * shader fails to compile (the error carries its info log)
966
1114
  * @param {number} lon
967
1115
  * @param {number} lat
968
1116
  * @param {number} height
@@ -999,6 +1147,7 @@ export class Engine {
999
1147
  wasm.engine_setPointCloudStyle(this.__wbg_ptr, id, ptr0, len0, ptr1, len1, ptr2, len2);
1000
1148
  }
1001
1149
  /**
1150
+ * Opacity and saturation (0-1) of a raster layer; nothing for another id
1002
1151
  * @param {number} id
1003
1152
  * @param {number} opacity
1004
1153
  * @param {number} saturation
@@ -1029,17 +1178,40 @@ export class Engine {
1029
1178
  setSky(enabled) {
1030
1179
  wasm.engine_setSky(this.__wbg_ptr, enabled);
1031
1180
  }
1181
+ /**
1182
+ * The sun casting shadows and the night: its azimuth (degrees clockwise from north) and altitude (degrees above
1183
+ * the horizon), the shadows' opacity (0 to 1; none under the horizon or not a number), how dark the night is (0 to
1184
+ * 1: the frame tinted, the lights of the layers on). Neither shadows nor night: nothing drawn
1185
+ *
1186
+ * # Errors
1187
+ *
1188
+ * Throws (to JavaScript) when a WebGL object cannot be created or the pass fails to compile
1189
+ * @param {number} azimuth
1190
+ * @param {number} altitude
1191
+ * @param {number} opacity
1192
+ * @param {number} night
1193
+ */
1194
+ setSun(azimuth, altitude, opacity, night) {
1195
+ const ret = wasm.engine_setSun(this.__wbg_ptr, azimuth, altitude, opacity, night);
1196
+ if (ret[1]) {
1197
+ throw takeFromExternrefTable0(ret[0]);
1198
+ }
1199
+ }
1032
1200
  /**
1033
1201
  * Shows `layers` on one side of a vertical line only, the others beneath on the other side (comparing two states
1034
- * of a place): left of `x` (CSS pixels from the left of the canvas), or right of it; a non-finite `x` stops
1202
+ * of a place): left of `x` (CSS pixels from the left of the canvas), or right of it; `others` on the other side
1203
+ * only (two meshes of the same place, each on its side, never drawn over each other); a non-finite `x` stops
1035
1204
  * @param {number} x
1036
1205
  * @param {boolean} right
1037
1206
  * @param {Uint32Array} layers
1207
+ * @param {Uint32Array} others
1038
1208
  */
1039
- setSwipe(x, right, layers) {
1209
+ setSwipe(x, right, layers, others) {
1040
1210
  const ptr0 = passArray32ToWasm0(layers, wasm.__wbindgen_malloc);
1041
1211
  const len0 = WASM_VECTOR_LEN;
1042
- wasm.engine_setSwipe(this.__wbg_ptr, x, right, ptr0, len0);
1212
+ const ptr1 = passArray32ToWasm0(others, wasm.__wbindgen_malloc);
1213
+ const len1 = WASM_VECTOR_LEN;
1214
+ wasm.engine_setSwipe(this.__wbg_ptr, x, right, ptr0, len0, ptr1, len1);
1043
1215
  }
1044
1216
  /**
1045
1217
  * Layer-wide style of a symbol layer: size scale and opacity as zoom stops (four zooms then four values each),
@@ -1062,6 +1234,11 @@ export class Engine {
1062
1234
  * Labels of a symbol layer, shaped by the page: anchors (Mercator, interleaved), their texts' boxes (min x, min y,
1063
1235
  * max x, max y, CSS pixels from the anchor), styles (36 floats each, see `LABEL_FLOATS`) and glyph and icon quads
1064
1236
  * (11 floats each, see `QUAD_FLOATS`)
1237
+ *
1238
+ * # Errors
1239
+ *
1240
+ * Throws (to JavaScript) when the labels need a table texture past the GPU's `MAX_TEXTURE_SIZE`, or
1241
+ * when it cannot be created; the layer then keeps its labels
1065
1242
  * @param {number} id
1066
1243
  * @param {Float64Array} anchors
1067
1244
  * @param {Float32Array} boxes
@@ -1091,6 +1268,10 @@ export class Engine {
1091
1268
  * above the ellipsoid, those of 3D Tiles; over France, on the Earth only), else left as served (the default);
1092
1269
  * `loader`: gives the
1093
1270
  * altitudes of each tile instead of fetching `url` (an encoding decoded by the page: Terrarium, Terrain-RGB)
1271
+ *
1272
+ * # Errors
1273
+ *
1274
+ * Throws (to JavaScript) when the texture holding the relief's tiles cannot be created
1094
1275
  * @param {string | null | undefined} url
1095
1276
  * @param {number} exaggeration
1096
1277
  * @param {number | null | undefined} max_z
@@ -1128,12 +1309,171 @@ export class Engine {
1128
1309
  const len0 = WASM_VECTOR_LEN;
1129
1310
  wasm.engine_setTiles3dStyle(this.__wbg_ptr, id, max_error, opacity, !isLikeNone(point_size), isLikeNone(point_size) ? 0 : point_size, ptr0, len0);
1130
1311
  }
1312
+ /**
1313
+ * The style layers of a vector tile layer, in drawing order: per layer, its kind (0 fill, 1 line, 2 extrusion), its zoom range
1314
+ * (two numbers: shown from the first, included, to the second, excluded), whether it shows (0 or 1), its dashes
1315
+ * (four numbers: dash, gap, dash, gap, in line widths; 0: solid), its opacity as zoom stops (four zooms then four
1316
+ * values; missing: opaque), the caps of its lines' ends (0 butt, 1 round, 2 square; missing: round), whether its
1317
+ * lines glow at night (streets; 0 or 1)
1318
+ * @param {number} id
1319
+ * @param {Uint8Array} kinds
1320
+ * @param {Float64Array} zooms
1321
+ * @param {Uint8Array} visible
1322
+ * @param {Float32Array} dashes
1323
+ * @param {Float32Array} opacities
1324
+ * @param {Uint8Array} caps
1325
+ * @param {Uint8Array} lit
1326
+ */
1327
+ setVectorSublayers(id, kinds, zooms, visible, dashes, opacities, caps, lit) {
1328
+ const ptr0 = passArray8ToWasm0(kinds, wasm.__wbindgen_malloc);
1329
+ const len0 = WASM_VECTOR_LEN;
1330
+ const ptr1 = passArrayF64ToWasm0(zooms, wasm.__wbindgen_malloc);
1331
+ const len1 = WASM_VECTOR_LEN;
1332
+ const ptr2 = passArray8ToWasm0(visible, wasm.__wbindgen_malloc);
1333
+ const len2 = WASM_VECTOR_LEN;
1334
+ const ptr3 = passArrayF32ToWasm0(dashes, wasm.__wbindgen_malloc);
1335
+ const len3 = WASM_VECTOR_LEN;
1336
+ const ptr4 = passArrayF32ToWasm0(opacities, wasm.__wbindgen_malloc);
1337
+ const len4 = WASM_VECTOR_LEN;
1338
+ const ptr5 = passArray8ToWasm0(caps, wasm.__wbindgen_malloc);
1339
+ const len5 = WASM_VECTOR_LEN;
1340
+ const ptr6 = passArray8ToWasm0(lit, wasm.__wbindgen_malloc);
1341
+ const len6 = WASM_VECTOR_LEN;
1342
+ wasm.engine_setVectorSublayers(this.__wbg_ptr, id, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6);
1343
+ }
1344
+ /**
1345
+ * Adds or replaces tile `key` of a vector tile layer ready for the GPU, as the basemap workers make it (the
1346
+ * tessellation module): its polygons as for `setVectorTile` (picked here; their prisms built here if drawn in
1347
+ * relief while `prism` is false), the vertices of its fills (`shapes::Vertex` as bytes, each with its feature),
1348
+ * their triangles, per sublayer its top cap and the rest of its prism (`fill_ranges`: four numbers, first and
1349
+ * end of each), its line pieces (`pieces::Piece` as bytes), the line table (feature and length of each line),
1350
+ * per sublayer its pieces (`line_ranges`: first, end), the blocks of its extrusion sublayers (`shapes::Block` as
1351
+ * bytes), their triangles, per sublayer its blocks' triangles (`block_ranges`: first, end), the extent of its
1352
+ * points (`bounds`: min x, min y, max x, max y), `feature_count` features
1353
+ *
1354
+ * # Errors
1355
+ *
1356
+ * Throws (to JavaScript) when the vertices, pieces or blocks are cut short, when a WebGL object of the tile cannot be
1357
+ * created, or when its features or lines need a table texture past the GPU's `MAX_TEXTURE_SIZE`
1358
+ * @param {number} id
1359
+ * @param {number} key
1360
+ * @param {Float64Array} points
1361
+ * @param {Uint32Array} ring_start
1362
+ * @param {Uint32Array} polygon_start
1363
+ * @param {Uint32Array} polygon_feature
1364
+ * @param {Uint32Array} fill_start
1365
+ * @param {Uint8Array} vertices
1366
+ * @param {Uint32Array} indices
1367
+ * @param {Uint32Array} fill_ranges
1368
+ * @param {boolean} prism
1369
+ * @param {Uint8Array} pieces
1370
+ * @param {Float32Array} line_table
1371
+ * @param {Uint32Array} line_ranges
1372
+ * @param {Uint8Array} blocks
1373
+ * @param {Uint32Array} block_indices
1374
+ * @param {Uint32Array} block_ranges
1375
+ * @param {Float64Array} bounds
1376
+ * @param {number} feature_count
1377
+ */
1378
+ setVectorTileMesh(id, key, points, ring_start, polygon_start, polygon_feature, fill_start, vertices, indices, fill_ranges, prism, pieces, line_table, line_ranges, blocks, block_indices, block_ranges, bounds, feature_count) {
1379
+ const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
1380
+ const len0 = WASM_VECTOR_LEN;
1381
+ const ptr1 = passArray32ToWasm0(ring_start, wasm.__wbindgen_malloc);
1382
+ const len1 = WASM_VECTOR_LEN;
1383
+ const ptr2 = passArray32ToWasm0(polygon_start, wasm.__wbindgen_malloc);
1384
+ const len2 = WASM_VECTOR_LEN;
1385
+ const ptr3 = passArray32ToWasm0(polygon_feature, wasm.__wbindgen_malloc);
1386
+ const len3 = WASM_VECTOR_LEN;
1387
+ const ptr4 = passArray32ToWasm0(fill_start, wasm.__wbindgen_malloc);
1388
+ const len4 = WASM_VECTOR_LEN;
1389
+ const ptr5 = passArray8ToWasm0(vertices, wasm.__wbindgen_malloc);
1390
+ const len5 = WASM_VECTOR_LEN;
1391
+ const ptr6 = passArray32ToWasm0(indices, wasm.__wbindgen_malloc);
1392
+ const len6 = WASM_VECTOR_LEN;
1393
+ const ptr7 = passArray32ToWasm0(fill_ranges, wasm.__wbindgen_malloc);
1394
+ const len7 = WASM_VECTOR_LEN;
1395
+ const ptr8 = passArray8ToWasm0(pieces, wasm.__wbindgen_malloc);
1396
+ const len8 = WASM_VECTOR_LEN;
1397
+ const ptr9 = passArrayF32ToWasm0(line_table, wasm.__wbindgen_malloc);
1398
+ const len9 = WASM_VECTOR_LEN;
1399
+ const ptr10 = passArray32ToWasm0(line_ranges, wasm.__wbindgen_malloc);
1400
+ const len10 = WASM_VECTOR_LEN;
1401
+ const ptr11 = passArray8ToWasm0(blocks, wasm.__wbindgen_malloc);
1402
+ const len11 = WASM_VECTOR_LEN;
1403
+ const ptr12 = passArray32ToWasm0(block_indices, wasm.__wbindgen_malloc);
1404
+ const len12 = WASM_VECTOR_LEN;
1405
+ const ptr13 = passArray32ToWasm0(block_ranges, wasm.__wbindgen_malloc);
1406
+ const len13 = WASM_VECTOR_LEN;
1407
+ const ptr14 = passArrayF64ToWasm0(bounds, wasm.__wbindgen_malloc);
1408
+ const len14 = WASM_VECTOR_LEN;
1409
+ const ret = wasm.engine_setVectorTileMesh(this.__wbg_ptr, id, key, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6, ptr7, len7, prism, ptr8, len8, ptr9, len9, ptr10, len10, ptr11, len11, ptr12, len12, ptr13, len13, ptr14, len14, feature_count);
1410
+ if (ret[1]) {
1411
+ throw takeFromExternrefTable0(ret[0]);
1412
+ }
1413
+ }
1414
+ /**
1415
+ * Adds or replaces tile `key` of a vector tile layer: its polygons as for `addFills` (`fill_start`: the first
1416
+ * polygon of each sublayer, and the end; those of an extrusion sublayer raised into blocks), its lines as for
1417
+ * `addLines` (`line_start`: the first line of each sublayer, and the end), `feature_count` features, styled as an
1418
+ * extrusion layer's (`setFeatureStyle` with the key: a color, then a line's width or a block's height and base);
1419
+ * `tile`: the corners of the tile they are cut to (west, north, east, south; empty: none), along whose edges no
1420
+ * wall of a block rises
1421
+ *
1422
+ * # Errors
1423
+ *
1424
+ * Throws (to JavaScript) when a WebGL object of the tile cannot be created, or when its features or lines need a
1425
+ * table texture past the GPU's `MAX_TEXTURE_SIZE`
1426
+ * @param {number} id
1427
+ * @param {number} key
1428
+ * @param {Float64Array} points
1429
+ * @param {Uint32Array} ring_start
1430
+ * @param {Uint32Array} polygon_start
1431
+ * @param {Uint32Array} polygon_feature
1432
+ * @param {Uint32Array} fill_start
1433
+ * @param {Float64Array} line_points
1434
+ * @param {Uint32Array} line_first
1435
+ * @param {Uint32Array} line_feature
1436
+ * @param {Uint32Array} line_start
1437
+ * @param {number} feature_count
1438
+ * @param {Float64Array} tile
1439
+ */
1440
+ setVectorTile(id, key, points, ring_start, polygon_start, polygon_feature, fill_start, line_points, line_first, line_feature, line_start, feature_count, tile) {
1441
+ const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
1442
+ const len0 = WASM_VECTOR_LEN;
1443
+ const ptr1 = passArray32ToWasm0(ring_start, wasm.__wbindgen_malloc);
1444
+ const len1 = WASM_VECTOR_LEN;
1445
+ const ptr2 = passArray32ToWasm0(polygon_start, wasm.__wbindgen_malloc);
1446
+ const len2 = WASM_VECTOR_LEN;
1447
+ const ptr3 = passArray32ToWasm0(polygon_feature, wasm.__wbindgen_malloc);
1448
+ const len3 = WASM_VECTOR_LEN;
1449
+ const ptr4 = passArray32ToWasm0(fill_start, wasm.__wbindgen_malloc);
1450
+ const len4 = WASM_VECTOR_LEN;
1451
+ const ptr5 = passArrayF64ToWasm0(line_points, wasm.__wbindgen_malloc);
1452
+ const len5 = WASM_VECTOR_LEN;
1453
+ const ptr6 = passArray32ToWasm0(line_first, wasm.__wbindgen_malloc);
1454
+ const len6 = WASM_VECTOR_LEN;
1455
+ const ptr7 = passArray32ToWasm0(line_feature, wasm.__wbindgen_malloc);
1456
+ const len7 = WASM_VECTOR_LEN;
1457
+ const ptr8 = passArray32ToWasm0(line_start, wasm.__wbindgen_malloc);
1458
+ const len8 = WASM_VECTOR_LEN;
1459
+ const ptr9 = passArrayF64ToWasm0(tile, wasm.__wbindgen_malloc);
1460
+ const len9 = WASM_VECTOR_LEN;
1461
+ const ret = wasm.engine_setVectorTile(this.__wbg_ptr, id, key, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6, ptr7, len7, ptr8, len8, feature_count, ptr9, len9);
1462
+ if (ret[1]) {
1463
+ throw takeFromExternrefTable0(ret[0]);
1464
+ }
1465
+ }
1131
1466
  /**
1132
1467
  * Shows what can be seen from points, each within its range: `observers` holds 8 numbers per observer
1133
1468
  * (16 at most): longitude, latitude (degrees), metres above the ground, range (metres), then to look one way
1134
1469
  * only heading, tilt, angles of view across and up (degrees), the heading NaN to look all around. What some
1135
1470
  * observer sees is tinted with `visible`, what is hidden from all those that reach it with `hidden` (RGB 0-1),
1136
1471
  * at `opacity`; `outline` (RGB 0-1, or empty) the color of the cones' edges drawn in 3D
1472
+ *
1473
+ * # Errors
1474
+ *
1475
+ * Throws (to JavaScript) when, on the first call, a WebGL object cannot be created or a shader fails to compile
1476
+ * (the error carries its info log)
1137
1477
  * @param {Float64Array} observers
1138
1478
  * @param {Float32Array} visible
1139
1479
  * @param {Float32Array} hidden
@@ -1155,6 +1495,7 @@ export class Engine {
1155
1495
  }
1156
1496
  }
1157
1497
  /**
1498
+ * Lowest and highest zoom levels the camera accepts
1158
1499
  * @param {number} min
1159
1500
  * @param {number} max
1160
1501
  */
@@ -1251,6 +1592,11 @@ export class Engine {
1251
1592
  }
1252
1593
  /**
1253
1594
  * Replaces a region of a ground layer's texture (one layer of a 2D array)
1595
+ *
1596
+ * # Errors
1597
+ *
1598
+ * Throws (to JavaScript) when there is no texture `name`, or when the region is out of its bounds or
1599
+ * `data` holds too few bytes
1254
1600
  * @param {number} id
1255
1601
  * @param {string} name
1256
1602
  * @param {number} x
@@ -1283,6 +1629,20 @@ export class Engine {
1283
1629
  const len0 = WASM_VECTOR_LEN;
1284
1630
  wasm.engine_updateIconAtlas(this.__wbg_ptr, x, y, width, height, ptr0, len0);
1285
1631
  }
1632
+ /**
1633
+ * Vector tiles (512 CSS pixels across at their level, as `MapLibre`'s) for the view of the last frame (else the
1634
+ * camera's), levels `min_z` to `max_z`, three numbers per tile (z, x, y), the nearest to the eye first: what a
1635
+ * vector tile layer draws (`addVectorTiles`), coarser far away in a tilted view as the raster layers
1636
+ * @param {number} min_z
1637
+ * @param {number} max_z
1638
+ * @returns {Uint32Array}
1639
+ */
1640
+ vectorTilesInView(min_z, max_z) {
1641
+ const ret = wasm.engine_vectorTilesInView(this.__wbg_ptr, min_z, max_z);
1642
+ var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
1643
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1644
+ return v1;
1645
+ }
1286
1646
  /**
1287
1647
  * Tiles a raster layer wants for the view of the last frame, three numbers per tile (z, x, y), the nearest to
1288
1648
  * the eye first: the level each area of the ground is drawn at, for the labels of a vector style to follow it
@@ -1296,6 +1656,7 @@ export class Engine {
1296
1656
  return v1;
1297
1657
  }
1298
1658
  /**
1659
+ * Zooms by `delta` levels around a screen point (CSS pixels), which keeps the same ground point under it
1299
1660
  * @param {number} delta
1300
1661
  * @param {number} x
1301
1662
  * @param {number} y
@@ -2178,6 +2539,12 @@ function __wbg_get_imports() {
2178
2539
  __wbg_pixelStorei_cb4e43466f5b8703: function(arg0, arg1, arg2) {
2179
2540
  arg0.pixelStorei(arg1 >>> 0, arg2);
2180
2541
  },
2542
+ __wbg_polygonOffset_81dc8ca84e29572b: function(arg0, arg1, arg2) {
2543
+ arg0.polygonOffset(arg1, arg2);
2544
+ },
2545
+ __wbg_polygonOffset_8f922d9173d8849d: function(arg0, arg1, arg2) {
2546
+ arg0.polygonOffset(arg1, arg2);
2547
+ },
2181
2548
  __wbg_prototypesetcall_06eb15da165dee8f: function(arg0, arg1, arg2) {
2182
2549
  Uint32Array.prototype.set.call(getArrayU32FromWasm0(arg0, arg1), arg2);
2183
2550
  },
@@ -2541,7 +2908,7 @@ function __wbg_get_imports() {
2541
2908
  return ret;
2542
2909
  },
2543
2910
  __wbindgen_generic_0000000000000001: function(arg0, arg1) {
2544
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 198, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
2911
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 214, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
2545
2912
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_2e566c63402fe7fa___convert__closures_____invoke___wasm_bindgen_2e566c63402fe7fa___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_2e566c63402fe7fa___JsError___true_);
2546
2913
  return ret;
2547
2914
  },