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.
- package/CHANGELOG.md +121 -0
- package/README.md +44 -39
- package/dist/basemap/basemaps.d.ts +1 -1
- package/dist/basemap/basemaps.js +2 -2
- package/dist/basemap/basemaps.js.map +1 -1
- package/dist/basemap/grid.d.ts +5 -5
- package/dist/basemap/grid.js +59 -65
- package/dist/basemap/grid.js.map +1 -1
- package/dist/basemap/mvt.d.ts +1 -1
- package/dist/basemap/mvt.js +6 -6
- package/dist/basemap/mvt.js.map +1 -1
- package/dist/basemap/pmtiles.d.ts +10 -10
- package/dist/basemap/pmtiles.js +39 -31
- package/dist/basemap/pmtiles.js.map +1 -1
- package/dist/basemap/pmtileslayer.d.ts +33 -0
- package/dist/basemap/pmtileslayer.js +97 -0
- package/dist/basemap/pmtileslayer.js.map +1 -0
- package/dist/basemap/resample.d.ts +2 -2
- package/dist/basemap/resample.js +16 -14
- package/dist/basemap/resample.js.map +1 -1
- package/dist/basemap/terrain.d.ts +3 -3
- package/dist/basemap/terrain.js +6 -6
- package/dist/basemap/terrain.js.map +1 -1
- package/dist/basemap/trees.d.ts +26 -0
- package/dist/basemap/trees.js +141 -0
- package/dist/basemap/trees.js.map +1 -0
- package/dist/basemap/vectorstyle.d.ts +22 -10
- package/dist/basemap/vectorstyle.js +163 -110
- package/dist/basemap/vectorstyle.js.map +1 -1
- package/dist/basemap/vectortiles.d.ts +70 -47
- package/dist/basemap/vectortiles.js +480 -358
- package/dist/basemap/vectortiles.js.map +1 -1
- package/dist/basemap/wmts.d.ts +3 -3
- package/dist/basemap/wmts.js +16 -11
- package/dist/basemap/wmts.js.map +1 -1
- package/dist/basemap/workerpool.d.ts +17 -0
- package/dist/basemap/workerpool.js +194 -0
- package/dist/basemap/workerpool.js.map +1 -0
- package/dist/basemap.worker.js +2 -2
- package/dist/basemap.worker.js.map +21 -13
- package/dist/bind/layers.d.ts +13 -4
- package/dist/bind/layers.js +64 -40
- package/dist/bind/layers.js.map +1 -1
- package/dist/data/crs.d.ts +10 -10
- package/dist/data/crs.js +38 -34
- package/dist/data/crs.js.map +1 -1
- package/dist/data/gpx.d.ts +1 -1
- package/dist/data/gpx.js +20 -20
- package/dist/data/gpx.js.map +1 -1
- package/dist/data/kml.d.ts +1 -1
- package/dist/data/kml.js +42 -39
- package/dist/data/kml.js.map +1 -1
- package/dist/data/topojson.d.ts +1 -1
- package/dist/data/topojson.js +15 -10
- package/dist/data/topojson.js.map +1 -1
- package/dist/data/xml.d.ts +5 -5
- package/dist/data/xml.js +19 -18
- package/dist/data/xml.js.map +1 -1
- package/dist/decoder.worker.js +4 -4
- package/dist/decoder.worker.js.map +6 -6
- package/dist/engine/decoders.d.ts +2 -2
- package/dist/engine/decoders.js +28 -25
- package/dist/engine/decoders.js.map +1 -1
- package/dist/engine/loader.js +13 -14
- package/dist/engine/loader.js.map +1 -1
- package/dist/engine/requests.d.ts +1 -1
- package/dist/engine/requests.js +19 -16
- package/dist/engine/requests.js.map +1 -1
- package/dist/engine-loader.d.ts +13 -9
- package/dist/engine-loader.js +38 -28
- package/dist/engine-loader.js.map +1 -1
- package/dist/geoplateforme.d.ts +26 -10
- package/dist/geoplateforme.js +45 -20
- package/dist/geoplateforme.js.map +1 -1
- package/dist/index.d.ts +12 -4
- package/dist/index.js +9 -2
- package/dist/index.js.map +1 -1
- package/dist/isard_bg.wasm +0 -0
- package/dist/isard_core_bg.wasm +0 -0
- package/dist/isard_points_bg.wasm +0 -0
- package/dist/isard_tess_bg.wasm +0 -0
- package/dist/layers/extrusions.d.ts +1 -1
- package/dist/layers/extrusions.js +10 -5
- package/dist/layers/extrusions.js.map +1 -1
- package/dist/layers/features.d.ts +10 -10
- package/dist/layers/features.js +41 -42
- package/dist/layers/features.js.map +1 -1
- package/dist/layers/glyphs.d.ts +3 -3
- package/dist/layers/glyphs.js +34 -40
- package/dist/layers/glyphs.js.map +1 -1
- package/dist/layers/icons.d.ts +8 -8
- package/dist/layers/icons.js +76 -68
- package/dist/layers/icons.js.map +1 -1
- package/dist/layers/layers.d.ts +1 -1
- package/dist/layers/layers.js +42 -29
- package/dist/layers/layers.js.map +1 -1
- package/dist/layers/panoramas.d.ts +2 -2
- package/dist/layers/panoramas.js +52 -41
- package/dist/layers/panoramas.js.map +1 -1
- package/dist/layers/pointclouds.d.ts +3 -3
- package/dist/layers/pointclouds.js +25 -33
- package/dist/layers/pointclouds.js.map +1 -1
- package/dist/layers/symbols.d.ts +1 -1
- package/dist/layers/symbols.js +68 -71
- package/dist/layers/symbols.js.map +1 -1
- package/dist/layers/vectors.d.ts +60 -0
- package/dist/layers/vectors.js +130 -0
- package/dist/layers/vectors.js.map +1 -0
- package/dist/map/basemap-layers.d.ts +26 -0
- package/dist/map/basemap-layers.js +61 -0
- package/dist/map/basemap-layers.js.map +1 -0
- package/dist/map/canvas.d.ts +17 -0
- package/dist/map/canvas.js +56 -0
- package/dist/map/canvas.js.map +1 -0
- package/dist/map/checks.d.ts +11 -0
- package/dist/map/checks.js +39 -0
- package/dist/map/checks.js.map +1 -0
- package/dist/map/credits.d.ts +17 -0
- package/dist/map/credits.js +34 -0
- package/dist/map/credits.js.map +1 -0
- package/dist/map/engine-settings.d.ts +15 -0
- package/dist/map/engine-settings.js +45 -0
- package/dist/map/engine-settings.js.map +1 -0
- package/dist/map/engines.d.ts +41 -0
- package/dist/map/engines.js +77 -0
- package/dist/map/engines.js.map +1 -0
- package/dist/map/events.d.ts +14 -0
- package/dist/map/events.js +46 -0
- package/dist/map/events.js.map +1 -0
- package/dist/map/frame-loop.d.ts +64 -0
- package/dist/map/frame-loop.js +145 -0
- package/dist/map/frame-loop.js.map +1 -0
- package/dist/map/hover-pick.d.ts +30 -0
- package/dist/map/hover-pick.js +56 -0
- package/dist/map/hover-pick.js.map +1 -0
- package/dist/map/layer-spec.d.ts +42 -0
- package/dist/map/layer-spec.js +34 -0
- package/dist/map/layer-spec.js.map +1 -0
- package/dist/map/layer-stack.d.ts +36 -0
- package/dist/map/layer-stack.js +101 -0
- package/dist/map/layer-stack.js.map +1 -0
- package/dist/map/overlay-host.d.ts +36 -0
- package/dist/map/overlay-host.js +101 -0
- package/dist/map/overlay-host.js.map +1 -0
- package/dist/map/panorama-host.d.ts +5 -0
- package/dist/map/panorama-host.js +32 -0
- package/dist/map/panorama-host.js.map +1 -0
- package/dist/map/raster-source.d.ts +11 -0
- package/dist/map/raster-source.js +26 -0
- package/dist/map/raster-source.js.map +1 -0
- package/dist/map/symbol-atlases.d.ts +26 -0
- package/dist/map/symbol-atlases.js +59 -0
- package/dist/map/symbol-atlases.js.map +1 -0
- package/dist/map/viewshed.d.ts +5 -0
- package/dist/map/viewshed.js +28 -0
- package/dist/map/viewshed.js.map +1 -0
- package/dist/map/workers.d.ts +46 -0
- package/dist/map/workers.js +73 -0
- package/dist/map/workers.js.map +1 -0
- package/dist/map.d.ts +54 -126
- package/dist/map.js +227 -698
- package/dist/map.js.map +1 -1
- package/dist/react/Control.d.ts +11 -0
- package/dist/react/Control.js +18 -0
- package/dist/react/Control.js.map +1 -0
- package/dist/react/CustomLayer.d.ts +11 -0
- package/dist/react/CustomLayer.js +30 -0
- package/dist/react/CustomLayer.js.map +1 -0
- package/dist/react/IsardMap.d.ts +43 -0
- package/dist/react/IsardMap.js +147 -0
- package/dist/react/IsardMap.js.map +1 -0
- package/dist/react/Layer.d.ts +42 -0
- package/dist/react/Layer.js +74 -0
- package/dist/react/Layer.js.map +1 -0
- package/dist/react/Marker.d.ts +24 -0
- package/dist/react/Marker.js +53 -0
- package/dist/react/Marker.js.map +1 -0
- package/dist/react/Panel.d.ts +11 -0
- package/dist/react/Panel.js +37 -0
- package/dist/react/Panel.js.map +1 -0
- package/dist/react/Popup.d.ts +18 -0
- package/dist/react/Popup.js +60 -0
- package/dist/react/Popup.js.map +1 -0
- package/dist/react/Swipe.d.ts +16 -0
- package/dist/react/Swipe.js +52 -0
- package/dist/react/Swipe.js.map +1 -0
- package/dist/react/VectorGeometry.d.ts +35 -0
- package/dist/react/VectorGeometry.js +82 -0
- package/dist/react/VectorGeometry.js.map +1 -0
- package/dist/react/Viewshed.d.ts +5 -0
- package/dist/react/Viewshed.js +28 -0
- package/dist/react/Viewshed.js.map +1 -0
- package/dist/react/context.d.ts +33 -0
- package/dist/react/context.js +20 -0
- package/dist/react/context.js.map +1 -0
- package/dist/react/index.d.ts +16 -108
- package/dist/react/index.js +11 -397
- package/dist/react/index.js.map +1 -1
- package/dist/settings.d.ts +5 -9
- package/dist/settings.js +17 -15
- package/dist/settings.js.map +1 -1
- package/dist/types.d.ts +27 -4
- package/dist/types.js.map +1 -1
- package/dist/ui/controls.js +6 -4
- package/dist/ui/controls.js.map +1 -1
- package/dist/ui/interaction.d.ts +2 -2
- package/dist/ui/interaction.js +8 -7
- package/dist/ui/interaction.js.map +1 -1
- package/dist/ui/minimap.d.ts +25 -0
- package/dist/ui/minimap.js +90 -0
- package/dist/ui/minimap.js.map +1 -0
- package/dist/ui/overlay.js +18 -20
- package/dist/ui/overlay.js.map +1 -1
- package/dist/ui/scale.d.ts +19 -0
- package/dist/ui/scale.js +44 -0
- package/dist/ui/scale.js.map +1 -0
- package/dist/ui/search.d.ts +25 -0
- package/dist/ui/search.js +119 -0
- package/dist/ui/search.js.map +1 -0
- package/dist/ui/style.d.ts +1 -1
- package/dist/ui/style.js +19 -2
- package/dist/ui/style.js.map +1 -1
- package/dist/util/animation.d.ts +3 -3
- package/dist/util/animation.js +6 -6
- package/dist/util/animation.js.map +1 -1
- package/dist/util/color.d.ts +1 -1
- package/dist/util/color.js +14 -16
- package/dist/util/color.js.map +1 -1
- package/dist/util/geo.d.ts +6 -6
- package/dist/util/geo.js +12 -12
- package/dist/util/geo.js.map +1 -1
- package/dist/util/guards.d.ts +7 -0
- package/dist/util/guards.js +8 -0
- package/dist/util/guards.js.map +1 -0
- package/dist/util/lru.js.map +1 -1
- package/dist/util/sun.d.ts +11 -0
- package/dist/util/sun.js +26 -0
- package/dist/util/sun.js.map +1 -0
- package/dist/wasm/isard.d.ts +250 -7
- package/dist/wasm/isard.js +375 -8
- package/dist/wasm/isard_core.d.ts +226 -7
- package/dist/wasm/isard_core.js +351 -8
- package/dist/wasm/isard_tess.d.ts +109 -0
- package/dist/wasm/isard_tess.js +398 -0
- package/dist/workers/basemap/geometry.d.ts +72 -0
- package/dist/workers/basemap/labels.d.ts +8 -0
- package/dist/workers/basemap/raster.d.ts +10 -0
- package/dist/workers/basemap/tiles.d.ts +65 -0
- package/dist/workers/basemap/trees.d.ts +19 -0
- package/dist/workers/basemap.worker.d.ts +126 -22
- package/dist/workers/basemap.worker.js +76 -544
- package/dist/workers/basemap.worker.js.map +1 -1
- package/package.json +5 -4
- package/vite.js +10 -2
package/dist/wasm/isard_core.js
CHANGED
|
@@ -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() {
|
|
@@ -188,6 +231,22 @@ export class Engine {
|
|
|
188
231
|
}
|
|
189
232
|
return ret[0] >>> 0;
|
|
190
233
|
}
|
|
234
|
+
/**
|
|
235
|
+
* An empty layer of vector tiles drawn as geometry: its style layers come with `setVectorSublayers`, its tiles
|
|
236
|
+
* with `setVectorTile`
|
|
237
|
+
*
|
|
238
|
+
* # Errors
|
|
239
|
+
*
|
|
240
|
+
* Throws (to JavaScript) when a shader fails to compile (the error carries its info log)
|
|
241
|
+
* @returns {number}
|
|
242
|
+
*/
|
|
243
|
+
addVectorTiles() {
|
|
244
|
+
const ret = wasm.engine_addVectorTiles(this.__wbg_ptr);
|
|
245
|
+
if (ret[2]) {
|
|
246
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
247
|
+
}
|
|
248
|
+
return ret[0] >>> 0;
|
|
249
|
+
}
|
|
191
250
|
/**
|
|
192
251
|
* Longitudes and latitudes the view covers on the ground, `[west, south, east, north]` (degrees): the screen's
|
|
193
252
|
* border cast on the ground, or on the far plane where it passes the horizon
|
|
@@ -200,12 +259,16 @@ export class Engine {
|
|
|
200
259
|
return v1;
|
|
201
260
|
}
|
|
202
261
|
/**
|
|
262
|
+
* The camera as set or moved: center (degrees), zoom, pitch and bearing (degrees)
|
|
203
263
|
* @returns {Camera}
|
|
204
264
|
*/
|
|
205
265
|
camera() {
|
|
206
266
|
const ret = wasm.engine_camera(this.__wbg_ptr);
|
|
207
267
|
return ret;
|
|
208
268
|
}
|
|
269
|
+
/**
|
|
270
|
+
* Stops loading the tiles of the flight's destination (`preload`)
|
|
271
|
+
*/
|
|
209
272
|
clearPreload() {
|
|
210
273
|
wasm.engine_clearPreload(this.__wbg_ptr);
|
|
211
274
|
}
|
|
@@ -310,6 +373,11 @@ export class Engine {
|
|
|
310
373
|
}
|
|
311
374
|
/**
|
|
312
375
|
* `redraw` is called when the engine needs a new frame (a tile arrived)
|
|
376
|
+
*
|
|
377
|
+
* # Errors
|
|
378
|
+
*
|
|
379
|
+
* Throws (to JavaScript) when the canvas gives no WebGL2 context ("WebGL2 is not available"), or when a WebGL
|
|
380
|
+
* object of the globe, the sky or the raster pass cannot be created or one of their shaders fails to compile
|
|
313
381
|
* @param {HTMLCanvasElement} canvas
|
|
314
382
|
* @param {() => void} redraw
|
|
315
383
|
*/
|
|
@@ -383,6 +451,7 @@ export class Engine {
|
|
|
383
451
|
return ret;
|
|
384
452
|
}
|
|
385
453
|
/**
|
|
454
|
+
* Removes batch `key` of an extrusion layer (nothing if there is none)
|
|
386
455
|
* @param {number} id
|
|
387
456
|
* @param {number} key
|
|
388
457
|
*/
|
|
@@ -390,12 +459,23 @@ export class Engine {
|
|
|
390
459
|
wasm.engine_removeExtrusionBatch(this.__wbg_ptr, id, key);
|
|
391
460
|
}
|
|
392
461
|
/**
|
|
462
|
+
* Removes a layer and frees its GPU objects; the other layers forget it (a layer that referred to it)
|
|
393
463
|
* @param {number} id
|
|
394
464
|
*/
|
|
395
465
|
removeLayer(id) {
|
|
396
466
|
wasm.engine_removeLayer(this.__wbg_ptr, id);
|
|
397
467
|
}
|
|
398
468
|
/**
|
|
469
|
+
* Removes tile `key` of a vector tile layer (nothing if there is none)
|
|
470
|
+
* @param {number} id
|
|
471
|
+
* @param {number} key
|
|
472
|
+
*/
|
|
473
|
+
removeVectorTile(id, key) {
|
|
474
|
+
wasm.engine_removeVectorTile(this.__wbg_ptr, id, key);
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* Draws a frame: the backdrop, the ground and the layers over it bottom to top, then the panorama and the
|
|
478
|
+
* viewshed; returns true while tiles are still loading (a new frame will be asked through `redraw`)
|
|
399
479
|
* @returns {boolean}
|
|
400
480
|
*/
|
|
401
481
|
render() {
|
|
@@ -446,6 +526,7 @@ export class Engine {
|
|
|
446
526
|
wasm.engine_setAtmosphere(this.__wbg_ptr, ptr0, len0);
|
|
447
527
|
}
|
|
448
528
|
/**
|
|
529
|
+
* Color the canvas is cleared to (RGB 0-1), where neither ground nor sky is drawn
|
|
449
530
|
* @param {number} r
|
|
450
531
|
* @param {number} g
|
|
451
532
|
* @param {number} b
|
|
@@ -471,6 +552,8 @@ export class Engine {
|
|
|
471
552
|
wasm.engine_setBody(this.__wbg_ptr, radius, flattening, ptr0, len0, lowest, highest);
|
|
472
553
|
}
|
|
473
554
|
/**
|
|
555
|
+
* Sets the camera (degrees, the conventions of `MapLibre`): leaves a street-level view, and the camera keeps this
|
|
556
|
+
* center as the relief comes in
|
|
474
557
|
* @param {number} lon
|
|
475
558
|
* @param {number} lat
|
|
476
559
|
* @param {number} zoom
|
|
@@ -503,6 +586,11 @@ export class Engine {
|
|
|
503
586
|
}
|
|
504
587
|
/**
|
|
505
588
|
* Anchors of batch `key` on the linked network: per feature, node A, node B, cost from A, cost from B
|
|
589
|
+
*
|
|
590
|
+
* # Errors
|
|
591
|
+
*
|
|
592
|
+
* Throws (to JavaScript) when the batch's features need an anchor texture past the GPU's
|
|
593
|
+
* `MAX_TEXTURE_SIZE`, or when it cannot be created
|
|
506
594
|
* @param {number} id
|
|
507
595
|
* @param {number} key
|
|
508
596
|
* @param {Float32Array} anchors
|
|
@@ -518,6 +606,11 @@ export class Engine {
|
|
|
518
606
|
/**
|
|
519
607
|
* Adds or replaces batch `key` of an extrusion layer: polygons as for `addFills`, `feature_count` features (the
|
|
520
608
|
* feature style gives each its height and base height as its two sizes, metres)
|
|
609
|
+
*
|
|
610
|
+
* # Errors
|
|
611
|
+
*
|
|
612
|
+
* Throws (to JavaScript) when a WebGL buffer or vertex array of the batch cannot be created, or when
|
|
613
|
+
* `feature_count` features need a table texture past the GPU's `MAX_TEXTURE_SIZE`
|
|
521
614
|
* @param {number} id
|
|
522
615
|
* @param {number} key
|
|
523
616
|
* @param {Float64Array} points
|
|
@@ -578,10 +671,10 @@ export class Engine {
|
|
|
578
671
|
wasm.engine_setFeatureRamp(this.__wbg_ptr, id, ptr0, len0, min, max);
|
|
579
672
|
}
|
|
580
673
|
/**
|
|
581
|
-
* Style of the features of a line, circle, fill or
|
|
582
|
-
* feature, its color (RGBA 0-1), its second color (a circle's stroke), then two sizes as zoom
|
|
583
|
-
* four values each): a line's width; a circle's radius and stroke width, CSS pixels; a block's
|
|
584
|
-
* height, metres
|
|
674
|
+
* Style of the features of a line, circle, fill, extrusion or vector tile layer (batch or tile `key` of the last
|
|
675
|
+
* two): 32 floats per feature, its color (RGBA 0-1), its second color (a circle's stroke), then two sizes as zoom
|
|
676
|
+
* stops (four zooms, four values each): a line's width; a circle's radius and stroke width, CSS pixels; a block's
|
|
677
|
+
* height and base height, metres
|
|
585
678
|
* @param {number} id
|
|
586
679
|
* @param {Float32Array} style
|
|
587
680
|
* @param {number | null} [key]
|
|
@@ -654,6 +747,10 @@ export class Engine {
|
|
|
654
747
|
/**
|
|
655
748
|
* The glyph atlas shared by the symbol layers, one page: `width` × `height` bytes of signed distances
|
|
656
749
|
* (allocated again, filled with `data` if given)
|
|
750
|
+
*
|
|
751
|
+
* # Errors
|
|
752
|
+
*
|
|
753
|
+
* Throws (to JavaScript) as `setGlyphPages` does: a size that is not positive, or the texture not created
|
|
657
754
|
* @param {number} width
|
|
658
755
|
* @param {number} height
|
|
659
756
|
* @param {Uint8Array | null} [data]
|
|
@@ -670,6 +767,11 @@ export class Engine {
|
|
|
670
767
|
* The glyph atlas shared by the symbol layers, `pages` pages of `width` × `height` bytes of signed distances,
|
|
671
768
|
* allocated again and empty (`updateGlyphPage` fills them). A glyph on page `p` at row `v` has the atlas
|
|
672
769
|
* coordinate `v + p × height`
|
|
770
|
+
*
|
|
771
|
+
* # Errors
|
|
772
|
+
*
|
|
773
|
+
* Throws (to JavaScript) when `width` or `height` is not positive (or their product overflows), `pages`
|
|
774
|
+
* is not 1 to 256, or the atlas texture cannot be created
|
|
673
775
|
* @param {number} width
|
|
674
776
|
* @param {number} height
|
|
675
777
|
* @param {number} pages
|
|
@@ -681,6 +783,7 @@ export class Engine {
|
|
|
681
783
|
}
|
|
682
784
|
}
|
|
683
785
|
/**
|
|
786
|
+
* Moves the Mercator box (0-1) a ground layer shows in
|
|
684
787
|
* @param {number} id
|
|
685
788
|
* @param {number} min_x
|
|
686
789
|
* @param {number} min_y
|
|
@@ -694,6 +797,11 @@ export class Engine {
|
|
|
694
797
|
* Creates the texture of sampler `name` (`format`: r8, r8ui, r16ui, r16i, r32ui, r32f, rg16ui, rg32f, rgba8,
|
|
695
798
|
* rgba8ui, rgba16ui, rgba32f; `depth` 0 for 2D, else a 2D array of that many layers; `linear` filtering for the
|
|
696
799
|
* non-integer formats); `data`: its texels as bytes, or undefined for an empty texture
|
|
800
|
+
*
|
|
801
|
+
* # Errors
|
|
802
|
+
*
|
|
803
|
+
* Throws (to JavaScript) on an unknown `format`, a size not positive (or overflowing), `data` shorter
|
|
804
|
+
* than the texels, more textures than the layer takes, or a texture WebGL cannot create
|
|
697
805
|
* @param {number} id
|
|
698
806
|
* @param {string} name
|
|
699
807
|
* @param {string} format
|
|
@@ -717,6 +825,11 @@ export class Engine {
|
|
|
717
825
|
}
|
|
718
826
|
/**
|
|
719
827
|
* A uniform of a ground layer's code, as numbers
|
|
828
|
+
*
|
|
829
|
+
* # Errors
|
|
830
|
+
*
|
|
831
|
+
* Throws (to JavaScript) when the shader has no uniform `name` (one its code does not use is removed
|
|
832
|
+
* by the compiler)
|
|
720
833
|
* @param {number} id
|
|
721
834
|
* @param {string} name
|
|
722
835
|
* @param {Float64Array} values
|
|
@@ -732,6 +845,7 @@ export class Engine {
|
|
|
732
845
|
}
|
|
733
846
|
}
|
|
734
847
|
/**
|
|
848
|
+
* Shows or hides a ground layer (kept, with its uniforms and textures)
|
|
735
849
|
* @param {number} id
|
|
736
850
|
* @param {boolean} visible
|
|
737
851
|
*/
|
|
@@ -741,6 +855,11 @@ export class Engine {
|
|
|
741
855
|
/**
|
|
742
856
|
* The icon atlas shared by the symbol layers: `width` × `height` RGBA texels, premultiplied, allocated again
|
|
743
857
|
* and empty (`updateIconAtlas` fills it)
|
|
858
|
+
*
|
|
859
|
+
* # Errors
|
|
860
|
+
*
|
|
861
|
+
* Throws (to JavaScript) when `width` or `height` is not positive (or their product overflows), or the
|
|
862
|
+
* atlas texture cannot be created
|
|
744
863
|
* @param {number} width
|
|
745
864
|
* @param {number} height
|
|
746
865
|
*/
|
|
@@ -769,6 +888,11 @@ export class Engine {
|
|
|
769
888
|
}
|
|
770
889
|
/**
|
|
771
890
|
* New lines for a line layer (same arguments as `addLines`, the same features)
|
|
891
|
+
*
|
|
892
|
+
* # Errors
|
|
893
|
+
*
|
|
894
|
+
* Throws (to JavaScript) when the lines need a table texture past the GPU's `MAX_TEXTURE_SIZE`, or
|
|
895
|
+
* when it cannot be created; the layer then keeps its lines
|
|
772
896
|
* @param {number} id
|
|
773
897
|
* @param {Float64Array} points
|
|
774
898
|
* @param {Uint32Array} start
|
|
@@ -846,6 +970,7 @@ export class Engine {
|
|
|
846
970
|
wasm.engine_setNetworkValues(this.__wbg_ptr, id, ptr0, len0);
|
|
847
971
|
}
|
|
848
972
|
/**
|
|
973
|
+
* Opacity and saturation (0-1) of a raster layer; nothing for another id
|
|
849
974
|
* @param {number} id
|
|
850
975
|
* @param {number} opacity
|
|
851
976
|
* @param {number} saturation
|
|
@@ -876,17 +1001,40 @@ export class Engine {
|
|
|
876
1001
|
setSky(enabled) {
|
|
877
1002
|
wasm.engine_setSky(this.__wbg_ptr, enabled);
|
|
878
1003
|
}
|
|
1004
|
+
/**
|
|
1005
|
+
* The sun casting shadows and the night: its azimuth (degrees clockwise from north) and altitude (degrees above
|
|
1006
|
+
* the horizon), the shadows' opacity (0 to 1; none under the horizon or not a number), how dark the night is (0 to
|
|
1007
|
+
* 1: the frame tinted, the lights of the layers on). Neither shadows nor night: nothing drawn
|
|
1008
|
+
*
|
|
1009
|
+
* # Errors
|
|
1010
|
+
*
|
|
1011
|
+
* Throws (to JavaScript) when a WebGL object cannot be created or the pass fails to compile
|
|
1012
|
+
* @param {number} azimuth
|
|
1013
|
+
* @param {number} altitude
|
|
1014
|
+
* @param {number} opacity
|
|
1015
|
+
* @param {number} night
|
|
1016
|
+
*/
|
|
1017
|
+
setSun(azimuth, altitude, opacity, night) {
|
|
1018
|
+
const ret = wasm.engine_setSun(this.__wbg_ptr, azimuth, altitude, opacity, night);
|
|
1019
|
+
if (ret[1]) {
|
|
1020
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
879
1023
|
/**
|
|
880
1024
|
* Shows `layers` on one side of a vertical line only, the others beneath on the other side (comparing two states
|
|
881
|
-
* of a place): left of `x` (CSS pixels from the left of the canvas), or right of it;
|
|
1025
|
+
* of a place): left of `x` (CSS pixels from the left of the canvas), or right of it; `others` on the other side
|
|
1026
|
+
* only (two meshes of the same place, each on its side, never drawn over each other); a non-finite `x` stops
|
|
882
1027
|
* @param {number} x
|
|
883
1028
|
* @param {boolean} right
|
|
884
1029
|
* @param {Uint32Array} layers
|
|
1030
|
+
* @param {Uint32Array} others
|
|
885
1031
|
*/
|
|
886
|
-
setSwipe(x, right, layers) {
|
|
1032
|
+
setSwipe(x, right, layers, others) {
|
|
887
1033
|
const ptr0 = passArray32ToWasm0(layers, wasm.__wbindgen_malloc);
|
|
888
1034
|
const len0 = WASM_VECTOR_LEN;
|
|
889
|
-
|
|
1035
|
+
const ptr1 = passArray32ToWasm0(others, wasm.__wbindgen_malloc);
|
|
1036
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1037
|
+
wasm.engine_setSwipe(this.__wbg_ptr, x, right, ptr0, len0, ptr1, len1);
|
|
890
1038
|
}
|
|
891
1039
|
/**
|
|
892
1040
|
* Layer-wide style of a symbol layer: size scale and opacity as zoom stops (four zooms then four values each),
|
|
@@ -909,6 +1057,11 @@ export class Engine {
|
|
|
909
1057
|
* Labels of a symbol layer, shaped by the page: anchors (Mercator, interleaved), their texts' boxes (min x, min y,
|
|
910
1058
|
* max x, max y, CSS pixels from the anchor), styles (36 floats each, see `LABEL_FLOATS`) and glyph and icon quads
|
|
911
1059
|
* (11 floats each, see `QUAD_FLOATS`)
|
|
1060
|
+
*
|
|
1061
|
+
* # Errors
|
|
1062
|
+
*
|
|
1063
|
+
* Throws (to JavaScript) when the labels need a table texture past the GPU's `MAX_TEXTURE_SIZE`, or
|
|
1064
|
+
* when it cannot be created; the layer then keeps its labels
|
|
912
1065
|
* @param {number} id
|
|
913
1066
|
* @param {Float64Array} anchors
|
|
914
1067
|
* @param {Float32Array} boxes
|
|
@@ -938,6 +1091,10 @@ export class Engine {
|
|
|
938
1091
|
* above the ellipsoid, those of 3D Tiles; over France, on the Earth only), else left as served (the default);
|
|
939
1092
|
* `loader`: gives the
|
|
940
1093
|
* altitudes of each tile instead of fetching `url` (an encoding decoded by the page: Terrarium, Terrain-RGB)
|
|
1094
|
+
*
|
|
1095
|
+
* # Errors
|
|
1096
|
+
*
|
|
1097
|
+
* Throws (to JavaScript) when the texture holding the relief's tiles cannot be created
|
|
941
1098
|
* @param {string | null | undefined} url
|
|
942
1099
|
* @param {number} exaggeration
|
|
943
1100
|
* @param {number | null | undefined} max_z
|
|
@@ -952,12 +1109,171 @@ export class Engine {
|
|
|
952
1109
|
throw takeFromExternrefTable0(ret[0]);
|
|
953
1110
|
}
|
|
954
1111
|
}
|
|
1112
|
+
/**
|
|
1113
|
+
* The style layers of a vector tile layer, in drawing order: per layer, its kind (0 fill, 1 line, 2 extrusion), its zoom range
|
|
1114
|
+
* (two numbers: shown from the first, included, to the second, excluded), whether it shows (0 or 1), its dashes
|
|
1115
|
+
* (four numbers: dash, gap, dash, gap, in line widths; 0: solid), its opacity as zoom stops (four zooms then four
|
|
1116
|
+
* values; missing: opaque), the caps of its lines' ends (0 butt, 1 round, 2 square; missing: round), whether its
|
|
1117
|
+
* lines glow at night (streets; 0 or 1)
|
|
1118
|
+
* @param {number} id
|
|
1119
|
+
* @param {Uint8Array} kinds
|
|
1120
|
+
* @param {Float64Array} zooms
|
|
1121
|
+
* @param {Uint8Array} visible
|
|
1122
|
+
* @param {Float32Array} dashes
|
|
1123
|
+
* @param {Float32Array} opacities
|
|
1124
|
+
* @param {Uint8Array} caps
|
|
1125
|
+
* @param {Uint8Array} lit
|
|
1126
|
+
*/
|
|
1127
|
+
setVectorSublayers(id, kinds, zooms, visible, dashes, opacities, caps, lit) {
|
|
1128
|
+
const ptr0 = passArray8ToWasm0(kinds, wasm.__wbindgen_malloc);
|
|
1129
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1130
|
+
const ptr1 = passArrayF64ToWasm0(zooms, wasm.__wbindgen_malloc);
|
|
1131
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1132
|
+
const ptr2 = passArray8ToWasm0(visible, wasm.__wbindgen_malloc);
|
|
1133
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1134
|
+
const ptr3 = passArrayF32ToWasm0(dashes, wasm.__wbindgen_malloc);
|
|
1135
|
+
const len3 = WASM_VECTOR_LEN;
|
|
1136
|
+
const ptr4 = passArrayF32ToWasm0(opacities, wasm.__wbindgen_malloc);
|
|
1137
|
+
const len4 = WASM_VECTOR_LEN;
|
|
1138
|
+
const ptr5 = passArray8ToWasm0(caps, wasm.__wbindgen_malloc);
|
|
1139
|
+
const len5 = WASM_VECTOR_LEN;
|
|
1140
|
+
const ptr6 = passArray8ToWasm0(lit, wasm.__wbindgen_malloc);
|
|
1141
|
+
const len6 = WASM_VECTOR_LEN;
|
|
1142
|
+
wasm.engine_setVectorSublayers(this.__wbg_ptr, id, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6);
|
|
1143
|
+
}
|
|
1144
|
+
/**
|
|
1145
|
+
* Adds or replaces tile `key` of a vector tile layer ready for the GPU, as the basemap workers make it (the
|
|
1146
|
+
* tessellation module): its polygons as for `setVectorTile` (picked here; their prisms built here if drawn in
|
|
1147
|
+
* relief while `prism` is false), the vertices of its fills (`shapes::Vertex` as bytes, each with its feature),
|
|
1148
|
+
* their triangles, per sublayer its top cap and the rest of its prism (`fill_ranges`: four numbers, first and
|
|
1149
|
+
* end of each), its line pieces (`pieces::Piece` as bytes), the line table (feature and length of each line),
|
|
1150
|
+
* per sublayer its pieces (`line_ranges`: first, end), the blocks of its extrusion sublayers (`shapes::Block` as
|
|
1151
|
+
* bytes), their triangles, per sublayer its blocks' triangles (`block_ranges`: first, end), the extent of its
|
|
1152
|
+
* points (`bounds`: min x, min y, max x, max y), `feature_count` features
|
|
1153
|
+
*
|
|
1154
|
+
* # Errors
|
|
1155
|
+
*
|
|
1156
|
+
* Throws (to JavaScript) when the vertices, pieces or blocks are cut short, when a WebGL object of the tile cannot be
|
|
1157
|
+
* created, or when its features or lines need a table texture past the GPU's `MAX_TEXTURE_SIZE`
|
|
1158
|
+
* @param {number} id
|
|
1159
|
+
* @param {number} key
|
|
1160
|
+
* @param {Float64Array} points
|
|
1161
|
+
* @param {Uint32Array} ring_start
|
|
1162
|
+
* @param {Uint32Array} polygon_start
|
|
1163
|
+
* @param {Uint32Array} polygon_feature
|
|
1164
|
+
* @param {Uint32Array} fill_start
|
|
1165
|
+
* @param {Uint8Array} vertices
|
|
1166
|
+
* @param {Uint32Array} indices
|
|
1167
|
+
* @param {Uint32Array} fill_ranges
|
|
1168
|
+
* @param {boolean} prism
|
|
1169
|
+
* @param {Uint8Array} pieces
|
|
1170
|
+
* @param {Float32Array} line_table
|
|
1171
|
+
* @param {Uint32Array} line_ranges
|
|
1172
|
+
* @param {Uint8Array} blocks
|
|
1173
|
+
* @param {Uint32Array} block_indices
|
|
1174
|
+
* @param {Uint32Array} block_ranges
|
|
1175
|
+
* @param {Float64Array} bounds
|
|
1176
|
+
* @param {number} feature_count
|
|
1177
|
+
*/
|
|
1178
|
+
setVectorTileMesh(id, key, points, ring_start, polygon_start, polygon_feature, fill_start, vertices, indices, fill_ranges, prism, pieces, line_table, line_ranges, blocks, block_indices, block_ranges, bounds, feature_count) {
|
|
1179
|
+
const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
|
|
1180
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1181
|
+
const ptr1 = passArray32ToWasm0(ring_start, wasm.__wbindgen_malloc);
|
|
1182
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1183
|
+
const ptr2 = passArray32ToWasm0(polygon_start, wasm.__wbindgen_malloc);
|
|
1184
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1185
|
+
const ptr3 = passArray32ToWasm0(polygon_feature, wasm.__wbindgen_malloc);
|
|
1186
|
+
const len3 = WASM_VECTOR_LEN;
|
|
1187
|
+
const ptr4 = passArray32ToWasm0(fill_start, wasm.__wbindgen_malloc);
|
|
1188
|
+
const len4 = WASM_VECTOR_LEN;
|
|
1189
|
+
const ptr5 = passArray8ToWasm0(vertices, wasm.__wbindgen_malloc);
|
|
1190
|
+
const len5 = WASM_VECTOR_LEN;
|
|
1191
|
+
const ptr6 = passArray32ToWasm0(indices, wasm.__wbindgen_malloc);
|
|
1192
|
+
const len6 = WASM_VECTOR_LEN;
|
|
1193
|
+
const ptr7 = passArray32ToWasm0(fill_ranges, wasm.__wbindgen_malloc);
|
|
1194
|
+
const len7 = WASM_VECTOR_LEN;
|
|
1195
|
+
const ptr8 = passArray8ToWasm0(pieces, wasm.__wbindgen_malloc);
|
|
1196
|
+
const len8 = WASM_VECTOR_LEN;
|
|
1197
|
+
const ptr9 = passArrayF32ToWasm0(line_table, wasm.__wbindgen_malloc);
|
|
1198
|
+
const len9 = WASM_VECTOR_LEN;
|
|
1199
|
+
const ptr10 = passArray32ToWasm0(line_ranges, wasm.__wbindgen_malloc);
|
|
1200
|
+
const len10 = WASM_VECTOR_LEN;
|
|
1201
|
+
const ptr11 = passArray8ToWasm0(blocks, wasm.__wbindgen_malloc);
|
|
1202
|
+
const len11 = WASM_VECTOR_LEN;
|
|
1203
|
+
const ptr12 = passArray32ToWasm0(block_indices, wasm.__wbindgen_malloc);
|
|
1204
|
+
const len12 = WASM_VECTOR_LEN;
|
|
1205
|
+
const ptr13 = passArray32ToWasm0(block_ranges, wasm.__wbindgen_malloc);
|
|
1206
|
+
const len13 = WASM_VECTOR_LEN;
|
|
1207
|
+
const ptr14 = passArrayF64ToWasm0(bounds, wasm.__wbindgen_malloc);
|
|
1208
|
+
const len14 = WASM_VECTOR_LEN;
|
|
1209
|
+
const ret = wasm.engine_setVectorTileMesh(this.__wbg_ptr, id, key, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6, ptr7, len7, prism, ptr8, len8, ptr9, len9, ptr10, len10, ptr11, len11, ptr12, len12, ptr13, len13, ptr14, len14, feature_count);
|
|
1210
|
+
if (ret[1]) {
|
|
1211
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
/**
|
|
1215
|
+
* Adds or replaces tile `key` of a vector tile layer: its polygons as for `addFills` (`fill_start`: the first
|
|
1216
|
+
* polygon of each sublayer, and the end; those of an extrusion sublayer raised into blocks), its lines as for
|
|
1217
|
+
* `addLines` (`line_start`: the first line of each sublayer, and the end), `feature_count` features, styled as an
|
|
1218
|
+
* extrusion layer's (`setFeatureStyle` with the key: a color, then a line's width or a block's height and base);
|
|
1219
|
+
* `tile`: the corners of the tile they are cut to (west, north, east, south; empty: none), along whose edges no
|
|
1220
|
+
* wall of a block rises
|
|
1221
|
+
*
|
|
1222
|
+
* # Errors
|
|
1223
|
+
*
|
|
1224
|
+
* Throws (to JavaScript) when a WebGL object of the tile cannot be created, or when its features or lines need a
|
|
1225
|
+
* table texture past the GPU's `MAX_TEXTURE_SIZE`
|
|
1226
|
+
* @param {number} id
|
|
1227
|
+
* @param {number} key
|
|
1228
|
+
* @param {Float64Array} points
|
|
1229
|
+
* @param {Uint32Array} ring_start
|
|
1230
|
+
* @param {Uint32Array} polygon_start
|
|
1231
|
+
* @param {Uint32Array} polygon_feature
|
|
1232
|
+
* @param {Uint32Array} fill_start
|
|
1233
|
+
* @param {Float64Array} line_points
|
|
1234
|
+
* @param {Uint32Array} line_first
|
|
1235
|
+
* @param {Uint32Array} line_feature
|
|
1236
|
+
* @param {Uint32Array} line_start
|
|
1237
|
+
* @param {number} feature_count
|
|
1238
|
+
* @param {Float64Array} tile
|
|
1239
|
+
*/
|
|
1240
|
+
setVectorTile(id, key, points, ring_start, polygon_start, polygon_feature, fill_start, line_points, line_first, line_feature, line_start, feature_count, tile) {
|
|
1241
|
+
const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
|
|
1242
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1243
|
+
const ptr1 = passArray32ToWasm0(ring_start, wasm.__wbindgen_malloc);
|
|
1244
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1245
|
+
const ptr2 = passArray32ToWasm0(polygon_start, wasm.__wbindgen_malloc);
|
|
1246
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1247
|
+
const ptr3 = passArray32ToWasm0(polygon_feature, wasm.__wbindgen_malloc);
|
|
1248
|
+
const len3 = WASM_VECTOR_LEN;
|
|
1249
|
+
const ptr4 = passArray32ToWasm0(fill_start, wasm.__wbindgen_malloc);
|
|
1250
|
+
const len4 = WASM_VECTOR_LEN;
|
|
1251
|
+
const ptr5 = passArrayF64ToWasm0(line_points, wasm.__wbindgen_malloc);
|
|
1252
|
+
const len5 = WASM_VECTOR_LEN;
|
|
1253
|
+
const ptr6 = passArray32ToWasm0(line_first, wasm.__wbindgen_malloc);
|
|
1254
|
+
const len6 = WASM_VECTOR_LEN;
|
|
1255
|
+
const ptr7 = passArray32ToWasm0(line_feature, wasm.__wbindgen_malloc);
|
|
1256
|
+
const len7 = WASM_VECTOR_LEN;
|
|
1257
|
+
const ptr8 = passArray32ToWasm0(line_start, wasm.__wbindgen_malloc);
|
|
1258
|
+
const len8 = WASM_VECTOR_LEN;
|
|
1259
|
+
const ptr9 = passArrayF64ToWasm0(tile, wasm.__wbindgen_malloc);
|
|
1260
|
+
const len9 = WASM_VECTOR_LEN;
|
|
1261
|
+
const ret = wasm.engine_setVectorTile(this.__wbg_ptr, id, key, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6, ptr7, len7, ptr8, len8, feature_count, ptr9, len9);
|
|
1262
|
+
if (ret[1]) {
|
|
1263
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
955
1266
|
/**
|
|
956
1267
|
* Shows what can be seen from points, each within its range: `observers` holds 8 numbers per observer
|
|
957
1268
|
* (16 at most): longitude, latitude (degrees), metres above the ground, range (metres), then to look one way
|
|
958
1269
|
* only heading, tilt, angles of view across and up (degrees), the heading NaN to look all around. What some
|
|
959
1270
|
* observer sees is tinted with `visible`, what is hidden from all those that reach it with `hidden` (RGB 0-1),
|
|
960
1271
|
* at `opacity`; `outline` (RGB 0-1, or empty) the color of the cones' edges drawn in 3D
|
|
1272
|
+
*
|
|
1273
|
+
* # Errors
|
|
1274
|
+
*
|
|
1275
|
+
* Throws (to JavaScript) when, on the first call, a WebGL object cannot be created or a shader fails to compile
|
|
1276
|
+
* (the error carries its info log)
|
|
961
1277
|
* @param {Float64Array} observers
|
|
962
1278
|
* @param {Float32Array} visible
|
|
963
1279
|
* @param {Float32Array} hidden
|
|
@@ -979,6 +1295,7 @@ export class Engine {
|
|
|
979
1295
|
}
|
|
980
1296
|
}
|
|
981
1297
|
/**
|
|
1298
|
+
* Lowest and highest zoom levels the camera accepts
|
|
982
1299
|
* @param {number} min
|
|
983
1300
|
* @param {number} max
|
|
984
1301
|
*/
|
|
@@ -1046,6 +1363,11 @@ export class Engine {
|
|
|
1046
1363
|
}
|
|
1047
1364
|
/**
|
|
1048
1365
|
* Replaces a region of a ground layer's texture (one layer of a 2D array)
|
|
1366
|
+
*
|
|
1367
|
+
* # Errors
|
|
1368
|
+
*
|
|
1369
|
+
* Throws (to JavaScript) when there is no texture `name`, or when the region is out of its bounds or
|
|
1370
|
+
* `data` holds too few bytes
|
|
1049
1371
|
* @param {number} id
|
|
1050
1372
|
* @param {string} name
|
|
1051
1373
|
* @param {number} x
|
|
@@ -1078,6 +1400,20 @@ export class Engine {
|
|
|
1078
1400
|
const len0 = WASM_VECTOR_LEN;
|
|
1079
1401
|
wasm.engine_updateIconAtlas(this.__wbg_ptr, x, y, width, height, ptr0, len0);
|
|
1080
1402
|
}
|
|
1403
|
+
/**
|
|
1404
|
+
* Vector tiles (512 CSS pixels across at their level, as `MapLibre`'s) for the view of the last frame (else the
|
|
1405
|
+
* camera's), levels `min_z` to `max_z`, three numbers per tile (z, x, y), the nearest to the eye first: what a
|
|
1406
|
+
* vector tile layer draws (`addVectorTiles`), coarser far away in a tilted view as the raster layers
|
|
1407
|
+
* @param {number} min_z
|
|
1408
|
+
* @param {number} max_z
|
|
1409
|
+
* @returns {Uint32Array}
|
|
1410
|
+
*/
|
|
1411
|
+
vectorTilesInView(min_z, max_z) {
|
|
1412
|
+
const ret = wasm.engine_vectorTilesInView(this.__wbg_ptr, min_z, max_z);
|
|
1413
|
+
var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
|
|
1414
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
1415
|
+
return v1;
|
|
1416
|
+
}
|
|
1081
1417
|
/**
|
|
1082
1418
|
* Tiles a raster layer wants for the view of the last frame, three numbers per tile (z, x, y), the nearest to
|
|
1083
1419
|
* the eye first: the level each area of the ground is drawn at, for the labels of a vector style to follow it
|
|
@@ -1091,6 +1427,7 @@ export class Engine {
|
|
|
1091
1427
|
return v1;
|
|
1092
1428
|
}
|
|
1093
1429
|
/**
|
|
1430
|
+
* Zooms by `delta` levels around a screen point (CSS pixels), which keeps the same ground point under it
|
|
1094
1431
|
* @param {number} delta
|
|
1095
1432
|
* @param {number} x
|
|
1096
1433
|
* @param {number} y
|
|
@@ -1758,6 +2095,12 @@ function __wbg_get_imports() {
|
|
|
1758
2095
|
__wbg_pixelStorei_cb4e43466f5b8703: function(arg0, arg1, arg2) {
|
|
1759
2096
|
arg0.pixelStorei(arg1 >>> 0, arg2);
|
|
1760
2097
|
},
|
|
2098
|
+
__wbg_polygonOffset_81dc8ca84e29572b: function(arg0, arg1, arg2) {
|
|
2099
|
+
arg0.polygonOffset(arg1, arg2);
|
|
2100
|
+
},
|
|
2101
|
+
__wbg_polygonOffset_8f922d9173d8849d: function(arg0, arg1, arg2) {
|
|
2102
|
+
arg0.polygonOffset(arg1, arg2);
|
|
2103
|
+
},
|
|
1761
2104
|
__wbg_prototypesetcall_8b03c01e2c0f8066: function(arg0, arg1, arg2) {
|
|
1762
2105
|
Float32Array.prototype.set.call(getArrayF32FromWasm0(arg0, arg1), arg2);
|
|
1763
2106
|
},
|
|
@@ -2096,7 +2439,7 @@ function __wbg_get_imports() {
|
|
|
2096
2439
|
return ret;
|
|
2097
2440
|
},
|
|
2098
2441
|
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
2099
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
2442
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 106, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
2100
2443
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_2e566c63402fe7fa___convert__closures_____invoke___wasm_bindgen_2e566c63402fe7fa___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_2e566c63402fe7fa___JsError___true_);
|
|
2101
2444
|
return ret;
|
|
2102
2445
|
},
|