isard 1.0.0 → 1.2.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 (268) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/dist/{basemaps.d.ts → basemap/basemaps.d.ts} +3 -3
  3. package/dist/{basemaps.js → basemap/basemaps.js} +3 -3
  4. package/dist/basemap/basemaps.js.map +1 -0
  5. package/dist/{grid.d.ts → basemap/grid.d.ts} +6 -6
  6. package/dist/{grid.js → basemap/grid.js} +61 -67
  7. package/dist/basemap/grid.js.map +1 -0
  8. package/dist/{mvt.d.ts → basemap/mvt.d.ts} +1 -1
  9. package/dist/{mvt.js → basemap/mvt.js} +6 -6
  10. package/dist/basemap/mvt.js.map +1 -0
  11. package/dist/{pmtiles.d.ts → basemap/pmtiles.d.ts} +16 -10
  12. package/dist/{pmtiles.js → basemap/pmtiles.js} +41 -33
  13. package/dist/basemap/pmtiles.js.map +1 -0
  14. package/dist/{resample.d.ts → basemap/resample.d.ts} +11 -2
  15. package/dist/{resample.js → basemap/resample.js} +18 -16
  16. package/dist/basemap/resample.js.map +1 -0
  17. package/dist/{terrain.d.ts → basemap/terrain.d.ts} +3 -3
  18. package/dist/{terrain.js → basemap/terrain.js} +7 -7
  19. package/dist/basemap/terrain.js.map +1 -0
  20. package/dist/{vectorstyle.d.ts → basemap/vectorstyle.d.ts} +12 -10
  21. package/dist/{vectorstyle.js → basemap/vectorstyle.js} +129 -111
  22. package/dist/basemap/vectorstyle.js.map +1 -0
  23. package/dist/{vectortiles.d.ts → basemap/vectortiles.d.ts} +18 -18
  24. package/dist/{vectortiles.js → basemap/vectortiles.js} +157 -109
  25. package/dist/basemap/vectortiles.js.map +1 -0
  26. package/dist/{wmts.d.ts → basemap/wmts.d.ts} +3 -3
  27. package/dist/{wmts.js → basemap/wmts.js} +19 -14
  28. package/dist/basemap/wmts.js.map +1 -0
  29. package/dist/basemap.worker.js +2 -2
  30. package/dist/basemap.worker.js.map +14 -13
  31. package/dist/bind/layers.d.ts +46 -0
  32. package/dist/bind/layers.js +154 -0
  33. package/dist/bind/layers.js.map +1 -0
  34. package/dist/{crs.d.ts → data/crs.d.ts} +11 -11
  35. package/dist/{crs.js → data/crs.js} +38 -34
  36. package/dist/data/crs.js.map +1 -0
  37. package/dist/{gpx.d.ts → data/gpx.d.ts} +2 -2
  38. package/dist/{gpx.js → data/gpx.js} +20 -20
  39. package/dist/data/gpx.js.map +1 -0
  40. package/dist/{kml.d.ts → data/kml.d.ts} +2 -2
  41. package/dist/{kml.js → data/kml.js} +42 -39
  42. package/dist/data/kml.js.map +1 -0
  43. package/dist/{topojson.d.ts → data/topojson.d.ts} +2 -2
  44. package/dist/{topojson.js → data/topojson.js} +15 -10
  45. package/dist/data/topojson.js.map +1 -0
  46. package/dist/{xml.d.ts → data/xml.d.ts} +5 -5
  47. package/dist/{xml.js → data/xml.js} +19 -18
  48. package/dist/data/xml.js.map +1 -0
  49. package/dist/decoder.worker.js +4 -4
  50. package/dist/decoder.worker.js.map +7 -7
  51. package/dist/{decoders.d.ts → engine/decoders.d.ts} +3 -3
  52. package/dist/{decoders.js → engine/decoders.js} +28 -25
  53. package/dist/engine/decoders.js.map +1 -0
  54. package/dist/{loader.d.ts → engine/loader.d.ts} +1 -1
  55. package/dist/{loader.js → engine/loader.js} +17 -14
  56. package/dist/engine/loader.js.map +1 -0
  57. package/dist/{protocol.d.ts → engine/protocol.d.ts} +1 -1
  58. package/dist/engine/protocol.js +3 -0
  59. package/dist/engine/protocol.js.map +1 -0
  60. package/dist/{requests.d.ts → engine/requests.d.ts} +1 -1
  61. package/dist/{requests.js → engine/requests.js} +19 -16
  62. package/dist/engine/requests.js.map +1 -0
  63. package/dist/engine-loader.d.ts +13 -9
  64. package/dist/engine-loader.js +30 -30
  65. package/dist/engine-loader.js.map +1 -1
  66. package/dist/formats.d.ts +3 -3
  67. package/dist/formats.js +3 -3
  68. package/dist/formats.js.map +1 -1
  69. package/dist/geoplateforme.d.ts +13 -13
  70. package/dist/geoplateforme.js +23 -21
  71. package/dist/geoplateforme.js.map +1 -1
  72. package/dist/index.d.ts +30 -29
  73. package/dist/index.js +18 -18
  74. package/dist/index.js.map +1 -1
  75. package/dist/isard_bg.wasm +0 -0
  76. package/dist/isard_core_bg.wasm +0 -0
  77. package/dist/isard_points_bg.wasm +0 -0
  78. package/dist/{extrusions.d.ts → layers/extrusions.d.ts} +1 -1
  79. package/dist/{extrusions.js → layers/extrusions.js} +10 -5
  80. package/dist/layers/extrusions.js.map +1 -0
  81. package/dist/{features.d.ts → layers/features.d.ts} +10 -10
  82. package/dist/{features.js → layers/features.js} +44 -45
  83. package/dist/layers/features.js.map +1 -0
  84. package/dist/{glyphs.d.ts → layers/glyphs.d.ts} +6 -6
  85. package/dist/{glyphs.js → layers/glyphs.js} +45 -41
  86. package/dist/layers/glyphs.js.map +1 -0
  87. package/dist/{icons.d.ts → layers/icons.d.ts} +10 -10
  88. package/dist/{icons.js → layers/icons.js} +84 -69
  89. package/dist/layers/icons.js.map +1 -0
  90. package/dist/{layers.d.ts → layers/layers.d.ts} +9 -4
  91. package/dist/{layers.js → layers/layers.js} +35 -31
  92. package/dist/layers/layers.js.map +1 -0
  93. package/dist/{panoramas.d.ts → layers/panoramas.d.ts} +3 -3
  94. package/dist/{panoramas.js → layers/panoramas.js} +54 -43
  95. package/dist/layers/panoramas.js.map +1 -0
  96. package/dist/{pointclouds.d.ts → layers/pointclouds.d.ts} +5 -5
  97. package/dist/{pointclouds.js → layers/pointclouds.js} +26 -34
  98. package/dist/layers/pointclouds.js.map +1 -0
  99. package/dist/{symbols.d.ts → layers/symbols.d.ts} +3 -3
  100. package/dist/{symbols.js → layers/symbols.js} +69 -72
  101. package/dist/layers/symbols.js.map +1 -0
  102. package/dist/map/basemap-layers.d.ts +26 -0
  103. package/dist/map/basemap-layers.js +61 -0
  104. package/dist/map/basemap-layers.js.map +1 -0
  105. package/dist/map/canvas.d.ts +17 -0
  106. package/dist/map/canvas.js +56 -0
  107. package/dist/map/canvas.js.map +1 -0
  108. package/dist/map/checks.d.ts +11 -0
  109. package/dist/map/checks.js +39 -0
  110. package/dist/map/checks.js.map +1 -0
  111. package/dist/map/credits.d.ts +17 -0
  112. package/dist/map/credits.js +34 -0
  113. package/dist/map/credits.js.map +1 -0
  114. package/dist/map/engine-settings.d.ts +15 -0
  115. package/dist/map/engine-settings.js +45 -0
  116. package/dist/map/engine-settings.js.map +1 -0
  117. package/dist/map/engines.d.ts +41 -0
  118. package/dist/map/engines.js +77 -0
  119. package/dist/map/engines.js.map +1 -0
  120. package/dist/map/events.d.ts +14 -0
  121. package/dist/map/events.js +46 -0
  122. package/dist/map/events.js.map +1 -0
  123. package/dist/map/frame-loop.d.ts +61 -0
  124. package/dist/map/frame-loop.js +139 -0
  125. package/dist/map/frame-loop.js.map +1 -0
  126. package/dist/map/hover-pick.d.ts +30 -0
  127. package/dist/map/hover-pick.js +56 -0
  128. package/dist/map/hover-pick.js.map +1 -0
  129. package/dist/map/layer-spec.d.ts +42 -0
  130. package/dist/map/layer-spec.js +34 -0
  131. package/dist/map/layer-spec.js.map +1 -0
  132. package/dist/map/layer-stack.d.ts +36 -0
  133. package/dist/map/layer-stack.js +101 -0
  134. package/dist/map/layer-stack.js.map +1 -0
  135. package/dist/map/overlay-host.d.ts +36 -0
  136. package/dist/map/overlay-host.js +101 -0
  137. package/dist/map/overlay-host.js.map +1 -0
  138. package/dist/map/panorama-host.d.ts +5 -0
  139. package/dist/map/panorama-host.js +32 -0
  140. package/dist/map/panorama-host.js.map +1 -0
  141. package/dist/map/raster-source.d.ts +11 -0
  142. package/dist/map/raster-source.js +26 -0
  143. package/dist/map/raster-source.js.map +1 -0
  144. package/dist/map/symbol-atlases.d.ts +26 -0
  145. package/dist/map/symbol-atlases.js +59 -0
  146. package/dist/map/symbol-atlases.js.map +1 -0
  147. package/dist/map/viewshed.d.ts +5 -0
  148. package/dist/map/viewshed.js +28 -0
  149. package/dist/map/viewshed.js.map +1 -0
  150. package/dist/map/workers.d.ts +46 -0
  151. package/dist/map/workers.js +73 -0
  152. package/dist/map/workers.js.map +1 -0
  153. package/dist/map.d.ts +46 -127
  154. package/dist/map.js +183 -698
  155. package/dist/map.js.map +1 -1
  156. package/dist/projections.d.ts +3 -3
  157. package/dist/projections.js +2 -2
  158. package/dist/projections.js.map +1 -1
  159. package/dist/react/Control.d.ts +11 -0
  160. package/dist/react/Control.js +18 -0
  161. package/dist/react/Control.js.map +1 -0
  162. package/dist/react/CustomLayer.d.ts +11 -0
  163. package/dist/react/CustomLayer.js +30 -0
  164. package/dist/react/CustomLayer.js.map +1 -0
  165. package/dist/react/IsardMap.d.ts +43 -0
  166. package/dist/react/IsardMap.js +146 -0
  167. package/dist/react/IsardMap.js.map +1 -0
  168. package/dist/react/Layer.d.ts +42 -0
  169. package/dist/react/Layer.js +74 -0
  170. package/dist/react/Layer.js.map +1 -0
  171. package/dist/react/Marker.d.ts +24 -0
  172. package/dist/react/Marker.js +53 -0
  173. package/dist/react/Marker.js.map +1 -0
  174. package/dist/react/Panel.d.ts +11 -0
  175. package/dist/react/Panel.js +37 -0
  176. package/dist/react/Panel.js.map +1 -0
  177. package/dist/react/Popup.d.ts +18 -0
  178. package/dist/react/Popup.js +60 -0
  179. package/dist/react/Popup.js.map +1 -0
  180. package/dist/react/Swipe.d.ts +9 -0
  181. package/dist/react/Swipe.js +41 -0
  182. package/dist/react/Swipe.js.map +1 -0
  183. package/dist/react/Viewshed.d.ts +5 -0
  184. package/dist/react/Viewshed.js +28 -0
  185. package/dist/react/Viewshed.js.map +1 -0
  186. package/dist/react/context.d.ts +32 -0
  187. package/dist/react/context.js +20 -0
  188. package/dist/react/context.js.map +1 -0
  189. package/dist/react/index.d.ts +26 -0
  190. package/dist/react/index.js +22 -0
  191. package/dist/react/index.js.map +1 -0
  192. package/dist/settings.d.ts +6 -10
  193. package/dist/settings.js +19 -17
  194. package/dist/settings.js.map +1 -1
  195. package/dist/types.d.ts +8 -8
  196. package/dist/types.js +1 -0
  197. package/dist/types.js.map +1 -1
  198. package/dist/{controls.d.ts → ui/controls.d.ts} +1 -1
  199. package/dist/{controls.js → ui/controls.js} +6 -4
  200. package/dist/ui/controls.js.map +1 -0
  201. package/dist/{interaction.d.ts → ui/interaction.d.ts} +9 -5
  202. package/dist/{interaction.js → ui/interaction.js} +9 -8
  203. package/dist/ui/interaction.js.map +1 -0
  204. package/dist/{overlay.d.ts → ui/overlay.d.ts} +2 -2
  205. package/dist/{overlay.js → ui/overlay.js} +18 -20
  206. package/dist/ui/overlay.js.map +1 -0
  207. package/dist/{style.d.ts → ui/style.d.ts} +1 -1
  208. package/dist/{style.js → ui/style.js} +2 -2
  209. package/dist/ui/style.js.map +1 -0
  210. package/dist/{animation.d.ts → util/animation.d.ts} +9 -5
  211. package/dist/{animation.js → util/animation.js} +6 -6
  212. package/dist/util/animation.js.map +1 -0
  213. package/dist/{color.d.ts → util/color.d.ts} +1 -1
  214. package/dist/{color.js → util/color.js} +14 -16
  215. package/dist/util/color.js.map +1 -0
  216. package/dist/{geo.d.ts → util/geo.d.ts} +6 -6
  217. package/dist/{geo.js → util/geo.js} +12 -12
  218. package/dist/util/geo.js.map +1 -0
  219. package/dist/util/guards.d.ts +7 -0
  220. package/dist/util/guards.js +8 -0
  221. package/dist/util/guards.js.map +1 -0
  222. package/dist/util/lru.js.map +1 -0
  223. package/dist/wasm/isard.d.ts +168 -0
  224. package/dist/wasm/isard.js +146 -0
  225. package/dist/wasm/isard_core.d.ts +144 -0
  226. package/dist/wasm/isard_core.js +122 -0
  227. package/dist/{basemap.worker.d.ts → workers/basemap.worker.d.ts} +17 -7
  228. package/dist/workers/basemap.worker.js +658 -0
  229. package/dist/workers/basemap.worker.js.map +1 -0
  230. package/package.json +24 -1
  231. package/vite.js +1 -1
  232. package/dist/animation.js.map +0 -1
  233. package/dist/basemaps.js.map +0 -1
  234. package/dist/color.js.map +0 -1
  235. package/dist/controls.js.map +0 -1
  236. package/dist/crs.js.map +0 -1
  237. package/dist/decoders.js.map +0 -1
  238. package/dist/extrusions.js.map +0 -1
  239. package/dist/features.js.map +0 -1
  240. package/dist/geo.js.map +0 -1
  241. package/dist/glyphs.js.map +0 -1
  242. package/dist/gpx.js.map +0 -1
  243. package/dist/grid.js.map +0 -1
  244. package/dist/icons.js.map +0 -1
  245. package/dist/interaction.js.map +0 -1
  246. package/dist/kml.js.map +0 -1
  247. package/dist/layers.js.map +0 -1
  248. package/dist/loader.js.map +0 -1
  249. package/dist/lru.js.map +0 -1
  250. package/dist/mvt.js.map +0 -1
  251. package/dist/overlay.js.map +0 -1
  252. package/dist/panoramas.js.map +0 -1
  253. package/dist/pmtiles.js.map +0 -1
  254. package/dist/pointclouds.js.map +0 -1
  255. package/dist/protocol.js +0 -2
  256. package/dist/protocol.js.map +0 -1
  257. package/dist/requests.js.map +0 -1
  258. package/dist/resample.js.map +0 -1
  259. package/dist/style.js.map +0 -1
  260. package/dist/symbols.js.map +0 -1
  261. package/dist/terrain.js.map +0 -1
  262. package/dist/topojson.js.map +0 -1
  263. package/dist/vectorstyle.js.map +0 -1
  264. package/dist/vectortiles.js.map +0 -1
  265. package/dist/wmts.js.map +0 -1
  266. package/dist/xml.js.map +0 -1
  267. /package/dist/{lru.d.ts → util/lru.d.ts} +0 -0
  268. /package/dist/{lru.js → util/lru.js} +0 -0
