isard 1.2.0 → 1.4.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 +124 -0
- package/README.md +46 -39
- package/dist/basemap/basemaps.js +1 -0
- package/dist/basemap/basemaps.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/trees.d.ts +26 -0
- package/dist/basemap/trees.js +141 -0
- package/dist/basemap/trees.js.map +1 -0
- package/dist/basemap/vectorstyle.d.ts +10 -0
- package/dist/basemap/vectorstyle.js +35 -0
- package/dist/basemap/vectorstyle.js.map +1 -1
- package/dist/basemap/vectortiles.d.ts +93 -44
- package/dist/basemap/vectortiles.js +511 -303
- package/dist/basemap/vectortiles.js.map +1 -1
- package/dist/basemap/workerpool.d.ts +17 -0
- package/dist/basemap/workerpool.js +203 -0
- package/dist/basemap/workerpool.js.map +1 -0
- package/dist/basemap.worker.js +2 -2
- package/dist/basemap.worker.js.map +18 -8
- package/dist/bind/layers.js +10 -0
- package/dist/bind/layers.js.map +1 -1
- package/dist/decoder.worker.js +4 -4
- package/dist/decoder.worker.js.map +3 -3
- package/dist/engine-loader.d.ts +8 -1
- package/dist/engine-loader.js +20 -1
- package/dist/engine-loader.js.map +1 -1
- package/dist/geoplateforme.d.ts +16 -0
- package/dist/geoplateforme.js +23 -0
- package/dist/geoplateforme.js.map +1 -1
- package/dist/grid-module.d.ts +44 -0
- package/dist/grid-module.js +63 -0
- package/dist/grid-module.js.map +1 -0
- package/dist/grids.d.ts +51 -0
- package/dist/grids.js +88 -0
- package/dist/grids.js.map +1 -0
- package/dist/index.d.ts +14 -4
- package/dist/index.js +11 -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_grid_bg.wasm +0 -0
- package/dist/isard_tess_bg.wasm +0 -0
- package/dist/layers/flow.d.ts +111 -0
- package/dist/layers/flow.js +222 -0
- package/dist/layers/flow.js.map +1 -0
- package/dist/layers/layers.js +9 -0
- package/dist/layers/layers.js.map +1 -1
- package/dist/layers/symbols.d.ts +2 -0
- package/dist/layers/symbols.js +2 -1
- 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/frame-loop.d.ts +3 -0
- package/dist/map/frame-loop.js +6 -0
- package/dist/map/frame-loop.js.map +1 -1
- package/dist/map/layer-spec.d.ts +4 -1
- package/dist/map/layer-spec.js +2 -0
- package/dist/map/layer-spec.js.map +1 -1
- package/dist/map/raster-source.js +1 -1
- package/dist/map/raster-source.js.map +1 -1
- package/dist/map/workers.d.ts +5 -1
- package/dist/map/workers.js +36 -1
- package/dist/map/workers.js.map +1 -1
- package/dist/map.d.ts +35 -6
- package/dist/map.js +83 -11
- package/dist/map.js.map +1 -1
- package/dist/react/IsardMap.js +1 -0
- package/dist/react/IsardMap.js.map +1 -1
- package/dist/react/Layer.d.ts +2 -0
- package/dist/react/Layer.js.map +1 -1
- package/dist/react/Swipe.d.ts +11 -4
- package/dist/react/Swipe.js +26 -15
- package/dist/react/Swipe.js.map +1 -1
- package/dist/react/VectorGeometry.d.ts +35 -0
- package/dist/react/VectorGeometry.js +82 -0
- package/dist/react/VectorGeometry.js.map +1 -0
- package/dist/react/context.d.ts +2 -1
- package/dist/react/context.js.map +1 -1
- package/dist/react/index.d.ts +2 -1
- package/dist/react/index.js +2 -1
- package/dist/react/index.js.map +1 -1
- package/dist/types.d.ts +30 -3
- package/dist/types.js.map +1 -1
- package/dist/ui/minimap.d.ts +25 -0
- package/dist/ui/minimap.js +90 -0
- package/dist/ui/minimap.js.map +1 -0
- package/dist/ui/scale.d.ts +19 -0
- package/dist/ui/scale.js +44 -0
- package/dist/ui/scale.js.map +1 -0
- package/dist/ui/search.d.ts +25 -0
- package/dist/ui/search.js +119 -0
- package/dist/ui/search.js.map +1 -0
- package/dist/ui/style.js +17 -0
- package/dist/ui/style.js.map +1 -1
- package/dist/util/sun.d.ts +11 -0
- package/dist/util/sun.js +26 -0
- package/dist/util/sun.js.map +1 -0
- package/dist/wasm/isard.d.ts +124 -7
- package/dist/wasm/isard.js +319 -8
- package/dist/wasm/isard_core.d.ts +124 -7
- package/dist/wasm/isard_core.js +319 -8
- package/dist/wasm/isard_grid.d.ts +101 -0
- package/dist/wasm/isard_grid.js +375 -0
- 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/street.d.ts +19 -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 +147 -22
- package/dist/workers/basemap.worker.js +93 -553
- package/dist/workers/basemap.worker.js.map +1 -1
- package/package.json +6 -4
- package/vite.js +11 -2
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The grids of a file
|
|
6
|
+
*/
|
|
7
|
+
export class GridSet {
|
|
8
|
+
private constructor();
|
|
9
|
+
free(): void;
|
|
10
|
+
/**
|
|
11
|
+
* How many grids
|
|
12
|
+
*/
|
|
13
|
+
count(): number;
|
|
14
|
+
/**
|
|
15
|
+
* Grid `i`'s description: name, standard name, units, level, time, width, height, bounds (JSON)
|
|
16
|
+
*/
|
|
17
|
+
meta(i: number): string;
|
|
18
|
+
/**
|
|
19
|
+
* Grid `i`'s values, row after row from the north
|
|
20
|
+
*/
|
|
21
|
+
values(i: number): Float32Array;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The flows of a city's streets for a wind of 1 m/s from the west and one from the south (see `street`): the east and
|
|
26
|
+
* north velocities of each, `width` × `height` cells each
|
|
27
|
+
*/
|
|
28
|
+
export class StreetFlow {
|
|
29
|
+
private constructor();
|
|
30
|
+
free(): void;
|
|
31
|
+
/**
|
|
32
|
+
* The flow of a wind towards the east: its east velocities, then its north ones
|
|
33
|
+
*/
|
|
34
|
+
eastU(): Float32Array;
|
|
35
|
+
eastV(): Float32Array;
|
|
36
|
+
/**
|
|
37
|
+
* The flow of a wind towards the north: its east velocities, then its north ones
|
|
38
|
+
*/
|
|
39
|
+
northU(): Float32Array;
|
|
40
|
+
northV(): Float32Array;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The grids of a GRIB2 or classic NetCDF file
|
|
45
|
+
*
|
|
46
|
+
* # Errors
|
|
47
|
+
*
|
|
48
|
+
* Throws (to JavaScript) when the file is of neither kind, malformed, or packed in a way not read
|
|
49
|
+
*/
|
|
50
|
+
export function readGrids(bytes: Uint8Array): GridSet;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The flows of the streets of a grid of `width` × `height` cells round the buildings of `points` (their rings in
|
|
54
|
+
* cells, from the north-west corner, interleaved; `ring_start` the first point of each ring and the end,
|
|
55
|
+
* `polygon_start` the first ring of each polygon and the end), after `iterations` sweeps
|
|
56
|
+
*/
|
|
57
|
+
export function streetFlow(points: Float64Array, ring_start: Uint32Array, polygon_start: Uint32Array, width: number, height: number, iterations: number): StreetFlow;
|
|
58
|
+
|
|
59
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
60
|
+
|
|
61
|
+
export interface InitOutput {
|
|
62
|
+
readonly memory: WebAssembly.Memory;
|
|
63
|
+
readonly __wbg_gridset_free: (a: number, b: number) => void;
|
|
64
|
+
readonly __wbg_streetflow_free: (a: number, b: number) => void;
|
|
65
|
+
readonly gridset_count: (a: number) => number;
|
|
66
|
+
readonly gridset_meta: (a: number, b: number) => [number, number];
|
|
67
|
+
readonly gridset_values: (a: number, b: number) => any;
|
|
68
|
+
readonly readGrids: (a: number, b: number) => [number, number, number];
|
|
69
|
+
readonly streetFlow: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => number;
|
|
70
|
+
readonly streetflow_eastU: (a: number) => any;
|
|
71
|
+
readonly streetflow_eastV: (a: number) => any;
|
|
72
|
+
readonly streetflow_northU: (a: number) => any;
|
|
73
|
+
readonly streetflow_northV: (a: number) => any;
|
|
74
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
75
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
76
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
77
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
78
|
+
readonly __wbindgen_start: () => void;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
85
|
+
* a precompiled `WebAssembly.Module`.
|
|
86
|
+
*
|
|
87
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
88
|
+
*
|
|
89
|
+
* @returns {InitOutput}
|
|
90
|
+
*/
|
|
91
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
95
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
96
|
+
*
|
|
97
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
98
|
+
*
|
|
99
|
+
* @returns {Promise<InitOutput>}
|
|
100
|
+
*/
|
|
101
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
/* @ts-self-types="./isard_grid.d.ts" */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The grids of a file
|
|
5
|
+
*/
|
|
6
|
+
export class GridSet {
|
|
7
|
+
static __wrap(ptr) {
|
|
8
|
+
const obj = Object.create(GridSet.prototype);
|
|
9
|
+
obj.__wbg_ptr = ptr;
|
|
10
|
+
GridSetFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
11
|
+
return obj;
|
|
12
|
+
}
|
|
13
|
+
__destroy_into_raw() {
|
|
14
|
+
const ptr = this.__wbg_ptr;
|
|
15
|
+
this.__wbg_ptr = 0;
|
|
16
|
+
GridSetFinalization.unregister(this);
|
|
17
|
+
return ptr;
|
|
18
|
+
}
|
|
19
|
+
free() {
|
|
20
|
+
const ptr = this.__destroy_into_raw();
|
|
21
|
+
wasm.__wbg_gridset_free(ptr, 0);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* How many grids
|
|
25
|
+
* @returns {number}
|
|
26
|
+
*/
|
|
27
|
+
count() {
|
|
28
|
+
const ret = wasm.gridset_count(this.__wbg_ptr);
|
|
29
|
+
return ret >>> 0;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Grid `i`'s description: name, standard name, units, level, time, width, height, bounds (JSON)
|
|
33
|
+
* @param {number} i
|
|
34
|
+
* @returns {string}
|
|
35
|
+
*/
|
|
36
|
+
meta(i) {
|
|
37
|
+
let deferred1_0;
|
|
38
|
+
let deferred1_1;
|
|
39
|
+
try {
|
|
40
|
+
const ret = wasm.gridset_meta(this.__wbg_ptr, i);
|
|
41
|
+
deferred1_0 = ret[0];
|
|
42
|
+
deferred1_1 = ret[1];
|
|
43
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
44
|
+
} finally {
|
|
45
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Grid `i`'s values, row after row from the north
|
|
50
|
+
* @param {number} i
|
|
51
|
+
* @returns {Float32Array}
|
|
52
|
+
*/
|
|
53
|
+
values(i) {
|
|
54
|
+
const ret = wasm.gridset_values(this.__wbg_ptr, i);
|
|
55
|
+
return ret;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (Symbol.dispose) GridSet.prototype[Symbol.dispose] = GridSet.prototype.free;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The flows of a city's streets for a wind of 1 m/s from the west and one from the south (see `street`): the east and
|
|
62
|
+
* north velocities of each, `width` × `height` cells each
|
|
63
|
+
*/
|
|
64
|
+
export class StreetFlow {
|
|
65
|
+
static __wrap(ptr) {
|
|
66
|
+
const obj = Object.create(StreetFlow.prototype);
|
|
67
|
+
obj.__wbg_ptr = ptr;
|
|
68
|
+
StreetFlowFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
69
|
+
return obj;
|
|
70
|
+
}
|
|
71
|
+
__destroy_into_raw() {
|
|
72
|
+
const ptr = this.__wbg_ptr;
|
|
73
|
+
this.__wbg_ptr = 0;
|
|
74
|
+
StreetFlowFinalization.unregister(this);
|
|
75
|
+
return ptr;
|
|
76
|
+
}
|
|
77
|
+
free() {
|
|
78
|
+
const ptr = this.__destroy_into_raw();
|
|
79
|
+
wasm.__wbg_streetflow_free(ptr, 0);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* The flow of a wind towards the east: its east velocities, then its north ones
|
|
83
|
+
* @returns {Float32Array}
|
|
84
|
+
*/
|
|
85
|
+
eastU() {
|
|
86
|
+
const ret = wasm.streetflow_eastU(this.__wbg_ptr);
|
|
87
|
+
return ret;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* @returns {Float32Array}
|
|
91
|
+
*/
|
|
92
|
+
eastV() {
|
|
93
|
+
const ret = wasm.streetflow_eastV(this.__wbg_ptr);
|
|
94
|
+
return ret;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* The flow of a wind towards the north: its east velocities, then its north ones
|
|
98
|
+
* @returns {Float32Array}
|
|
99
|
+
*/
|
|
100
|
+
northU() {
|
|
101
|
+
const ret = wasm.streetflow_northU(this.__wbg_ptr);
|
|
102
|
+
return ret;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* @returns {Float32Array}
|
|
106
|
+
*/
|
|
107
|
+
northV() {
|
|
108
|
+
const ret = wasm.streetflow_northV(this.__wbg_ptr);
|
|
109
|
+
return ret;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (Symbol.dispose) StreetFlow.prototype[Symbol.dispose] = StreetFlow.prototype.free;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* The grids of a GRIB2 or classic NetCDF file
|
|
116
|
+
*
|
|
117
|
+
* # Errors
|
|
118
|
+
*
|
|
119
|
+
* Throws (to JavaScript) when the file is of neither kind, malformed, or packed in a way not read
|
|
120
|
+
* @param {Uint8Array} bytes
|
|
121
|
+
* @returns {GridSet}
|
|
122
|
+
*/
|
|
123
|
+
export function readGrids(bytes) {
|
|
124
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
125
|
+
const len0 = WASM_VECTOR_LEN;
|
|
126
|
+
const ret = wasm.readGrids(ptr0, len0);
|
|
127
|
+
if (ret[2]) {
|
|
128
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
129
|
+
}
|
|
130
|
+
return GridSet.__wrap(ret[0]);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* The flows of the streets of a grid of `width` × `height` cells round the buildings of `points` (their rings in
|
|
135
|
+
* cells, from the north-west corner, interleaved; `ring_start` the first point of each ring and the end,
|
|
136
|
+
* `polygon_start` the first ring of each polygon and the end), after `iterations` sweeps
|
|
137
|
+
* @param {Float64Array} points
|
|
138
|
+
* @param {Uint32Array} ring_start
|
|
139
|
+
* @param {Uint32Array} polygon_start
|
|
140
|
+
* @param {number} width
|
|
141
|
+
* @param {number} height
|
|
142
|
+
* @param {number} iterations
|
|
143
|
+
* @returns {StreetFlow}
|
|
144
|
+
*/
|
|
145
|
+
export function streetFlow(points, ring_start, polygon_start, width, height, iterations) {
|
|
146
|
+
const ptr0 = passArrayF64ToWasm0(points, wasm.__wbindgen_malloc);
|
|
147
|
+
const len0 = WASM_VECTOR_LEN;
|
|
148
|
+
const ptr1 = passArray32ToWasm0(ring_start, wasm.__wbindgen_malloc);
|
|
149
|
+
const len1 = WASM_VECTOR_LEN;
|
|
150
|
+
const ptr2 = passArray32ToWasm0(polygon_start, wasm.__wbindgen_malloc);
|
|
151
|
+
const len2 = WASM_VECTOR_LEN;
|
|
152
|
+
const ret = wasm.streetFlow(ptr0, len0, ptr1, len1, ptr2, len2, width, height, iterations);
|
|
153
|
+
return StreetFlow.__wrap(ret);
|
|
154
|
+
}
|
|
155
|
+
function __wbg_get_imports() {
|
|
156
|
+
const import0 = {
|
|
157
|
+
__proto__: null,
|
|
158
|
+
__wbg___wbindgen_throw_41e9ee4f547fc59a: function(arg0, arg1) {
|
|
159
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
160
|
+
},
|
|
161
|
+
__wbg_new_from_slice_ca6ad97db1f4779a: function(arg0, arg1) {
|
|
162
|
+
const ret = new Float32Array(getArrayF32FromWasm0(arg0, arg1));
|
|
163
|
+
return ret;
|
|
164
|
+
},
|
|
165
|
+
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
166
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
167
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
168
|
+
return ret;
|
|
169
|
+
},
|
|
170
|
+
__wbindgen_init_externref_table: function() {
|
|
171
|
+
const table = wasm.__wbindgen_externrefs;
|
|
172
|
+
const offset = table.grow(4);
|
|
173
|
+
table.set(0, undefined);
|
|
174
|
+
table.set(offset + 0, undefined);
|
|
175
|
+
table.set(offset + 1, null);
|
|
176
|
+
table.set(offset + 2, true);
|
|
177
|
+
table.set(offset + 3, false);
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
return {
|
|
181
|
+
__proto__: null,
|
|
182
|
+
"./isard_grid_bg.js": import0,
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const GridSetFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
187
|
+
? { register: () => {}, unregister: () => {} }
|
|
188
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_gridset_free(ptr, 1));
|
|
189
|
+
const StreetFlowFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
190
|
+
? { register: () => {}, unregister: () => {} }
|
|
191
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_streetflow_free(ptr, 1));
|
|
192
|
+
|
|
193
|
+
function getArrayF32FromWasm0(ptr, len) {
|
|
194
|
+
ptr = ptr >>> 0;
|
|
195
|
+
return getFloat32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
let cachedFloat32ArrayMemory0 = null;
|
|
199
|
+
function getFloat32ArrayMemory0() {
|
|
200
|
+
if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) {
|
|
201
|
+
cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer);
|
|
202
|
+
}
|
|
203
|
+
return cachedFloat32ArrayMemory0;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
let cachedFloat64ArrayMemory0 = null;
|
|
207
|
+
function getFloat64ArrayMemory0() {
|
|
208
|
+
if (cachedFloat64ArrayMemory0 === null || cachedFloat64ArrayMemory0.byteLength === 0) {
|
|
209
|
+
cachedFloat64ArrayMemory0 = new Float64Array(wasm.memory.buffer);
|
|
210
|
+
}
|
|
211
|
+
return cachedFloat64ArrayMemory0;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function getStringFromWasm0(ptr, len) {
|
|
215
|
+
return decodeText(ptr >>> 0, len);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
let cachedUint32ArrayMemory0 = null;
|
|
219
|
+
function getUint32ArrayMemory0() {
|
|
220
|
+
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
221
|
+
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
222
|
+
}
|
|
223
|
+
return cachedUint32ArrayMemory0;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
let cachedUint8ArrayMemory0 = null;
|
|
227
|
+
function getUint8ArrayMemory0() {
|
|
228
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
229
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
230
|
+
}
|
|
231
|
+
return cachedUint8ArrayMemory0;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function passArray32ToWasm0(arg, malloc) {
|
|
235
|
+
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
236
|
+
getUint32ArrayMemory0().set(arg, ptr / 4);
|
|
237
|
+
WASM_VECTOR_LEN = arg.length;
|
|
238
|
+
return ptr;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
242
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
243
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
244
|
+
WASM_VECTOR_LEN = arg.length;
|
|
245
|
+
return ptr;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
function passArrayF64ToWasm0(arg, malloc) {
|
|
249
|
+
const ptr = malloc(arg.length * 8, 8) >>> 0;
|
|
250
|
+
getFloat64ArrayMemory0().set(arg, ptr / 8);
|
|
251
|
+
WASM_VECTOR_LEN = arg.length;
|
|
252
|
+
return ptr;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
function takeFromExternrefTable0(idx) {
|
|
256
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
257
|
+
wasm.__externref_table_dealloc(idx);
|
|
258
|
+
return value;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
262
|
+
cachedTextDecoder.decode();
|
|
263
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
264
|
+
let numBytesDecoded = 0;
|
|
265
|
+
function decodeText(ptr, len) {
|
|
266
|
+
numBytesDecoded += len;
|
|
267
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
268
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
269
|
+
cachedTextDecoder.decode();
|
|
270
|
+
numBytesDecoded = len;
|
|
271
|
+
}
|
|
272
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
let WASM_VECTOR_LEN = 0;
|
|
276
|
+
|
|
277
|
+
let wasmModule, wasmInstance, wasm;
|
|
278
|
+
function __wbg_finalize_init(instance, module) {
|
|
279
|
+
wasmInstance = instance;
|
|
280
|
+
wasm = instance.exports;
|
|
281
|
+
wasmModule = module;
|
|
282
|
+
cachedFloat32ArrayMemory0 = null;
|
|
283
|
+
cachedFloat64ArrayMemory0 = null;
|
|
284
|
+
cachedUint32ArrayMemory0 = null;
|
|
285
|
+
cachedUint8ArrayMemory0 = null;
|
|
286
|
+
wasm.__wbindgen_start();
|
|
287
|
+
return wasm;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
async function __wbg_load(module, imports) {
|
|
291
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
292
|
+
if (!module.ok) {
|
|
293
|
+
throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
297
|
+
try {
|
|
298
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
299
|
+
} catch (e) {
|
|
300
|
+
const validResponse = expectedResponseType(module.type);
|
|
301
|
+
|
|
302
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
303
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
304
|
+
|
|
305
|
+
} else { throw e; }
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
const bytes = await module.arrayBuffer();
|
|
310
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
311
|
+
} else {
|
|
312
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
313
|
+
|
|
314
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
315
|
+
return { instance, module };
|
|
316
|
+
} else {
|
|
317
|
+
return instance;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
function expectedResponseType(type) {
|
|
322
|
+
switch (type) {
|
|
323
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
324
|
+
}
|
|
325
|
+
return false;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
function initSync(module) {
|
|
330
|
+
if (wasm !== undefined) return wasm;
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
if (module !== undefined) {
|
|
334
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
335
|
+
({module} = module)
|
|
336
|
+
} else {
|
|
337
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
const imports = __wbg_get_imports();
|
|
342
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
343
|
+
module = new WebAssembly.Module(module);
|
|
344
|
+
}
|
|
345
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
346
|
+
return __wbg_finalize_init(instance, module);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
async function __wbg_init(module_or_path) {
|
|
350
|
+
if (wasm !== undefined) return wasm;
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
if (module_or_path !== undefined) {
|
|
354
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
355
|
+
({module_or_path} = module_or_path)
|
|
356
|
+
} else {
|
|
357
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
if (module_or_path === undefined) {
|
|
362
|
+
module_or_path = new URL('isard_grid_bg.wasm', import.meta.url);
|
|
363
|
+
}
|
|
364
|
+
const imports = __wbg_get_imports();
|
|
365
|
+
|
|
366
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
367
|
+
module_or_path = fetch(module_or_path);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
371
|
+
|
|
372
|
+
return __wbg_finalize_init(instance, module);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
export { initSync, __wbg_init as default };
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A vector tile ready for the GPU (`geo::mesh::vector_tiles::TileMesh`), as the engine's `setVectorTileMesh` takes it
|
|
6
|
+
*/
|
|
7
|
+
export class TessellatedTile {
|
|
8
|
+
private constructor();
|
|
9
|
+
free(): void;
|
|
10
|
+
/**
|
|
11
|
+
* Their triangles
|
|
12
|
+
*/
|
|
13
|
+
blockIndices(): Uint32Array;
|
|
14
|
+
/**
|
|
15
|
+
* Per sublayer: its blocks' indices, first and end
|
|
16
|
+
*/
|
|
17
|
+
blockRanges(): Uint32Array;
|
|
18
|
+
/**
|
|
19
|
+
* The blocks of the raised sublayers (`shapes::Block`, 32 bytes each), as bytes
|
|
20
|
+
*/
|
|
21
|
+
blocks(): Uint8Array;
|
|
22
|
+
/**
|
|
23
|
+
* The extent of the tile's points: min x, min y, max x, max y
|
|
24
|
+
*/
|
|
25
|
+
bounds(): Float64Array;
|
|
26
|
+
/**
|
|
27
|
+
* Per sublayer: its top cap and the rest of its prism, first and end of each (four numbers)
|
|
28
|
+
*/
|
|
29
|
+
fillRanges(): Uint32Array;
|
|
30
|
+
/**
|
|
31
|
+
* The fill triangles
|
|
32
|
+
*/
|
|
33
|
+
indices(): Uint32Array;
|
|
34
|
+
/**
|
|
35
|
+
* Per sublayer: its pieces, first and end
|
|
36
|
+
*/
|
|
37
|
+
lineRanges(): Uint32Array;
|
|
38
|
+
/**
|
|
39
|
+
* Feature and length of each line
|
|
40
|
+
*/
|
|
41
|
+
lineTable(): Float32Array;
|
|
42
|
+
/**
|
|
43
|
+
* The line pieces (`pieces::Piece`, 28 bytes each), as bytes
|
|
44
|
+
*/
|
|
45
|
+
pieces(): Uint8Array;
|
|
46
|
+
/**
|
|
47
|
+
* Whether the prisms were built
|
|
48
|
+
*/
|
|
49
|
+
prism(): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* The fill vertices (`shapes::Vertex`, 24 bytes each), as bytes
|
|
52
|
+
*/
|
|
53
|
+
vertices(): Uint8Array;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The geometry of a vector tile made ready for the GPU, as the engine's `setVectorTile` takes it: its polygons
|
|
58
|
+
* (interleaved points, `ring_start`, `polygon_start`, the feature of each, `fill_start`: the first polygon of each
|
|
59
|
+
* sublayer and the end), its lines (interleaved points, `line_first`: the first point of each, the feature of each,
|
|
60
|
+
* `line_start`: the first line of each sublayer and the end); `raised`: per sublayer, whether its polygons are extruded
|
|
61
|
+
* into blocks rather than filled; `prism`: with the prisms the fills need over the relief; `tile`: the corners of the
|
|
62
|
+
* tile they are cut to (west, north, east, south, Mercator; empty: none), along whose edges no wall of a block rises
|
|
63
|
+
*/
|
|
64
|
+
export function tessellateVectorTile(points: Float64Array, ring_start: Uint32Array, polygon_start: Uint32Array, polygon_feature: Uint32Array, fill_start: Uint32Array, line_points: Float64Array, line_first: Uint32Array, line_feature: Uint32Array, line_start: Uint32Array, raised: Uint8Array, prism: boolean, tile: Float64Array): TessellatedTile;
|
|
65
|
+
|
|
66
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
67
|
+
|
|
68
|
+
export interface InitOutput {
|
|
69
|
+
readonly memory: WebAssembly.Memory;
|
|
70
|
+
readonly __wbg_tessellatedtile_free: (a: number, b: number) => void;
|
|
71
|
+
readonly tessellateVectorTile: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number) => number;
|
|
72
|
+
readonly tessellatedtile_blockIndices: (a: number) => any;
|
|
73
|
+
readonly tessellatedtile_blockRanges: (a: number) => [number, number];
|
|
74
|
+
readonly tessellatedtile_blocks: (a: number) => any;
|
|
75
|
+
readonly tessellatedtile_bounds: (a: number) => [number, number];
|
|
76
|
+
readonly tessellatedtile_fillRanges: (a: number) => [number, number];
|
|
77
|
+
readonly tessellatedtile_indices: (a: number) => any;
|
|
78
|
+
readonly tessellatedtile_lineRanges: (a: number) => [number, number];
|
|
79
|
+
readonly tessellatedtile_lineTable: (a: number) => any;
|
|
80
|
+
readonly tessellatedtile_pieces: (a: number) => any;
|
|
81
|
+
readonly tessellatedtile_prism: (a: number) => number;
|
|
82
|
+
readonly tessellatedtile_vertices: (a: number) => any;
|
|
83
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
84
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
85
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
86
|
+
readonly __wbindgen_start: () => void;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
93
|
+
* a precompiled `WebAssembly.Module`.
|
|
94
|
+
*
|
|
95
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
96
|
+
*
|
|
97
|
+
* @returns {InitOutput}
|
|
98
|
+
*/
|
|
99
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
103
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
104
|
+
*
|
|
105
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
106
|
+
*
|
|
107
|
+
* @returns {Promise<InitOutput>}
|
|
108
|
+
*/
|
|
109
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|