@maplibre/mlt-wasm 0.2.3 → 0.2.5
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/README.md +42 -14
- package/dist/columns.d.ts +67 -6
- package/dist/columns.d.ts.map +1 -1
- package/dist/columns.js +38 -5
- package/dist/columns.js.map +1 -1
- package/dist/featureGeometry.d.ts +20 -6
- package/dist/featureGeometry.d.ts.map +1 -1
- package/dist/featureGeometry.js +33 -34
- package/dist/featureGeometry.js.map +1 -1
- package/dist/geojson.d.ts +3 -2
- package/dist/geojson.d.ts.map +1 -1
- package/dist/geojson.js +3 -2
- package/dist/geojson.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/vectorTile.d.ts +41 -9
- package/dist/vectorTile.d.ts.map +1 -1
- package/dist/vectorTile.js +88 -19
- package/dist/vectorTile.js.map +1 -1
- package/dist/wasm.d.ts +8 -3
- package/dist/wasm.d.ts.map +1 -1
- package/dist/wasm.js +20 -3
- package/dist/wasm.js.map +1 -1
- package/package.json +3 -3
- package/pkg/README.md +42 -14
- package/pkg/mlt_wasm.d.ts +6 -5
- package/pkg/mlt_wasm_bg.js +62 -54
- package/pkg/mlt_wasm_bg.wasm +0 -0
- package/pkg/mlt_wasm_bg.wasm.d.ts +2 -1
- package/pkg/mlt_wasm_bg.wasm.gz +0 -0
- package/pkg/package.json +1 -1
package/pkg/README.md
CHANGED
|
@@ -38,7 +38,9 @@ npm run build:ts
|
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
The `unstable-v2` feature is on by default, so v2 layers decode. Building with
|
|
41
|
-
`--no-default-features` skips them.
|
|
41
|
+
`--no-default-features` skips them. The `annotate` and `geojson` features, also on by default,
|
|
42
|
+
export `annotateTile` and `tileGeoJson`. A renderer that only calls `decodeTileColumns` can leave
|
|
43
|
+
them out, `--no-default-features --features unstable-v2`, for a WASM file a third smaller.
|
|
42
44
|
|
|
43
45
|
## Usage
|
|
44
46
|
|
|
@@ -51,7 +53,7 @@ const tile = decodeTile(data);
|
|
|
51
53
|
for (const [name, layer] of Object.entries(tile.layers)) {
|
|
52
54
|
for (let i = 0; i < layer.length; i++) {
|
|
53
55
|
const feature = layer.feature(i);
|
|
54
|
-
console.log(feature.type); // 1 | 2 | 3
|
|
56
|
+
console.log(feature.type); // 0 (Mesh) | 1 | 2 | 3
|
|
55
57
|
console.log(feature.id); // number | undefined
|
|
56
58
|
console.log(feature.properties); // read from the decoded columns
|
|
57
59
|
console.log(feature.loadGeometry()); // Point[][]
|
|
@@ -68,17 +70,19 @@ build their own buffers, such as a renderer. Nothing per feature crosses the WAS
|
|
|
68
70
|
import { columnValue, decodeTileColumns } from '@maplibre/mlt-wasm';
|
|
69
71
|
|
|
70
72
|
for (const layer of decodeTileColumns(data).layers) {
|
|
71
|
-
const { dimension, vertices, zStep } = layer.geometry;
|
|
73
|
+
const { layout, dimension, vertices, zStep } = layer.geometry;
|
|
74
|
+
// layout: "outlines", "tessPolygons", "tessPolygonsWithOutlines" or "meshes"
|
|
72
75
|
// vertices: Int32Array of (x, y) pairs, or (x, y, z) triples when dimension is 3
|
|
73
76
|
// geometryOffsets, partOffsets, ringOffsets: cumulative offsets, left out when not needed
|
|
74
|
-
// triangleOffsets, indexBuffer: present on tessellated layers
|
|
77
|
+
// triangleOffsets, indexBuffer: present on tessellated and Meshes layers
|
|
75
78
|
for (const column of layer.properties) {
|
|
76
79
|
// column.values has one slot per feature; a slot without a value holds 0 or ""
|
|
77
80
|
for (let f = 0; f < layer.featureCount; f++) {
|
|
78
81
|
const value = columnValue(column, f); // undefined when feature f has no value
|
|
79
82
|
}
|
|
80
83
|
}
|
|
81
|
-
//
|
|
84
|
+
// m-value columns are in layer.vertexValues and layer.triangleValues, empty when there are none
|
|
85
|
+
// nested columns are not passed on
|
|
82
86
|
}
|
|
83
87
|
```
|
|
84
88
|
|
|
@@ -92,14 +96,32 @@ lose precision.
|
|
|
92
96
|
|
|
93
97
|
A 3D layer's `zStep` is the power of ten of its z grid's step in metres; `toElevation(z, zStep)`
|
|
94
98
|
converts one z to metres, exactly as `mlt-core` does.
|
|
99
|
+
Its `heightMode` says what a z of `0` stands for: `"absolute"` is mean sea level and
|
|
100
|
+
`"relativeToGround"` the terrain under each vertex.
|
|
101
|
+
|
|
102
|
+
A v2 layer's `vertexValues` hold its m-value columns over the vertices, and a `Meshes` layer's
|
|
103
|
+
`triangleValues` its m-value columns over the triangles. Every other layer has both, empty.
|
|
104
|
+
Each is packed over the features whose `present` bit is set (absent features store zero items rather
|
|
105
|
+
than `0`/`""` padding), with strings as dictionary codes.
|
|
106
|
+
A column's `offsets` give feature `f` the values `offsets[f]..offsets[f + 1]`; `mValueSlice(column, f)`
|
|
107
|
+
reads one feature's slice, and a feature's `loadVertexValues(name)` and `loadTriangleValues(name)`
|
|
108
|
+
do the same on `decodeTile` and `decodeTile3D`.
|
|
109
|
+
|
|
110
|
+
`triangleOffsets` start each feature's triangles in the layer-wide `indexBuffer`, with an empty run for
|
|
111
|
+
a feature that has none, such as a point of a tessellated layer.
|
|
112
|
+
A `Meshes` layer's features are all `MltGeometryType.Mesh`, and `geometryOffsets` starts each feature's
|
|
113
|
+
run of vertices.
|
|
114
|
+
A mesh in the `"relativeToGround"` height mode meets the terrain at the centre of its vertices'
|
|
115
|
+
`(x, y)` bounding box.
|
|
95
116
|
|
|
96
117
|
### Features
|
|
97
118
|
|
|
98
119
|
`featureGeometry(layer, i)` reads feature `i` of a column layer without knowing the offset levels.
|
|
99
120
|
Its points, lines and polygon rings are views of the layer's vertices, still in tile coordinates,
|
|
100
121
|
and a polygon's rings come ready for earcut. A `TessPolygonsWithOutlines` layer's triangles come per
|
|
101
|
-
feature, counted from the feature's own vertices. A `TessPolygons`
|
|
102
|
-
outlines, so `featureGeometry` rejects it; its `indexBuffer` and
|
|
122
|
+
feature, counted from the feature's own vertices, and so do a mesh's (`kind: "mesh"`). A `TessPolygons`
|
|
123
|
+
layer stores triangles without outlines, so `featureGeometry` rejects it; its `indexBuffer` and
|
|
124
|
+
`triangleOffsets` are the triangles.
|
|
103
125
|
|
|
104
126
|
```ts
|
|
105
127
|
import { featureGeometry } from '@maplibre/mlt-wasm';
|
|
@@ -161,8 +183,8 @@ for (let g = 0; g + 1 < geometryVertices.length; g++) {
|
|
|
161
183
|
```
|
|
162
184
|
|
|
163
185
|
A geometry is a point, a line or a polygon, and every kind shares one sequence in feature order, so in
|
|
164
|
-
a layer mixing kinds, `layer.geometry.types` tells which features are which. A `TessPolygons`
|
|
165
|
-
|
|
186
|
+
a layer mixing kinds, `layer.geometry.types` tells which features are which. A `TessPolygons` or
|
|
187
|
+
`Meshes` layer has only triangles, so `geometryStarts` rejects it.
|
|
166
188
|
|
|
167
189
|
On a 1.3 MB tile of 1,333 line features and 524,482 vertices, `geometryStarts` takes about 0.006 ms
|
|
168
190
|
and the fill above about 0.2 ms, against about 3.8 ms for `decodeTileColumns` (Node, one machine).
|
|
@@ -180,22 +202,28 @@ Shapes that need tessellation on the CPU work one polygon or line at a time:
|
|
|
180
202
|
|
|
181
203
|
`decodeTile3D` reads a tile whose every layer has z coordinates. Its features have the same
|
|
182
204
|
`loadGeometry()` and `loadPolygons()`, with every vertex an `[x, y, z]` array, so the rest of the
|
|
183
|
-
code can assume 3D.
|
|
205
|
+
code can assume 3D. In both readers, a mesh's `loadGeometry()` is one ring of its vertices, and
|
|
206
|
+
`loadTriangles()` indexes into it. `decodeTile3D` throws when any layer has no z coordinates, for which `decodeTile` reads the
|
|
184
207
|
tile in 2D, and when any layer uses the `TessPolygons` or `TessPolygonsWithOutlines` geometry
|
|
185
208
|
layout. `decodeTileColumns` reads every layout, in 2D and 3D.
|
|
186
209
|
|
|
187
210
|
Like `x` and `y`, `z` is the stored integer: it lies on the layer's `zStep` grid, and
|
|
188
|
-
`toElevation(z, layer.zStep)` gives
|
|
211
|
+
`toElevation(z, layer.zStep)` gives it in metres above the layer's `heightMode` base.
|
|
189
212
|
|
|
190
213
|
```ts
|
|
191
|
-
import { decodeTile3D } from '@maplibre/mlt-wasm';
|
|
214
|
+
import { decodeTile3D, MltGeometryType } from '@maplibre/mlt-wasm';
|
|
192
215
|
|
|
193
216
|
const tile = decodeTile3D(data);
|
|
194
217
|
for (const [name, layer] of Object.entries(tile.layers)) {
|
|
195
218
|
for (let i = 0; i < layer.length; i++) {
|
|
196
219
|
const feature = layer.feature(i);
|
|
197
|
-
|
|
198
|
-
|
|
220
|
+
if (feature.mltType === MltGeometryType.Mesh) {
|
|
221
|
+
const vertices = feature.loadGeometry()[0]; // [x, y, z][]
|
|
222
|
+
const triangles = feature.loadTriangles(); // Uint32Array
|
|
223
|
+
} else {
|
|
224
|
+
// exterior ring, then holes; each ring is closed (its first vertex is repeated at the end)
|
|
225
|
+
const polygons = feature.loadPolygons(); // [x, y, z][][][]
|
|
226
|
+
}
|
|
199
227
|
}
|
|
200
228
|
}
|
|
201
229
|
```
|
package/pkg/mlt_wasm.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export class AnnotatedTile {
|
|
|
41
41
|
* Never throws for a malformed tile: the walk hands back what it annotated and
|
|
42
42
|
* [`AnnotatedTile::error`] carries the failure.
|
|
43
43
|
*/
|
|
44
|
-
export function annotateTile(data: Uint8Array): AnnotatedTile;
|
|
44
|
+
export function annotateTile(data: Uint8Array | number[]): AnnotatedTile;
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
47
|
* Decode the layers of `data` into their columns, in wire order: every layer, or with
|
|
@@ -49,15 +49,16 @@ export function annotateTile(data: Uint8Array): AnnotatedTile;
|
|
|
49
49
|
*
|
|
50
50
|
* v2 layers are skipped unless the crate is built with the `unstable-v2` feature.
|
|
51
51
|
*/
|
|
52
|
-
export function decodeTileColumns(data: Uint8Array, names?: string[] | null): Array<any>;
|
|
52
|
+
export function decodeTileColumns(data: Uint8Array | number[], names?: string[] | null): Array<any>;
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
55
|
* Decode a raw MLT tile blob into `GeoJSON`, as the serialized text.
|
|
56
56
|
*
|
|
57
|
-
* Every feature carries `_layer` and `_extent
|
|
58
|
-
* along as `m:`-prefixed arrays, one value per vertex.
|
|
57
|
+
* Every feature carries `_layer` and `_extent`.
|
|
58
|
+
* A v2 tile's m-value columns ride along as `m:`-prefixed arrays, one value per vertex or per mesh triangle.
|
|
59
|
+
* Mesh features carry a top-level `triangles` member.
|
|
59
60
|
*
|
|
60
61
|
* Text rather than a `JsValue`: building the object graph across the boundary costs a
|
|
61
62
|
* crossing per value, where one string plus `JSON.parse` is a single copy.
|
|
62
63
|
*/
|
|
63
|
-
export function tileGeoJson(data: Uint8Array): string;
|
|
64
|
+
export function tileGeoJson(data: Uint8Array | number[]): string;
|
package/pkg/mlt_wasm_bg.js
CHANGED
|
@@ -72,7 +72,7 @@ if (Symbol.dispose) AnnotatedTile.prototype[Symbol.dispose] = AnnotatedTile.prot
|
|
|
72
72
|
*
|
|
73
73
|
* Never throws for a malformed tile: the walk hands back what it annotated and
|
|
74
74
|
* [`AnnotatedTile::error`] carries the failure.
|
|
75
|
-
* @param {Uint8Array} data
|
|
75
|
+
* @param {Uint8Array | number[]} data
|
|
76
76
|
* @returns {AnnotatedTile}
|
|
77
77
|
*/
|
|
78
78
|
export function annotateTile(data) {
|
|
@@ -87,15 +87,22 @@ export function annotateTile(data) {
|
|
|
87
87
|
* `names`, only those with one of these names. A layer left out is never decoded.
|
|
88
88
|
*
|
|
89
89
|
* v2 layers are skipped unless the crate is built with the `unstable-v2` feature.
|
|
90
|
-
* @param {Uint8Array} data
|
|
90
|
+
* @param {Uint8Array | number[]} data
|
|
91
91
|
* @param {string[] | null} [names]
|
|
92
92
|
* @returns {Array<any>}
|
|
93
93
|
*/
|
|
94
94
|
export function decodeTileColumns(data, names) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
let ptr0, len0, ptr1, len1;
|
|
96
|
+
try {
|
|
97
|
+
ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
98
|
+
len0 = WASM_VECTOR_LEN;
|
|
99
|
+
ptr1 = isLikeNone(names) ? 0 : passArrayJsValueToWasm0(names, wasm.__wbindgen_malloc);
|
|
100
|
+
len1 = WASM_VECTOR_LEN;
|
|
101
|
+
} catch (e) {
|
|
102
|
+
if (ptr1) { wasm.__externref_drop_slice(ptr1, len1); wasm.__wbindgen_free(ptr1, len1 * 4, 4); }
|
|
103
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
104
|
+
throw e;
|
|
105
|
+
}
|
|
99
106
|
const ret = wasm.decodeTileColumns(ptr0, len0, ptr1, len1);
|
|
100
107
|
if (ret[2]) {
|
|
101
108
|
throw takeFromExternrefTable0(ret[1]);
|
|
@@ -106,12 +113,13 @@ export function decodeTileColumns(data, names) {
|
|
|
106
113
|
/**
|
|
107
114
|
* Decode a raw MLT tile blob into `GeoJSON`, as the serialized text.
|
|
108
115
|
*
|
|
109
|
-
* Every feature carries `_layer` and `_extent
|
|
110
|
-
* along as `m:`-prefixed arrays, one value per vertex.
|
|
116
|
+
* Every feature carries `_layer` and `_extent`.
|
|
117
|
+
* A v2 tile's m-value columns ride along as `m:`-prefixed arrays, one value per vertex or per mesh triangle.
|
|
118
|
+
* Mesh features carry a top-level `triangles` member.
|
|
111
119
|
*
|
|
112
120
|
* Text rather than a `JsValue`: building the object graph across the boundary costs a
|
|
113
121
|
* crossing per value, where one string plus `JSON.parse` is a single copy.
|
|
114
|
-
* @param {Uint8Array} data
|
|
122
|
+
* @param {Uint8Array | number[]} data
|
|
115
123
|
* @returns {string}
|
|
116
124
|
*/
|
|
117
125
|
export function tileGeoJson(data) {
|
|
@@ -134,7 +142,7 @@ export function tileGeoJson(data) {
|
|
|
134
142
|
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
135
143
|
}
|
|
136
144
|
}
|
|
137
|
-
export function
|
|
145
|
+
export function __wbg_Error_208446807d0d1e30(arg0, arg1) {
|
|
138
146
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
139
147
|
return ret;
|
|
140
148
|
}
|
|
@@ -142,82 +150,82 @@ export function __wbg_String_8564e559799eccda(arg0, arg1) {
|
|
|
142
150
|
const ret = String(arg1);
|
|
143
151
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
144
152
|
const len1 = WASM_VECTOR_LEN;
|
|
145
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
146
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
153
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
|
|
154
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
|
|
147
155
|
}
|
|
148
|
-
export function
|
|
156
|
+
export function __wbg___wbindgen_is_string_fc456fee5d3317de(arg0) {
|
|
149
157
|
const ret = typeof(arg0) === 'string';
|
|
150
158
|
return ret;
|
|
151
159
|
}
|
|
152
|
-
export function
|
|
160
|
+
export function __wbg___wbindgen_string_get_7ce8eee7fd327545(arg0, arg1) {
|
|
153
161
|
const obj = arg1;
|
|
154
162
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
155
163
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
156
164
|
var len1 = WASM_VECTOR_LEN;
|
|
157
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
158
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
165
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
|
|
166
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
|
|
159
167
|
}
|
|
160
|
-
export function
|
|
168
|
+
export function __wbg___wbindgen_throw_4c88d8bf264fd984(arg0, arg1) {
|
|
161
169
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
162
170
|
}
|
|
163
|
-
export function
|
|
164
|
-
const ret = new
|
|
171
|
+
export function __wbg_new_37eb45aaf5eeb820() {
|
|
172
|
+
const ret = new Array();
|
|
165
173
|
return ret;
|
|
166
174
|
}
|
|
167
|
-
export function
|
|
168
|
-
const ret = new
|
|
175
|
+
export function __wbg_new_7075786089b89c5e() {
|
|
176
|
+
const ret = new Map();
|
|
169
177
|
return ret;
|
|
170
178
|
}
|
|
171
|
-
export function
|
|
172
|
-
const ret = new
|
|
179
|
+
export function __wbg_new_cd4348290afae586() {
|
|
180
|
+
const ret = new Object();
|
|
173
181
|
return ret;
|
|
174
182
|
}
|
|
175
|
-
export function
|
|
176
|
-
const ret = new
|
|
183
|
+
export function __wbg_new_from_slice_3512352010266e02(arg0, arg1) {
|
|
184
|
+
const ret = new Uint32Array(getArrayU32FromWasm0(arg0, arg1));
|
|
177
185
|
return ret;
|
|
178
186
|
}
|
|
179
|
-
export function
|
|
180
|
-
const ret = new
|
|
187
|
+
export function __wbg_new_from_slice_355c10c5d8f2addb(arg0, arg1) {
|
|
188
|
+
const ret = new Float32Array(getArrayF32FromWasm0(arg0, arg1));
|
|
181
189
|
return ret;
|
|
182
190
|
}
|
|
183
|
-
export function
|
|
184
|
-
const ret = new
|
|
191
|
+
export function __wbg_new_from_slice_aaf85a9746711968(arg0, arg1) {
|
|
192
|
+
const ret = new Float64Array(getArrayF64FromWasm0(arg0, arg1));
|
|
185
193
|
return ret;
|
|
186
194
|
}
|
|
187
|
-
export function
|
|
195
|
+
export function __wbg_new_from_slice_b8daf545a41c6aa0(arg0, arg1) {
|
|
188
196
|
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
189
197
|
return ret;
|
|
190
198
|
}
|
|
191
|
-
export function
|
|
192
|
-
const ret = new
|
|
199
|
+
export function __wbg_new_from_slice_d9c5662e7fd80ccd(arg0, arg1) {
|
|
200
|
+
const ret = new Int8Array(getArrayI8FromWasm0(arg0, arg1));
|
|
193
201
|
return ret;
|
|
194
202
|
}
|
|
195
|
-
export function
|
|
196
|
-
const ret = new
|
|
203
|
+
export function __wbg_new_from_slice_e0c60a796e12bb7c(arg0, arg1) {
|
|
204
|
+
const ret = new Int32Array(getArrayI32FromWasm0(arg0, arg1));
|
|
197
205
|
return ret;
|
|
198
206
|
}
|
|
199
|
-
export function
|
|
207
|
+
export function __wbg_new_with_length_a3dc62dea6e2e158(arg0) {
|
|
200
208
|
const ret = new Array(arg0 >>> 0);
|
|
201
209
|
return ret;
|
|
202
210
|
}
|
|
203
|
-
export function
|
|
211
|
+
export function __wbg_push_c9f4893fc209f768(arg0, arg1) {
|
|
204
212
|
const ret = arg0.push(arg1);
|
|
205
213
|
return ret;
|
|
206
214
|
}
|
|
207
|
-
export function
|
|
215
|
+
export function __wbg_set_2793479888329cb6() { return handleError(function (arg0, arg1, arg2) {
|
|
208
216
|
const ret = Reflect.set(arg0, arg1, arg2);
|
|
209
217
|
return ret;
|
|
210
218
|
}, arguments); }
|
|
211
|
-
export function
|
|
219
|
+
export function __wbg_set_8282f7e0d2d01336(arg0, arg1, arg2) {
|
|
212
220
|
const ret = arg0.set(arg1, arg2);
|
|
213
221
|
return ret;
|
|
214
222
|
}
|
|
215
|
-
export function
|
|
216
|
-
arg0[arg1] = arg2;
|
|
217
|
-
}
|
|
218
|
-
export function __wbg_set_bea140a88be9b277(arg0, arg1, arg2) {
|
|
223
|
+
export function __wbg_set_d2d33b52458e984a(arg0, arg1, arg2) {
|
|
219
224
|
arg0[arg1 >>> 0] = arg2;
|
|
220
225
|
}
|
|
226
|
+
export function __wbg_set_e4b9a833d288759a(arg0, arg1, arg2) {
|
|
227
|
+
arg0[arg1] = arg2;
|
|
228
|
+
}
|
|
221
229
|
export function __wbindgen_generic_0000000000000001(arg0) {
|
|
222
230
|
// Cast intrinsic for `F64 -> Externref`.
|
|
223
231
|
const ret = arg0;
|
|
@@ -240,12 +248,11 @@ export function __wbindgen_generic_0000000000000004(arg0, arg1) {
|
|
|
240
248
|
}
|
|
241
249
|
export function __wbindgen_init_externref_table() {
|
|
242
250
|
const table = wasm.__wbindgen_externrefs;
|
|
243
|
-
const offset = table.grow(4);
|
|
244
251
|
table.set(0, undefined);
|
|
245
|
-
table.set(
|
|
246
|
-
table.set(
|
|
247
|
-
table.set(
|
|
248
|
-
table.set(
|
|
252
|
+
table.set(1024, undefined);
|
|
253
|
+
table.set(1025, null);
|
|
254
|
+
table.set(1026, true);
|
|
255
|
+
table.set(1027, false);
|
|
249
256
|
}
|
|
250
257
|
const AnnotatedTileFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
251
258
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -328,7 +335,8 @@ function getInt8ArrayMemory0() {
|
|
|
328
335
|
}
|
|
329
336
|
|
|
330
337
|
function getStringFromWasm0(ptr, len) {
|
|
331
|
-
|
|
338
|
+
ptr = ptr >>> 0;
|
|
339
|
+
return decodeText(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
332
340
|
}
|
|
333
341
|
|
|
334
342
|
let cachedUint32ArrayMemory0 = null;
|
|
@@ -420,18 +428,18 @@ function takeFromExternrefTable0(idx) {
|
|
|
420
428
|
return value;
|
|
421
429
|
}
|
|
422
430
|
|
|
423
|
-
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true
|
|
431
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
|
|
424
432
|
cachedTextDecoder.decode();
|
|
425
433
|
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
426
434
|
let numBytesDecoded = 0;
|
|
427
|
-
function decodeText(
|
|
428
|
-
numBytesDecoded +=
|
|
435
|
+
function decodeText(bytes) {
|
|
436
|
+
numBytesDecoded += bytes.length;
|
|
429
437
|
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
430
|
-
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true
|
|
438
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
|
|
431
439
|
cachedTextDecoder.decode();
|
|
432
|
-
numBytesDecoded =
|
|
440
|
+
numBytesDecoded = bytes.length;
|
|
433
441
|
}
|
|
434
|
-
return cachedTextDecoder.decode(
|
|
442
|
+
return cachedTextDecoder.decode(bytes);
|
|
435
443
|
}
|
|
436
444
|
|
|
437
445
|
const cachedTextEncoder = new TextEncoder();
|
package/pkg/mlt_wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -10,9 +10,10 @@ export const decodeTileColumns: (a: number, b: number, c: number, d: number) =>
|
|
|
10
10
|
export const tileGeoJson: (a: number, b: number) => [number, number, number, number];
|
|
11
11
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
12
12
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
13
|
+
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
13
14
|
export const __wbindgen_exn_store: (a: number) => void;
|
|
14
15
|
export const __externref_table_alloc: () => number;
|
|
15
16
|
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
16
17
|
export const __externref_table_dealloc: (a: number) => void;
|
|
17
|
-
export const
|
|
18
|
+
export const __externref_drop_slice: (a: number, b: number) => void;
|
|
18
19
|
export const __wbindgen_start: () => void;
|
package/pkg/mlt_wasm_bg.wasm.gz
CHANGED
|
Binary file
|