@@ -62,10 +62,19 @@ export interface PickResult {
62
62
 
63
63
 
64
64
 
65
+ /**
66
+ * A map on one canvas: its WebGL2 context, camera, ground (raster layers over the relief) and the layers over it.
67
+ * Draws only when `render` is called (the JavaScript side calls it after `redraw` asks for a frame)
68
+ */
65
69
  export class Engine {
66
70
  free(): void;
67
71
  /**
68
72
  * Circle layer of `feature_count` features: points (Mercator [0, 1], interleaved) and the feature of each
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`
69
78
  */
70
79
  addCircles(points: Float64Array, feature: Uint32Array, feature_count: number): number;
71
80
  /**
@@ -76,23 +85,42 @@ export class Engine {
76
85
  addCustomLayer(render: () => void, depth: boolean): number;
77
86
  /**
78
87
  * An empty extrusion layer: its blocks come in batches (`setExtrusionBatch`)
88
+ *
89
+ * # Errors
90
+ *
91
+ * Throws (to JavaScript) when a WebGL object cannot be created or a shader fails to compile (the error carries its
92
+ * info log)
79
93
  */
80
94
  addExtrusions(): number;
81
95
  /**
82
96
  * Fill layer of `feature_count` features: polygons given by their points (Mercator [0, 1], interleaved), the first
83
97
  * point of each ring (`ring_start`, one more entry than rings), the first ring of each polygon (`polygon_start`,
84
98
  * one more entry than polygons; the first ring is the outer one, the others holes) and the feature of each polygon
99
+ *
100
+ * # Errors
101
+ *
102
+ * Throws (to JavaScript) when a WebGL object cannot be created or a shader fails to compile (the error carries its
103
+ * info log), or when `feature_count` features need a table texture past the GPU's `MAX_TEXTURE_SIZE`
85
104
  */
86
105
  addFills(points: Float64Array, ring_start: Uint32Array, polygon_start: Uint32Array, feature: Uint32Array, feature_count: number): number;
87
106
  /**
88
107
  * Ground layer running `code` (GLSL ES 3.0 defining `vec4 ground(vec2 offset)`, see `render::ground`) over the
89
108
  * ground; `anchor`: Mercator point the offsets are taken from; bounds: Mercator box it shows in. Compilation errors
90
109
  * come back with the shader's info log (line numbers of `code`)
110
+ *
111
+ * # Errors
112
+ *
113
+ * Throws (to JavaScript) when `code` does not compile or link, with the shader's info log
91
114
  */
92
115
  addGround(code: string, anchor_x: number, anchor_y: number, min_x: number, min_y: number, max_x: number, max_y: number): number;
93
116
  /**
94
117
  * Line layer of `feature_count` features: polylines given by their points (Mercator [0, 1], interleaved), the
95
118
  * first point of each (`start`, one more entry than lines) and the feature each one belongs to
119
+ *
120
+ * # Errors
121
+ *
122
+ * Throws (to JavaScript) when a WebGL object cannot be created or a shader fails to compile (the error carries its
123
+ * info log), or when the features or the lines need a table texture past the GPU's `MAX_TEXTURE_SIZE`
96
124
  */
97
125
  addLines(points: Float64Array, start: Uint32Array, feature: Uint32Array, feature_count: number): number;
98
126
  /**
@@ -101,16 +129,31 @@ export class Engine {
101
129
  * edges (node index pairs, interleaved). `line_start` and `line_points`: the line of each edge from A to B, points
102
130
  * `line_start[e] .. line_start[e + 1]` of `line_points` (Mercator, interleaved; straight if fewer than two). `costs`: per edge, the
103
131
  * cost of travelling it from A to B then from B to A; without, values are interpolated along the edges.
132
+ *
133
+ * # Errors
134
+ *
135
+ * Throws (to JavaScript) when `style` is not 25 numbers, `edges` is not node pairs or names a node past
136
+ * those of `mercator`, the nodes or edges need a table texture past the GPU's `MAX_TEXTURE_SIZE`, or when
137
+ * a WebGL object cannot be created or a shader fails to compile (the error carries its info log)
104
138
  */
105
139
  addNetwork(mercator: Float64Array, edges: Uint32Array, line_start: Uint32Array | null | undefined, line_points: Float64Array | null | undefined, costs: Float32Array | null | undefined, style: Float32Array): number;
106
140
  /**
107
141
  * Raster tiles in Web Mercator; `url` holds {z}, {x} and {y}. `size`: side of the tiles' textures (256 by
108
142
  * default); `loader`: draws each tile instead of fetching `url`, `(z, x, y, signal) => Promise<ImageBitmap |
109
143
  * null>`, an image of `size` × `size` (null: nothing there)
144
+ *
145
+ * # Errors
146
+ *
147
+ * Throws (to JavaScript) when the texture holding the layer's tiles cannot be created
110
148
  */
111
149
  addRaster(url: string, min_z: number, max_z: number, opacity: number, saturation: number, size: number | null | undefined, loader: ((z: number, x: number, y: number, signal: AbortSignal) => Promise<ImageBitmap | null>) | undefined): number;
112
150
  /**
113
151
  * An empty symbol layer
152
+ *
153
+ * # Errors
154
+ *
155
+ * Throws (to JavaScript) when a WebGL object cannot be created or a shader fails to compile (the error carries its
156
+ * info log)
114
157
  */
115
158
  addSymbols(): number;
116
159
  /**
@@ -118,7 +161,13 @@ export class Engine {
118
161
  * border cast on the ground, or on the far plane where it passes the horizon
119
162
  */
120
163
  bounds(): Float64Array;
164
+ /**
165
+ * The camera as set or moved: center (degrees), zoom, pitch and bearing (degrees)
166
+ */
121
167
  camera(): Camera;
168
+ /**
169
+ * Stops loading the tiles of the flight's destination (`preload`)
170
+ */
122
171
  clearPreload(): void;
123
172
  /**
124
173
  * Removes the viewshed
@@ -166,6 +215,11 @@ export class Engine {
166
215
  networkStats(id: number): NetworkStats | undefined;
167
216
  /**
168
217
  * `redraw` is called when the engine needs a new frame (a tile arrived)
218
+ *
219
+ * # Errors
220
+ *
221
+ * Throws (to JavaScript) when the canvas gives no WebGL2 context ("WebGL2 is not available"), or when a WebGL
222
+ * object of the globe, the sky or the raster pass cannot be created or one of their shaders fails to compile
169
223
  */
170
224
  constructor(canvas: HTMLCanvasElement, redraw: () => void);
171
225
  /**
@@ -194,8 +248,18 @@ export class Engine {
194
248
  * Screen point (CSS pixels) of a ground position, or `height` metres above it, undefined behind the camera
195
249
  */
196
250
  project(lon: number, lat: number, height?: number | null): [x: number, y: number] | undefined;
251
+ /**
252
+ * Removes batch `key` of an extrusion layer (nothing if there is none)
253
+ */
197
254
  removeExtrusionBatch(id: number, key: number): void;
255
+ /**
256
+ * Removes a layer and frees its GPU objects; the other layers forget it (a layer that referred to it)
257
+ */
198
258
  removeLayer(id: number): void;
259
+ /**
260
+ * Draws a frame: the backdrop, the ground and the layers over it bottom to top, then the panorama and the
261
+ * viewshed; returns true while tiles are still loading (a new frame will be asked through `redraw`)
262
+ */
199
263
  render(): boolean;
200
264
  /**
201
265
  * Asks what is under a screen point without waiting for the GPU (as `pick`, with the position there): the
@@ -216,6 +280,9 @@ export class Engine {
216
280
  * then the sky-horizon, horizon-fog and fog-ground blends; `undefined` for none (the background color shows)
217
281
  */
218
282
  setAtmosphere(settings?: Float32Array | null): void;
283
+ /**
284
+ * Color the canvas is cleared to (RGB 0-1), where neither ground nor sky is drawn
285
+ */
219
286
  setBackground(r: number, g: number, b: number): void;
220
287
  /**
221
288
  * The body the map is drawn on: its equatorial radius (metres) and flattening (0 for a sphere), the halo of its
@@ -225,6 +292,10 @@ export class Engine {
225
292
  * relief, whose shaders may take its size (`ISARD_CIRCUMFERENCE` of the ground layers)
226
293
  */
227
294
  setBody(radius: number, flattening: number, halo: Float32Array | null | undefined, lowest: number, highest: number): void;
295
+ /**
296
+ * Sets the camera (degrees, the conventions of `MapLibre`): leaves a street-level view, and the camera keeps this
297
+ * center as the relief comes in
298
+ */
228
299
  setCamera(lon: number, lat: number, zoom: number, pitch: number, bearing: number): void;
229
300
  /**
230
301
  * Circles lying on the ground (true) or facing the screen
@@ -236,11 +307,21 @@ export class Engine {
236
307
  setCircles(id: number, points: Float64Array, feature: Uint32Array): void;
237
308
  /**
238
309
  * Anchors of batch `key` on the linked network: per feature, node A, node B, cost from A, cost from B
310
+ *
311
+ * # Errors
312
+ *
313
+ * Throws (to JavaScript) when the batch's features need an anchor texture past the GPU's
314
+ * `MAX_TEXTURE_SIZE`, or when it cannot be created
239
315
  */
240
316
  setExtrusionAnchors(id: number, key: number, anchors: Float32Array): void;
241
317
  /**
242
318
  * Adds or replaces batch `key` of an extrusion layer: polygons as for `addFills`, `feature_count` features (the
243
319
  * feature style gives each its height and base height as its two sizes, metres)
320
+ *
321
+ * # Errors
322
+ *
323
+ * Throws (to JavaScript) when a WebGL buffer or vertex array of the batch cannot be created, or when
324
+ * `feature_count` features need a table texture past the GPU's `MAX_TEXTURE_SIZE`
244
325
  */
245
326
  setExtrusionBatch(id: number, key: number, points: Float64Array, ring_start: Uint32Array, polygon_start: Uint32Array, feature: Uint32Array, feature_count: number): void;
246
327
  /**
@@ -288,29 +369,59 @@ export class Engine {
288
369
  /**
289
370
  * The glyph atlas shared by the symbol layers, one page: `width` × `height` bytes of signed distances
290
371
  * (allocated again, filled with `data` if given)
372
+ *
373
+ * # Errors
374
+ *
375
+ * Throws (to JavaScript) as `setGlyphPages` does: a size that is not positive, or the texture not created
291
376
  */
292
377
  setGlyphAtlas(width: number, height: number, data?: Uint8Array | null): void;
293
378
  /**
294
379
  * The glyph atlas shared by the symbol layers, `pages` pages of `width` × `height` bytes of signed distances,
295
380
  * allocated again and empty (`updateGlyphPage` fills them). A glyph on page `p` at row `v` has the atlas
296
381
  * coordinate `v + p × height`
382
+ *
383
+ * # Errors
384
+ *
385
+ * Throws (to JavaScript) when `width` or `height` is not positive (or their product overflows), `pages`
386
+ * is not 1 to 256, or the atlas texture cannot be created
297
387
  */
298
388
  setGlyphPages(width: number, height: number, pages: number): void;
389
+ /**
390
+ * Moves the Mercator box (0-1) a ground layer shows in
391
+ */
299
392
  setGroundBounds(id: number, min_x: number, min_y: number, max_x: number, max_y: number): void;
300
393
  /**
301
394
  * Creates the texture of sampler `name` (`format`: r8, r8ui, r16ui, r16i, r32ui, r32f, rg16ui, rg32f, rgba8,
302
395
  * rgba8ui, rgba16ui, rgba32f; `depth` 0 for 2D, else a 2D array of that many layers; `linear` filtering for the
303
396
  * non-integer formats); `data`: its texels as bytes, or undefined for an empty texture
397
+ *
398
+ * # Errors
399
+ *
400
+ * Throws (to JavaScript) on an unknown `format`, a size not positive (or overflowing), `data` shorter
401
+ * than the texels, more textures than the layer takes, or a texture WebGL cannot create
304
402
  */
305
403
  setGroundTexture(id: number, name: string, format: string, width: number, height: number, depth: number, linear: boolean, data?: Uint8Array | null): void;
306
404
  /**
307
405
  * A uniform of a ground layer's code, as numbers
406
+ *
407
+ * # Errors
408
+ *
409
+ * Throws (to JavaScript) when the shader has no uniform `name` (one its code does not use is removed
410
+ * by the compiler)
308
411
  */
309
412
  setGroundUniform(id: number, name: string, values: Float64Array): void;
413
+ /**
414
+ * Shows or hides a ground layer (kept, with its uniforms and textures)
415
+ */
310
416
  setGroundVisible(id: number, visible: boolean): void;
311
417
  /**
312
418
  * The icon atlas shared by the symbol layers: `width` × `height` RGBA texels, premultiplied, allocated again
313
419
  * and empty (`updateIconAtlas` fills it)
420
+ *
421
+ * # Errors
422
+ *
423
+ * Throws (to JavaScript) when `width` or `height` is not positive (or their product overflows), or the
424
+ * atlas texture cannot be created
314
425
  */
315
426
  setIconAtlas(width: number, height: number): void;
316
427
  /**
@@ -324,6 +435,11 @@ export class Engine {
324
435
  setLineDash(id: number, dash: number, gap: number): void;
325
436
  /**
326
437
  * New lines for a line layer (same arguments as `addLines`, the same features)
438
+ *
439
+ * # Errors
440
+ *
441
+ * Throws (to JavaScript) when the lines need a table texture past the GPU's `MAX_TEXTURE_SIZE`, or
442
+ * when it cannot be created; the layer then keeps its lines
327
443
  */
328
444
  setLines(id: number, points: Float64Array, start: Uint32Array, feature: Uint32Array): void;
329
445
  /**
@@ -352,6 +468,9 @@ export class Engine {
352
468
  * One value per node; negative = unreached
353
469
  */
354
470
  setNetworkValues(id: number, values: Float32Array): void;
471
+ /**
472
+ * Opacity and saturation (0-1) of a raster layer; nothing for another id
473
+ */
355
474
  setRasterStyle(id: number, opacity: number, saturation: number): void;
356
475
  /**
357
476
  * The headers added to the engine's requests by URL prefix (`setRequestHeaders`, the same for every map of the
@@ -376,6 +495,11 @@ export class Engine {
376
495
  * Labels of a symbol layer, shaped by the page: anchors (Mercator, interleaved), their texts' boxes (min x, min y,
377
496
  * max x, max y, CSS pixels from the anchor), styles (36 floats each, see `LABEL_FLOATS`) and glyph and icon quads
378
497
  * (11 floats each, see `QUAD_FLOATS`)
498
+ *
499
+ * # Errors
500
+ *
501
+ * Throws (to JavaScript) when the labels need a table texture past the GPU's `MAX_TEXTURE_SIZE`, or
502
+ * when it cannot be created; the layer then keeps its labels
379
503
  */
380
504
  setSymbols(id: number, anchors: Float64Array, boxes: Float32Array, styles: Float32Array, quads: Float32Array): void;
381
505
  /**
@@ -387,6 +511,10 @@ export class Engine {
387
511
  * above the ellipsoid, those of 3D Tiles; over France, on the Earth only), else left as served (the default);
388
512
  * `loader`: gives the
389
513
  * altitudes of each tile instead of fetching `url` (an encoding decoded by the page: Terrarium, Terrain-RGB)
514
+ *
515
+ * # Errors
516
+ *
517
+ * Throws (to JavaScript) when the texture holding the relief's tiles cannot be created
390
518
  */
391
519
  setTerrain(url: string | null | undefined, exaggeration: number, max_z: number | null | undefined, geoid: boolean | null | undefined, loader: ((z: number, x: number, y: number, signal: AbortSignal) => Promise<Float32Array | null>) | undefined): void;
392
520
  /**
@@ -395,8 +523,16 @@ export class Engine {
395
523
  * only heading, tilt, angles of view across and up (degrees), the heading NaN to look all around. What some
396
524
  * observer sees is tinted with `visible`, what is hidden from all those that reach it with `hidden` (RGB 0-1),
397
525
  * at `opacity`; `outline` (RGB 0-1, or empty) the color of the cones' edges drawn in 3D
526
+ *
527
+ * # Errors
528
+ *
529
+ * Throws (to JavaScript) when, on the first call, a WebGL object cannot be created or a shader fails to compile
530
+ * (the error carries its info log)
398
531
  */
399
532
  setViewshed(observers: Float64Array, visible: Float32Array, hidden: Float32Array, opacity: number, outline: Float32Array): void;
533
+ /**
534
+ * Lowest and highest zoom levels the camera accepts
535
+ */
400
536
  setZoomRange(min: number, max: number): void;
401
537
  /**
402
538
  * Tile counters of the raster layers, for diagnostics
@@ -424,6 +560,11 @@ export class Engine {
424
560
  updateGlyphPage(page: number, x: number, y: number, width: number, height: number, data: Uint8Array): void;
425
561
  /**
426
562
  * Replaces a region of a ground layer's texture (one layer of a 2D array)
563
+ *
564
+ * # Errors
565
+ *
566
+ * Throws (to JavaScript) when there is no texture `name`, or when the region is out of its bounds or
567
+ * `data` holds too few bytes
427
568
  */
428
569
  updateGroundTexture(id: number, name: string, x: number, y: number, layer: number, width: number, height: number, data: Uint8Array): void;
429
570
  /**
@@ -435,6 +576,9 @@ export class Engine {
435
576
  * the eye first: the level each area of the ground is drawn at, for the labels of a vector style to follow it
436
577
  */
437
578
  wantedTiles(id: number): Uint32Array;
579
+ /**
580
+ * Zooms by `delta` levels around a screen point (CSS pixels), which keeps the same ground point under it
581
+ */
438
582
  zoomAt(delta: number, x: number, y: number): void;
439
583
  }
440
584
 
@@ -1,5 +1,9 @@
1
1
  /* @ts-self-types="./isard_core.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
@@ -128,6 +156,12 @@ export class Engine {
128
156
  * edges (node index pairs, interleaved). `line_start` and `line_points`: the line of each edge from A to B, points
129
157
  * `line_start[e] .. line_start[e + 1]` of `line_points` (Mercator, interleaved; straight if fewer than two). `costs`: per edge, the
130
158
  * cost of travelling it from A to B then from B to A; without, values are interpolated along the edges.
159
+ *
160
+ * # Errors
161
+ *
162
+ * Throws (to JavaScript) when `style` is not 25 numbers, `edges` is not node pairs or names a node past
163
+ * those of `mercator`, the nodes or edges need a table texture past the GPU's `MAX_TEXTURE_SIZE`, or when
164
+ * a WebGL object cannot be created or a shader fails to compile (the error carries its info log)
131
165
  * @param {Float64Array} mercator
132
166
  * @param {Uint32Array} edges
133
167
  * @param {Uint32Array | null | undefined} line_start
@@ -159,6 +193,10 @@ export class Engine {
159
193
  * Raster tiles in Web Mercator; `url` holds {z}, {x} and {y}. `size`: side of the tiles' textures (256 by
160
194
  * default); `loader`: draws each tile instead of fetching `url`, `(z, x, y, signal) => Promise<ImageBitmap |
161
195
  * null>`, an image of `size` × `size` (null: nothing there)
196
+ *
197
+ * # Errors
198
+ *
199
+ * Throws (to JavaScript) when the texture holding the layer's tiles cannot be created
162
200
  * @param {string} url
163
201
  * @param {number} min_z
164
202
  * @param {number} max_z
@@ -179,6 +217,11 @@ export class Engine {
179
217
  }
180
218
  /**
181
219
  * An empty symbol layer
220
+ *
221
+ * # Errors
222
+ *
223
+ * Throws (to JavaScript) when a WebGL object cannot be created or a shader fails to compile (the error carries its
224
+ * info log)
182
225
  * @returns {number}
183
226
  */
184
227
  addSymbols() {
@@ -200,12 +243,16 @@ export class Engine {
200
243
  return v1;
201
244
  }
202
245
  /**
246
+ * The camera as set or moved: center (degrees), zoom, pitch and bearing (degrees)
203
247
  * @returns {Camera}
204
248
  */
205
249
  camera() {
206
250
  const ret = wasm.engine_camera(this.__wbg_ptr);
207
251
  return ret;
208
252
  }
253
+ /**
254
+ * Stops loading the tiles of the flight's destination (`preload`)
255
+ */
209
256
  clearPreload() {
210
257
  wasm.engine_clearPreload(this.__wbg_ptr);
211
258
  }
@@ -310,6 +357,11 @@ export class Engine {
310
357
  }
311
358
  /**
312
359
  * `redraw` is called when the engine needs a new frame (a tile arrived)
360
+ *
361
+ * # Errors
362
+ *
363
+ * Throws (to JavaScript) when the canvas gives no WebGL2 context ("WebGL2 is not available"), or when a WebGL
364
+ * object of the globe, the sky or the raster pass cannot be created or one of their shaders fails to compile
313
365
  * @param {HTMLCanvasElement} canvas
314
366
  * @param {() => void} redraw
315
367
  */
@@ -383,6 +435,7 @@ export class Engine {
383
435
  return ret;
384
436
  }
385
437
  /**
438
+ * Removes batch `key` of an extrusion layer (nothing if there is none)
386
439
  * @param {number} id
387
440
  * @param {number} key
388
441
  */
@@ -390,12 +443,15 @@ export class Engine {
390
443
  wasm.engine_removeExtrusionBatch(this.__wbg_ptr, id, key);
391
444
  }
392
445
  /**
446
+ * Removes a layer and frees its GPU objects; the other layers forget it (a layer that referred to it)
393
447
  * @param {number} id
394
448
  */
395
449
  removeLayer(id) {
396
450
  wasm.engine_removeLayer(this.__wbg_ptr, id);
397
451
  }
398
452
  /**
453
+ * Draws a frame: the backdrop, the ground and the layers over it bottom to top, then the panorama and the
454
+ * viewshed; returns true while tiles are still loading (a new frame will be asked through `redraw`)
399
455
  * @returns {boolean}
400
456
  */
401
457
  render() {
@@ -446,6 +502,7 @@ export class Engine {
446
502
  wasm.engine_setAtmosphere(this.__wbg_ptr, ptr0, len0);
447
503
  }
448
504
  /**
505
+ * Color the canvas is cleared to (RGB 0-1), where neither ground nor sky is drawn
449
506
  * @param {number} r
450
507
  * @param {number} g
451
508
  * @param {number} b
@@ -471,6 +528,8 @@ export class Engine {
471
528
  wasm.engine_setBody(this.__wbg_ptr, radius, flattening, ptr0, len0, lowest, highest);
472
529
  }
473
530
  /**
531
+ * Sets the camera (degrees, the conventions of `MapLibre`): leaves a street-level view, and the camera keeps this
532
+ * center as the relief comes in
474
533
  * @param {number} lon
475
534
  * @param {number} lat
476
535
  * @param {number} zoom
@@ -503,6 +562,11 @@ export class Engine {
503
562
  }
504
563
  /**
505
564
  * Anchors of batch `key` on the linked network: per feature, node A, node B, cost from A, cost from B
565
+ *
566
+ * # Errors
567
+ *
568
+ * Throws (to JavaScript) when the batch's features need an anchor texture past the GPU's
569
+ * `MAX_TEXTURE_SIZE`, or when it cannot be created
506
570
  * @param {number} id
507
571
  * @param {number} key
508
572
  * @param {Float32Array} anchors
@@ -518,6 +582,11 @@ export class Engine {
518
582
  /**
519
583
  * Adds or replaces batch `key` of an extrusion layer: polygons as for `addFills`, `feature_count` features (the
520
584
  * feature style gives each its height and base height as its two sizes, metres)
585
+ *
586
+ * # Errors
587
+ *
588
+ * Throws (to JavaScript) when a WebGL buffer or vertex array of the batch cannot be created, or when
589
+ * `feature_count` features need a table texture past the GPU's `MAX_TEXTURE_SIZE`
521
590
  * @param {number} id
522
591
  * @param {number} key
523
592
  * @param {Float64Array} points
@@ -654,6 +723,10 @@ export class Engine {
654
723
  /**
655
724
  * The glyph atlas shared by the symbol layers, one page: `width` × `height` bytes of signed distances
656
725
  * (allocated again, filled with `data` if given)
726
+ *
727
+ * # Errors
728
+ *
729
+ * Throws (to JavaScript) as `setGlyphPages` does: a size that is not positive, or the texture not created
657
730
  * @param {number} width
658
731
  * @param {number} height
659
732
  * @param {Uint8Array | null} [data]
@@ -670,6 +743,11 @@ export class Engine {
670
743
  * The glyph atlas shared by the symbol layers, `pages` pages of `width` × `height` bytes of signed distances,
671
744
  * allocated again and empty (`updateGlyphPage` fills them). A glyph on page `p` at row `v` has the atlas
672
745
  * coordinate `v + p × height`
746
+ *
747
+ * # Errors
748
+ *
749
+ * Throws (to JavaScript) when `width` or `height` is not positive (or their product overflows), `pages`
750
+ * is not 1 to 256, or the atlas texture cannot be created
673
751
  * @param {number} width
674
752
  * @param {number} height
675
753
  * @param {number} pages
@@ -681,6 +759,7 @@ export class Engine {
681
759
  }
682
760
  }
683
761
  /**
762
+ * Moves the Mercator box (0-1) a ground layer shows in
684
763
  * @param {number} id
685
764
  * @param {number} min_x
686
765
  * @param {number} min_y
@@ -694,6 +773,11 @@ export class Engine {
694
773
  * Creates the texture of sampler `name` (`format`: r8, r8ui, r16ui, r16i, r32ui, r32f, rg16ui, rg32f, rgba8,
695
774
  * rgba8ui, rgba16ui, rgba32f; `depth` 0 for 2D, else a 2D array of that many layers; `linear` filtering for the
696
775
  * non-integer formats); `data`: its texels as bytes, or undefined for an empty texture
776
+ *
777
+ * # Errors
778
+ *
779
+ * Throws (to JavaScript) on an unknown `format`, a size not positive (or overflowing), `data` shorter
780
+ * than the texels, more textures than the layer takes, or a texture WebGL cannot create
697
781
  * @param {number} id
698
782
  * @param {string} name
699
783
  * @param {string} format
@@ -717,6 +801,11 @@ export class Engine {
717
801
  }
718
802
  /**
719
803
  * A uniform of a ground layer's code, as numbers
804
+ *
805
+ * # Errors
806
+ *
807
+ * Throws (to JavaScript) when the shader has no uniform `name` (one its code does not use is removed
808
+ * by the compiler)
720
809
  * @param {number} id
721
810
  * @param {string} name
722
811
  * @param {Float64Array} values
@@ -732,6 +821,7 @@ export class Engine {
732
821
  }
733
822
  }
734
823
  /**
824
+ * Shows or hides a ground layer (kept, with its uniforms and textures)
735
825
  * @param {number} id
736
826
  * @param {boolean} visible
737
827
  */
@@ -741,6 +831,11 @@ export class Engine {
741
831
  /**
742
832
  * The icon atlas shared by the symbol layers: `width` × `height` RGBA texels, premultiplied, allocated again
743
833
  * and empty (`updateIconAtlas` fills it)
834
+ *
835
+ * # Errors
836
+ *
837
+ * Throws (to JavaScript) when `width` or `height` is not positive (or their product overflows), or the
838
+ * atlas texture cannot be created
744
839
  * @param {number} width
745
840
  * @param {number} height
746
841
  */
@@ -769,6 +864,11 @@ export class Engine {
769
864
  }
770
865
  /**
771
866
  * New lines for a line layer (same arguments as `addLines`, the same features)
867
+ *
868
+ * # Errors
869
+ *
870
+ * Throws (to JavaScript) when the lines need a table texture past the GPU's `MAX_TEXTURE_SIZE`, or
871
+ * when it cannot be created; the layer then keeps its lines
772
872
  * @param {number} id
773
873
  * @param {Float64Array} points
774
874
  * @param {Uint32Array} start
@@ -846,6 +946,7 @@ export class Engine {
846
946
  wasm.engine_setNetworkValues(this.__wbg_ptr, id, ptr0, len0);
847
947
  }
848
948
  /**
949
+ * Opacity and saturation (0-1) of a raster layer; nothing for another id
849
950
  * @param {number} id
850
951
  * @param {number} opacity
851
952
  * @param {number} saturation
@@ -909,6 +1010,11 @@ export class Engine {
909
1010
  * Labels of a symbol layer, shaped by the page: anchors (Mercator, interleaved), their texts' boxes (min x, min y,
910
1011
  * max x, max y, CSS pixels from the anchor), styles (36 floats each, see `LABEL_FLOATS`) and glyph and icon quads
911
1012
  * (11 floats each, see `QUAD_FLOATS`)
1013
+ *
1014
+ * # Errors
1015
+ *
1016
+ * Throws (to JavaScript) when the labels need a table texture past the GPU's `MAX_TEXTURE_SIZE`, or
1017
+ * when it cannot be created; the layer then keeps its labels
912
1018
  * @param {number} id
913
1019
  * @param {Float64Array} anchors
914
1020
  * @param {Float32Array} boxes
@@ -938,6 +1044,10 @@ export class Engine {
938
1044
  * above the ellipsoid, those of 3D Tiles; over France, on the Earth only), else left as served (the default);
939
1045
  * `loader`: gives the
940
1046
  * altitudes of each tile instead of fetching `url` (an encoding decoded by the page: Terrarium, Terrain-RGB)
1047
+ *
1048
+ * # Errors
1049
+ *
1050
+ * Throws (to JavaScript) when the texture holding the relief's tiles cannot be created
941
1051
  * @param {string | null | undefined} url
942
1052
  * @param {number} exaggeration
943
1053
  * @param {number | null | undefined} max_z
@@ -958,6 +1068,11 @@ export class Engine {
958
1068
  * only heading, tilt, angles of view across and up (degrees), the heading NaN to look all around. What some
959
1069
  * observer sees is tinted with `visible`, what is hidden from all those that reach it with `hidden` (RGB 0-1),
960
1070
  * at `opacity`; `outline` (RGB 0-1, or empty) the color of the cones' edges drawn in 3D
1071
+ *
1072
+ * # Errors
1073
+ *
1074
+ * Throws (to JavaScript) when, on the first call, a WebGL object cannot be created or a shader fails to compile
1075
+ * (the error carries its info log)
961
1076
  * @param {Float64Array} observers
962
1077
  * @param {Float32Array} visible
963
1078
  * @param {Float32Array} hidden
@@ -979,6 +1094,7 @@ export class Engine {
979
1094
  }
980
1095
  }
981
1096
  /**
1097
+ * Lowest and highest zoom levels the camera accepts
982
1098
  * @param {number} min
983
1099
  * @param {number} max
984
1100
  */
@@ -1046,6 +1162,11 @@ export class Engine {
1046
1162
  }
1047
1163
  /**
1048
1164
  * Replaces a region of a ground layer's texture (one layer of a 2D array)
1165
+ *
1166
+ * # Errors
1167
+ *
1168
+ * Throws (to JavaScript) when there is no texture `name`, or when the region is out of its bounds or
1169
+ * `data` holds too few bytes
1049
1170
  * @param {number} id
1050
1171
  * @param {string} name
1051
1172
  * @param {number} x
@@ -1091,6 +1212,7 @@ export class Engine {
1091
1212
  return v1;
1092
1213
  }
1093
1214
  /**
1215
+ * Zooms by `delta` levels around a screen point (CSS pixels), which keeps the same ground point under it
1094
1216
  * @param {number} delta
1095
1217
  * @param {number} x
1096
1218
  * @param {number} y