@reearth/ezu 0.6.1 → 0.8.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/README.md +5 -0
- package/bundler/ezu.d.ts +45 -0
- package/bundler/ezu_bg.js +85 -0
- package/bundler/ezu_bg.wasm +0 -0
- package/bundler/ezu_bg.wasm.d.ts +3 -0
- package/nodejs/ezu.d.ts +45 -0
- package/nodejs/ezu.js +85 -0
- package/nodejs/ezu_bg.wasm +0 -0
- package/nodejs/ezu_bg.wasm.d.ts +3 -0
- package/package.json +1 -1
- package/simd/bundler/ezu.d.ts +45 -0
- package/simd/bundler/ezu_bg.js +85 -0
- package/simd/bundler/ezu_bg.wasm +0 -0
- package/simd/bundler/ezu_bg.wasm.d.ts +3 -0
- package/simd/nodejs/ezu.d.ts +45 -0
- package/simd/nodejs/ezu.js +85 -0
- package/simd/nodejs/ezu_bg.wasm +0 -0
- package/simd/nodejs/ezu_bg.wasm.d.ts +3 -0
- package/simd/web/ezu.d.ts +48 -0
- package/simd/web/ezu.js +85 -0
- package/simd/web/ezu_bg.wasm +0 -0
- package/simd/web/ezu_bg.wasm.d.ts +3 -0
- package/web/ezu.d.ts +48 -0
- package/web/ezu.js +85 -0
- package/web/ezu_bg.wasm +0 -0
- package/web/ezu_bg.wasm.d.ts +3 -0
package/web/ezu.d.ts
CHANGED
|
@@ -111,6 +111,16 @@ export class Renderer {
|
|
|
111
111
|
* Drop every pending source binding. Call between tile renders.
|
|
112
112
|
*/
|
|
113
113
|
clearSources(): void;
|
|
114
|
+
/**
|
|
115
|
+
* The style's declared `legend`, or `undefined` when it declares
|
|
116
|
+
* none. Pass a zoom to keep only the entries that apply there.
|
|
117
|
+
*
|
|
118
|
+
* Entries name the node that draws the symbol rather than restating
|
|
119
|
+
* a colour, so a host lays out the labels and asks the map itself
|
|
120
|
+
* for the swatches. The CLI's `ezu legend` renders those swatches;
|
|
121
|
+
* in a browser, render the named node.
|
|
122
|
+
*/
|
|
123
|
+
legend(zoom?: number | null): any;
|
|
114
124
|
/**
|
|
115
125
|
* What this renderer is holding, in bytes, so a host can shed load
|
|
116
126
|
* *before* an allocation fails rather than after.
|
|
@@ -200,6 +210,10 @@ export class Renderer {
|
|
|
200
210
|
* - `format`: `"png"` (default) / `"webp"` / `"rgba"`
|
|
201
211
|
* - `tileSize`, `pad`: override the style's canvas size for this
|
|
202
212
|
* call (hi-DPI / preview)
|
|
213
|
+
* - `params`: `{ name: number | boolean | string }` — render-time
|
|
214
|
+
* overrides for the style's declared `params`, validated the same
|
|
215
|
+
* way the CLI's `--param` is. Omitted names keep their declared
|
|
216
|
+
* default.
|
|
203
217
|
* - `png`: `{ compression?: "fast" | "default" | "best" }`
|
|
204
218
|
*/
|
|
205
219
|
renderTile(z: number, x: number, y: number, opts?: object | null): Uint8Array;
|
|
@@ -216,6 +230,11 @@ export class Renderer {
|
|
|
216
230
|
* fetches exactly what the recipe needs. An empty array means the
|
|
217
231
|
* centre tile is enough.
|
|
218
232
|
*
|
|
233
|
+
* A `dem` or `raster` source that declares `neighbor-fetch: false`
|
|
234
|
+
* reports no offsets whatever the graph asks for: the style has said
|
|
235
|
+
* not to stitch a neighbourhood for it, and this list is what a host
|
|
236
|
+
* fetches from.
|
|
237
|
+
*
|
|
219
238
|
* Throws `UnknownSource` if `name` is not declared in the style.
|
|
220
239
|
*/
|
|
221
240
|
requestedNeighborOffsets(name: string): Array<any>;
|
|
@@ -249,12 +268,38 @@ export class Renderer {
|
|
|
249
268
|
* the intermediate cache and drops any pending source bindings.
|
|
250
269
|
*/
|
|
251
270
|
setStyle(style_json: string): number;
|
|
271
|
+
/**
|
|
272
|
+
* The tile a host should actually fetch from `name` in order to draw
|
|
273
|
+
* `z/x/y`, as `{ z, x, y }`.
|
|
274
|
+
*
|
|
275
|
+
* For a source that declares `max-zoom`, a request past the ceiling
|
|
276
|
+
* answers with the covering ancestor — bind those bytes with
|
|
277
|
+
* `{ sourceZoom: <returned z> }` and the renderer resamples or
|
|
278
|
+
* reprojects them into the requested tile. Below the ceiling, and for
|
|
279
|
+
* a source that declares no ceiling, the answer is the tile itself.
|
|
280
|
+
*
|
|
281
|
+
* This exists so the ceiling lives in one place. A host that hard-codes
|
|
282
|
+
* the maxzoom of each source keeps a second copy of something the style
|
|
283
|
+
* already states, and the two drift.
|
|
284
|
+
*
|
|
285
|
+
* Throws `UnknownSource` if `name` is not declared in the style.
|
|
286
|
+
*/
|
|
287
|
+
sourceTile(name: string, z: number, x: number, y: number): any;
|
|
252
288
|
/**
|
|
253
289
|
* Effective attribution declared by the style (document +
|
|
254
290
|
* sources), joined with ` | `. Upstream TileJSON / PMTiles
|
|
255
291
|
* metadata is the JS host's concern — merge it on that side.
|
|
256
292
|
*/
|
|
257
293
|
readonly attribution: string | undefined;
|
|
294
|
+
/**
|
|
295
|
+
* JSON Schema for the current style's `params` — types, defaults,
|
|
296
|
+
* ranges, descriptions. The same document the CLI's tile server
|
|
297
|
+
* serves at `/style/params`. Generate sliders and colour pickers
|
|
298
|
+
* from this rather than parsing the style; it follows `setStyle`,
|
|
299
|
+
* so a params panel driven off it cannot drift from the graph
|
|
300
|
+
* being rendered.
|
|
301
|
+
*/
|
|
302
|
+
readonly paramsSchema: any;
|
|
258
303
|
/**
|
|
259
304
|
* `tile-size` declared by the current style.
|
|
260
305
|
*/
|
|
@@ -310,14 +355,17 @@ export interface InitOutput {
|
|
|
310
355
|
readonly renderer_bindSource: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
|
|
311
356
|
readonly renderer_boundSources: (a: number) => [number, number];
|
|
312
357
|
readonly renderer_clearSources: (a: number) => void;
|
|
358
|
+
readonly renderer_legend: (a: number, b: number) => [number, number, number];
|
|
313
359
|
readonly renderer_memoryUsage: (a: number) => [number, number, number];
|
|
314
360
|
readonly renderer_neededCodepoints: (a: number) => [number, number, number];
|
|
315
361
|
readonly renderer_neededGlyphRanges: (a: number) => [number, number, number];
|
|
316
362
|
readonly renderer_new: (a: number, b: number) => [number, number, number];
|
|
363
|
+
readonly renderer_paramsSchema: (a: number) => [number, number, number];
|
|
317
364
|
readonly renderer_renderTile: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
|
|
318
365
|
readonly renderer_requestedNeighborOffsets: (a: number, b: number, c: number) => [number, number, number];
|
|
319
366
|
readonly renderer_setGlyphBudget: (a: number, b: number) => void;
|
|
320
367
|
readonly renderer_setStyle: (a: number, b: number, c: number) => [number, number, number];
|
|
368
|
+
readonly renderer_sourceTile: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
321
369
|
readonly renderer_tileSize: (a: number) => number;
|
|
322
370
|
readonly simdEnabled: () => number;
|
|
323
371
|
readonly threadsEnabled: () => number;
|
package/web/ezu.js
CHANGED
|
@@ -199,6 +199,24 @@ export class Renderer {
|
|
|
199
199
|
clearSources() {
|
|
200
200
|
wasm.renderer_clearSources(this.__wbg_ptr);
|
|
201
201
|
}
|
|
202
|
+
/**
|
|
203
|
+
* The style's declared `legend`, or `undefined` when it declares
|
|
204
|
+
* none. Pass a zoom to keep only the entries that apply there.
|
|
205
|
+
*
|
|
206
|
+
* Entries name the node that draws the symbol rather than restating
|
|
207
|
+
* a colour, so a host lays out the labels and asks the map itself
|
|
208
|
+
* for the swatches. The CLI's `ezu legend` renders those swatches;
|
|
209
|
+
* in a browser, render the named node.
|
|
210
|
+
* @param {number | null} [zoom]
|
|
211
|
+
* @returns {any}
|
|
212
|
+
*/
|
|
213
|
+
legend(zoom) {
|
|
214
|
+
const ret = wasm.renderer_legend(this.__wbg_ptr, isLikeNone(zoom) ? 0xFFFFFF : zoom);
|
|
215
|
+
if (ret[2]) {
|
|
216
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
217
|
+
}
|
|
218
|
+
return takeFromExternrefTable0(ret[0]);
|
|
219
|
+
}
|
|
202
220
|
/**
|
|
203
221
|
* What this renderer is holding, in bytes, so a host can shed load
|
|
204
222
|
* *before* an allocation fails rather than after.
|
|
@@ -313,6 +331,22 @@ export class Renderer {
|
|
|
313
331
|
RendererFinalization.register(this, this.__wbg_ptr, this);
|
|
314
332
|
return this;
|
|
315
333
|
}
|
|
334
|
+
/**
|
|
335
|
+
* JSON Schema for the current style's `params` — types, defaults,
|
|
336
|
+
* ranges, descriptions. The same document the CLI's tile server
|
|
337
|
+
* serves at `/style/params`. Generate sliders and colour pickers
|
|
338
|
+
* from this rather than parsing the style; it follows `setStyle`,
|
|
339
|
+
* so a params panel driven off it cannot drift from the graph
|
|
340
|
+
* being rendered.
|
|
341
|
+
* @returns {any}
|
|
342
|
+
*/
|
|
343
|
+
get paramsSchema() {
|
|
344
|
+
const ret = wasm.renderer_paramsSchema(this.__wbg_ptr);
|
|
345
|
+
if (ret[2]) {
|
|
346
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
347
|
+
}
|
|
348
|
+
return takeFromExternrefTable0(ret[0]);
|
|
349
|
+
}
|
|
316
350
|
/**
|
|
317
351
|
* Render a single tile using whatever sources are currently bound.
|
|
318
352
|
*
|
|
@@ -320,6 +354,10 @@ export class Renderer {
|
|
|
320
354
|
* - `format`: `"png"` (default) / `"webp"` / `"rgba"`
|
|
321
355
|
* - `tileSize`, `pad`: override the style's canvas size for this
|
|
322
356
|
* call (hi-DPI / preview)
|
|
357
|
+
* - `params`: `{ name: number | boolean | string }` — render-time
|
|
358
|
+
* overrides for the style's declared `params`, validated the same
|
|
359
|
+
* way the CLI's `--param` is. Omitted names keep their declared
|
|
360
|
+
* default.
|
|
323
361
|
* - `png`: `{ compression?: "fast" | "default" | "best" }`
|
|
324
362
|
* @param {number} z
|
|
325
363
|
* @param {number} x
|
|
@@ -349,6 +387,11 @@ export class Renderer {
|
|
|
349
387
|
* fetches exactly what the recipe needs. An empty array means the
|
|
350
388
|
* centre tile is enough.
|
|
351
389
|
*
|
|
390
|
+
* A `dem` or `raster` source that declares `neighbor-fetch: false`
|
|
391
|
+
* reports no offsets whatever the graph asks for: the style has said
|
|
392
|
+
* not to stitch a neighbourhood for it, and this list is what a host
|
|
393
|
+
* fetches from.
|
|
394
|
+
*
|
|
352
395
|
* Throws `UnknownSource` if `name` is not declared in the style.
|
|
353
396
|
* @param {string} name
|
|
354
397
|
* @returns {Array<any>}
|
|
@@ -405,6 +448,36 @@ export class Renderer {
|
|
|
405
448
|
}
|
|
406
449
|
return ret[0] >>> 0;
|
|
407
450
|
}
|
|
451
|
+
/**
|
|
452
|
+
* The tile a host should actually fetch from `name` in order to draw
|
|
453
|
+
* `z/x/y`, as `{ z, x, y }`.
|
|
454
|
+
*
|
|
455
|
+
* For a source that declares `max-zoom`, a request past the ceiling
|
|
456
|
+
* answers with the covering ancestor — bind those bytes with
|
|
457
|
+
* `{ sourceZoom: <returned z> }` and the renderer resamples or
|
|
458
|
+
* reprojects them into the requested tile. Below the ceiling, and for
|
|
459
|
+
* a source that declares no ceiling, the answer is the tile itself.
|
|
460
|
+
*
|
|
461
|
+
* This exists so the ceiling lives in one place. A host that hard-codes
|
|
462
|
+
* the maxzoom of each source keeps a second copy of something the style
|
|
463
|
+
* already states, and the two drift.
|
|
464
|
+
*
|
|
465
|
+
* Throws `UnknownSource` if `name` is not declared in the style.
|
|
466
|
+
* @param {string} name
|
|
467
|
+
* @param {number} z
|
|
468
|
+
* @param {number} x
|
|
469
|
+
* @param {number} y
|
|
470
|
+
* @returns {any}
|
|
471
|
+
*/
|
|
472
|
+
sourceTile(name, z, x, y) {
|
|
473
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
474
|
+
const len0 = WASM_VECTOR_LEN;
|
|
475
|
+
const ret = wasm.renderer_sourceTile(this.__wbg_ptr, ptr0, len0, z, x, y);
|
|
476
|
+
if (ret[2]) {
|
|
477
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
478
|
+
}
|
|
479
|
+
return takeFromExternrefTable0(ret[0]);
|
|
480
|
+
}
|
|
408
481
|
/**
|
|
409
482
|
* `tile-size` declared by the current style.
|
|
410
483
|
* @returns {number}
|
|
@@ -516,6 +589,10 @@ function __wbg_get_imports() {
|
|
|
516
589
|
const ret = Reflect.get(arg0, arg1);
|
|
517
590
|
return ret;
|
|
518
591
|
}, arguments); },
|
|
592
|
+
__wbg_get_unchecked_6e0ad6d2a41b06f6: function(arg0, arg1) {
|
|
593
|
+
const ret = arg0[arg1 >>> 0];
|
|
594
|
+
return ret;
|
|
595
|
+
},
|
|
519
596
|
__wbg_instanceof_Object_33f20e6f12439f3e: function(arg0) {
|
|
520
597
|
let result;
|
|
521
598
|
try {
|
|
@@ -530,6 +607,10 @@ function __wbg_get_imports() {
|
|
|
530
607
|
const ret = Array.isArray(arg0);
|
|
531
608
|
return ret;
|
|
532
609
|
},
|
|
610
|
+
__wbg_keys_58421f8f96795607: function(arg0) {
|
|
611
|
+
const ret = Object.keys(arg0);
|
|
612
|
+
return ret;
|
|
613
|
+
},
|
|
533
614
|
__wbg_length_370319915dc99107: function(arg0) {
|
|
534
615
|
const ret = arg0.length;
|
|
535
616
|
return ret;
|
|
@@ -554,6 +635,10 @@ function __wbg_get_imports() {
|
|
|
554
635
|
const ret = Date.now();
|
|
555
636
|
return ret;
|
|
556
637
|
},
|
|
638
|
+
__wbg_parse_1c0d8a8656d7e016: function() { return handleError(function (arg0, arg1) {
|
|
639
|
+
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
640
|
+
return ret;
|
|
641
|
+
}, arguments); },
|
|
557
642
|
__wbg_push_d2ae3af0c1217ae6: function(arg0, arg1) {
|
|
558
643
|
const ret = arg0.push(arg1);
|
|
559
644
|
return ret;
|
package/web/ezu_bg.wasm
CHANGED
|
Binary file
|
package/web/ezu_bg.wasm.d.ts
CHANGED
|
@@ -16,14 +16,17 @@ export const renderer_attribution: (a: number) => [number, number];
|
|
|
16
16
|
export const renderer_bindSource: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
|
|
17
17
|
export const renderer_boundSources: (a: number) => [number, number];
|
|
18
18
|
export const renderer_clearSources: (a: number) => void;
|
|
19
|
+
export const renderer_legend: (a: number, b: number) => [number, number, number];
|
|
19
20
|
export const renderer_memoryUsage: (a: number) => [number, number, number];
|
|
20
21
|
export const renderer_neededCodepoints: (a: number) => [number, number, number];
|
|
21
22
|
export const renderer_neededGlyphRanges: (a: number) => [number, number, number];
|
|
22
23
|
export const renderer_new: (a: number, b: number) => [number, number, number];
|
|
24
|
+
export const renderer_paramsSchema: (a: number) => [number, number, number];
|
|
23
25
|
export const renderer_renderTile: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
|
|
24
26
|
export const renderer_requestedNeighborOffsets: (a: number, b: number, c: number) => [number, number, number];
|
|
25
27
|
export const renderer_setGlyphBudget: (a: number, b: number) => void;
|
|
26
28
|
export const renderer_setStyle: (a: number, b: number, c: number) => [number, number, number];
|
|
29
|
+
export const renderer_sourceTile: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
27
30
|
export const renderer_tileSize: (a: number) => number;
|
|
28
31
|
export const simdEnabled: () => number;
|
|
29
32
|
export const threadsEnabled: () => number;
|