@reearth/ezu 0.7.0 → 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/bundler/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.
@@ -220,6 +230,11 @@ export class Renderer {
220
230
  * fetches exactly what the recipe needs. An empty array means the
221
231
  * centre tile is enough.
222
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
+ *
223
238
  * Throws `UnknownSource` if `name` is not declared in the style.
224
239
  */
225
240
  requestedNeighborOffsets(name: string): Array<any>;
@@ -253,6 +268,23 @@ export class Renderer {
253
268
  * the intermediate cache and drops any pending source bindings.
254
269
  */
255
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;
256
288
  /**
257
289
  * Effective attribution declared by the style (document +
258
290
  * sources), joined with ` | `. Upstream TileJSON / PMTiles
package/bundler/ezu_bg.js CHANGED
@@ -197,6 +197,24 @@ export class Renderer {
197
197
  clearSources() {
198
198
  wasm.renderer_clearSources(this.__wbg_ptr);
199
199
  }
200
+ /**
201
+ * The style's declared `legend`, or `undefined` when it declares
202
+ * none. Pass a zoom to keep only the entries that apply there.
203
+ *
204
+ * Entries name the node that draws the symbol rather than restating
205
+ * a colour, so a host lays out the labels and asks the map itself
206
+ * for the swatches. The CLI's `ezu legend` renders those swatches;
207
+ * in a browser, render the named node.
208
+ * @param {number | null} [zoom]
209
+ * @returns {any}
210
+ */
211
+ legend(zoom) {
212
+ const ret = wasm.renderer_legend(this.__wbg_ptr, isLikeNone(zoom) ? 0xFFFFFF : zoom);
213
+ if (ret[2]) {
214
+ throw takeFromExternrefTable0(ret[1]);
215
+ }
216
+ return takeFromExternrefTable0(ret[0]);
217
+ }
200
218
  /**
201
219
  * What this renderer is holding, in bytes, so a host can shed load
202
220
  * *before* an allocation fails rather than after.
@@ -367,6 +385,11 @@ export class Renderer {
367
385
  * fetches exactly what the recipe needs. An empty array means the
368
386
  * centre tile is enough.
369
387
  *
388
+ * A `dem` or `raster` source that declares `neighbor-fetch: false`
389
+ * reports no offsets whatever the graph asks for: the style has said
390
+ * not to stitch a neighbourhood for it, and this list is what a host
391
+ * fetches from.
392
+ *
370
393
  * Throws `UnknownSource` if `name` is not declared in the style.
371
394
  * @param {string} name
372
395
  * @returns {Array<any>}
@@ -423,6 +446,36 @@ export class Renderer {
423
446
  }
424
447
  return ret[0] >>> 0;
425
448
  }
449
+ /**
450
+ * The tile a host should actually fetch from `name` in order to draw
451
+ * `z/x/y`, as `{ z, x, y }`.
452
+ *
453
+ * For a source that declares `max-zoom`, a request past the ceiling
454
+ * answers with the covering ancestor — bind those bytes with
455
+ * `{ sourceZoom: <returned z> }` and the renderer resamples or
456
+ * reprojects them into the requested tile. Below the ceiling, and for
457
+ * a source that declares no ceiling, the answer is the tile itself.
458
+ *
459
+ * This exists so the ceiling lives in one place. A host that hard-codes
460
+ * the maxzoom of each source keeps a second copy of something the style
461
+ * already states, and the two drift.
462
+ *
463
+ * Throws `UnknownSource` if `name` is not declared in the style.
464
+ * @param {string} name
465
+ * @param {number} z
466
+ * @param {number} x
467
+ * @param {number} y
468
+ * @returns {any}
469
+ */
470
+ sourceTile(name, z, x, y) {
471
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
472
+ const len0 = WASM_VECTOR_LEN;
473
+ const ret = wasm.renderer_sourceTile(this.__wbg_ptr, ptr0, len0, z, x, y);
474
+ if (ret[2]) {
475
+ throw takeFromExternrefTable0(ret[1]);
476
+ }
477
+ return takeFromExternrefTable0(ret[0]);
478
+ }
426
479
  /**
427
480
  * `tile-size` declared by the current style.
428
481
  * @returns {number}
Binary file
@@ -16,6 +16,7 @@ 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];
@@ -25,6 +26,7 @@ export const renderer_renderTile: (a: number, b: number, c: number, d: number, e
25
26
  export const renderer_requestedNeighborOffsets: (a: number, b: number, c: number) => [number, number, number];
26
27
  export const renderer_setGlyphBudget: (a: number, b: number) => void;
27
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];
28
30
  export const renderer_tileSize: (a: number) => number;
29
31
  export const simdEnabled: () => number;
30
32
  export const threadsEnabled: () => number;
package/nodejs/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.
@@ -220,6 +230,11 @@ export class Renderer {
220
230
  * fetches exactly what the recipe needs. An empty array means the
221
231
  * centre tile is enough.
222
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
+ *
223
238
  * Throws `UnknownSource` if `name` is not declared in the style.
224
239
  */
225
240
  requestedNeighborOffsets(name: string): Array<any>;
@@ -253,6 +268,23 @@ export class Renderer {
253
268
  * the intermediate cache and drops any pending source bindings.
254
269
  */
255
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;
256
288
  /**
257
289
  * Effective attribution declared by the style (document +
258
290
  * sources), joined with ` | `. Upstream TileJSON / PMTiles
package/nodejs/ezu.js CHANGED
@@ -200,6 +200,24 @@ class Renderer {
200
200
  clearSources() {
201
201
  wasm.renderer_clearSources(this.__wbg_ptr);
202
202
  }
203
+ /**
204
+ * The style's declared `legend`, or `undefined` when it declares
205
+ * none. Pass a zoom to keep only the entries that apply there.
206
+ *
207
+ * Entries name the node that draws the symbol rather than restating
208
+ * a colour, so a host lays out the labels and asks the map itself
209
+ * for the swatches. The CLI's `ezu legend` renders those swatches;
210
+ * in a browser, render the named node.
211
+ * @param {number | null} [zoom]
212
+ * @returns {any}
213
+ */
214
+ legend(zoom) {
215
+ const ret = wasm.renderer_legend(this.__wbg_ptr, isLikeNone(zoom) ? 0xFFFFFF : zoom);
216
+ if (ret[2]) {
217
+ throw takeFromExternrefTable0(ret[1]);
218
+ }
219
+ return takeFromExternrefTable0(ret[0]);
220
+ }
203
221
  /**
204
222
  * What this renderer is holding, in bytes, so a host can shed load
205
223
  * *before* an allocation fails rather than after.
@@ -370,6 +388,11 @@ class Renderer {
370
388
  * fetches exactly what the recipe needs. An empty array means the
371
389
  * centre tile is enough.
372
390
  *
391
+ * A `dem` or `raster` source that declares `neighbor-fetch: false`
392
+ * reports no offsets whatever the graph asks for: the style has said
393
+ * not to stitch a neighbourhood for it, and this list is what a host
394
+ * fetches from.
395
+ *
373
396
  * Throws `UnknownSource` if `name` is not declared in the style.
374
397
  * @param {string} name
375
398
  * @returns {Array<any>}
@@ -426,6 +449,36 @@ class Renderer {
426
449
  }
427
450
  return ret[0] >>> 0;
428
451
  }
452
+ /**
453
+ * The tile a host should actually fetch from `name` in order to draw
454
+ * `z/x/y`, as `{ z, x, y }`.
455
+ *
456
+ * For a source that declares `max-zoom`, a request past the ceiling
457
+ * answers with the covering ancestor — bind those bytes with
458
+ * `{ sourceZoom: <returned z> }` and the renderer resamples or
459
+ * reprojects them into the requested tile. Below the ceiling, and for
460
+ * a source that declares no ceiling, the answer is the tile itself.
461
+ *
462
+ * This exists so the ceiling lives in one place. A host that hard-codes
463
+ * the maxzoom of each source keeps a second copy of something the style
464
+ * already states, and the two drift.
465
+ *
466
+ * Throws `UnknownSource` if `name` is not declared in the style.
467
+ * @param {string} name
468
+ * @param {number} z
469
+ * @param {number} x
470
+ * @param {number} y
471
+ * @returns {any}
472
+ */
473
+ sourceTile(name, z, x, y) {
474
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
475
+ const len0 = WASM_VECTOR_LEN;
476
+ const ret = wasm.renderer_sourceTile(this.__wbg_ptr, ptr0, len0, z, x, y);
477
+ if (ret[2]) {
478
+ throw takeFromExternrefTable0(ret[1]);
479
+ }
480
+ return takeFromExternrefTable0(ret[0]);
481
+ }
429
482
  /**
430
483
  * `tile-size` declared by the current style.
431
484
  * @returns {number}
Binary file
@@ -16,6 +16,7 @@ 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];
@@ -25,6 +26,7 @@ export const renderer_renderTile: (a: number, b: number, c: number, d: number, e
25
26
  export const renderer_requestedNeighborOffsets: (a: number, b: number, c: number) => [number, number, number];
26
27
  export const renderer_setGlyphBudget: (a: number, b: number) => void;
27
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];
28
30
  export const renderer_tileSize: (a: number) => number;
29
31
  export const simdEnabled: () => number;
30
32
  export const threadsEnabled: () => number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reearth/ezu",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Painterly map renderer — WebAssembly bindings",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "repository": {
@@ -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.
@@ -220,6 +230,11 @@ export class Renderer {
220
230
  * fetches exactly what the recipe needs. An empty array means the
221
231
  * centre tile is enough.
222
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
+ *
223
238
  * Throws `UnknownSource` if `name` is not declared in the style.
224
239
  */
225
240
  requestedNeighborOffsets(name: string): Array<any>;
@@ -253,6 +268,23 @@ export class Renderer {
253
268
  * the intermediate cache and drops any pending source bindings.
254
269
  */
255
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;
256
288
  /**
257
289
  * Effective attribution declared by the style (document +
258
290
  * sources), joined with ` | `. Upstream TileJSON / PMTiles
@@ -197,6 +197,24 @@ export class Renderer {
197
197
  clearSources() {
198
198
  wasm.renderer_clearSources(this.__wbg_ptr);
199
199
  }
200
+ /**
201
+ * The style's declared `legend`, or `undefined` when it declares
202
+ * none. Pass a zoom to keep only the entries that apply there.
203
+ *
204
+ * Entries name the node that draws the symbol rather than restating
205
+ * a colour, so a host lays out the labels and asks the map itself
206
+ * for the swatches. The CLI's `ezu legend` renders those swatches;
207
+ * in a browser, render the named node.
208
+ * @param {number | null} [zoom]
209
+ * @returns {any}
210
+ */
211
+ legend(zoom) {
212
+ const ret = wasm.renderer_legend(this.__wbg_ptr, isLikeNone(zoom) ? 0xFFFFFF : zoom);
213
+ if (ret[2]) {
214
+ throw takeFromExternrefTable0(ret[1]);
215
+ }
216
+ return takeFromExternrefTable0(ret[0]);
217
+ }
200
218
  /**
201
219
  * What this renderer is holding, in bytes, so a host can shed load
202
220
  * *before* an allocation fails rather than after.
@@ -367,6 +385,11 @@ export class Renderer {
367
385
  * fetches exactly what the recipe needs. An empty array means the
368
386
  * centre tile is enough.
369
387
  *
388
+ * A `dem` or `raster` source that declares `neighbor-fetch: false`
389
+ * reports no offsets whatever the graph asks for: the style has said
390
+ * not to stitch a neighbourhood for it, and this list is what a host
391
+ * fetches from.
392
+ *
370
393
  * Throws `UnknownSource` if `name` is not declared in the style.
371
394
  * @param {string} name
372
395
  * @returns {Array<any>}
@@ -423,6 +446,36 @@ export class Renderer {
423
446
  }
424
447
  return ret[0] >>> 0;
425
448
  }
449
+ /**
450
+ * The tile a host should actually fetch from `name` in order to draw
451
+ * `z/x/y`, as `{ z, x, y }`.
452
+ *
453
+ * For a source that declares `max-zoom`, a request past the ceiling
454
+ * answers with the covering ancestor — bind those bytes with
455
+ * `{ sourceZoom: <returned z> }` and the renderer resamples or
456
+ * reprojects them into the requested tile. Below the ceiling, and for
457
+ * a source that declares no ceiling, the answer is the tile itself.
458
+ *
459
+ * This exists so the ceiling lives in one place. A host that hard-codes
460
+ * the maxzoom of each source keeps a second copy of something the style
461
+ * already states, and the two drift.
462
+ *
463
+ * Throws `UnknownSource` if `name` is not declared in the style.
464
+ * @param {string} name
465
+ * @param {number} z
466
+ * @param {number} x
467
+ * @param {number} y
468
+ * @returns {any}
469
+ */
470
+ sourceTile(name, z, x, y) {
471
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
472
+ const len0 = WASM_VECTOR_LEN;
473
+ const ret = wasm.renderer_sourceTile(this.__wbg_ptr, ptr0, len0, z, x, y);
474
+ if (ret[2]) {
475
+ throw takeFromExternrefTable0(ret[1]);
476
+ }
477
+ return takeFromExternrefTable0(ret[0]);
478
+ }
426
479
  /**
427
480
  * `tile-size` declared by the current style.
428
481
  * @returns {number}
Binary file
@@ -16,6 +16,7 @@ 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];
@@ -25,6 +26,7 @@ export const renderer_renderTile: (a: number, b: number, c: number, d: number, e
25
26
  export const renderer_requestedNeighborOffsets: (a: number, b: number, c: number) => [number, number, number];
26
27
  export const renderer_setGlyphBudget: (a: number, b: number) => void;
27
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];
28
30
  export const renderer_tileSize: (a: number) => number;
29
31
  export const simdEnabled: () => number;
30
32
  export const threadsEnabled: () => number;
@@ -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.
@@ -220,6 +230,11 @@ export class Renderer {
220
230
  * fetches exactly what the recipe needs. An empty array means the
221
231
  * centre tile is enough.
222
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
+ *
223
238
  * Throws `UnknownSource` if `name` is not declared in the style.
224
239
  */
225
240
  requestedNeighborOffsets(name: string): Array<any>;
@@ -253,6 +268,23 @@ export class Renderer {
253
268
  * the intermediate cache and drops any pending source bindings.
254
269
  */
255
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;
256
288
  /**
257
289
  * Effective attribution declared by the style (document +
258
290
  * sources), joined with ` | `. Upstream TileJSON / PMTiles
@@ -200,6 +200,24 @@ class Renderer {
200
200
  clearSources() {
201
201
  wasm.renderer_clearSources(this.__wbg_ptr);
202
202
  }
203
+ /**
204
+ * The style's declared `legend`, or `undefined` when it declares
205
+ * none. Pass a zoom to keep only the entries that apply there.
206
+ *
207
+ * Entries name the node that draws the symbol rather than restating
208
+ * a colour, so a host lays out the labels and asks the map itself
209
+ * for the swatches. The CLI's `ezu legend` renders those swatches;
210
+ * in a browser, render the named node.
211
+ * @param {number | null} [zoom]
212
+ * @returns {any}
213
+ */
214
+ legend(zoom) {
215
+ const ret = wasm.renderer_legend(this.__wbg_ptr, isLikeNone(zoom) ? 0xFFFFFF : zoom);
216
+ if (ret[2]) {
217
+ throw takeFromExternrefTable0(ret[1]);
218
+ }
219
+ return takeFromExternrefTable0(ret[0]);
220
+ }
203
221
  /**
204
222
  * What this renderer is holding, in bytes, so a host can shed load
205
223
  * *before* an allocation fails rather than after.
@@ -370,6 +388,11 @@ class Renderer {
370
388
  * fetches exactly what the recipe needs. An empty array means the
371
389
  * centre tile is enough.
372
390
  *
391
+ * A `dem` or `raster` source that declares `neighbor-fetch: false`
392
+ * reports no offsets whatever the graph asks for: the style has said
393
+ * not to stitch a neighbourhood for it, and this list is what a host
394
+ * fetches from.
395
+ *
373
396
  * Throws `UnknownSource` if `name` is not declared in the style.
374
397
  * @param {string} name
375
398
  * @returns {Array<any>}
@@ -426,6 +449,36 @@ class Renderer {
426
449
  }
427
450
  return ret[0] >>> 0;
428
451
  }
452
+ /**
453
+ * The tile a host should actually fetch from `name` in order to draw
454
+ * `z/x/y`, as `{ z, x, y }`.
455
+ *
456
+ * For a source that declares `max-zoom`, a request past the ceiling
457
+ * answers with the covering ancestor — bind those bytes with
458
+ * `{ sourceZoom: <returned z> }` and the renderer resamples or
459
+ * reprojects them into the requested tile. Below the ceiling, and for
460
+ * a source that declares no ceiling, the answer is the tile itself.
461
+ *
462
+ * This exists so the ceiling lives in one place. A host that hard-codes
463
+ * the maxzoom of each source keeps a second copy of something the style
464
+ * already states, and the two drift.
465
+ *
466
+ * Throws `UnknownSource` if `name` is not declared in the style.
467
+ * @param {string} name
468
+ * @param {number} z
469
+ * @param {number} x
470
+ * @param {number} y
471
+ * @returns {any}
472
+ */
473
+ sourceTile(name, z, x, y) {
474
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
475
+ const len0 = WASM_VECTOR_LEN;
476
+ const ret = wasm.renderer_sourceTile(this.__wbg_ptr, ptr0, len0, z, x, y);
477
+ if (ret[2]) {
478
+ throw takeFromExternrefTable0(ret[1]);
479
+ }
480
+ return takeFromExternrefTable0(ret[0]);
481
+ }
429
482
  /**
430
483
  * `tile-size` declared by the current style.
431
484
  * @returns {number}
Binary file
@@ -16,6 +16,7 @@ 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];
@@ -25,6 +26,7 @@ export const renderer_renderTile: (a: number, b: number, c: number, d: number, e
25
26
  export const renderer_requestedNeighborOffsets: (a: number, b: number, c: number) => [number, number, number];
26
27
  export const renderer_setGlyphBudget: (a: number, b: number) => void;
27
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];
28
30
  export const renderer_tileSize: (a: number) => number;
29
31
  export const simdEnabled: () => number;
30
32
  export const threadsEnabled: () => number;
package/simd/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.
@@ -220,6 +230,11 @@ export class Renderer {
220
230
  * fetches exactly what the recipe needs. An empty array means the
221
231
  * centre tile is enough.
222
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
+ *
223
238
  * Throws `UnknownSource` if `name` is not declared in the style.
224
239
  */
225
240
  requestedNeighborOffsets(name: string): Array<any>;
@@ -253,6 +268,23 @@ export class Renderer {
253
268
  * the intermediate cache and drops any pending source bindings.
254
269
  */
255
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;
256
288
  /**
257
289
  * Effective attribution declared by the style (document +
258
290
  * sources), joined with ` | `. Upstream TileJSON / PMTiles
@@ -323,6 +355,7 @@ export interface InitOutput {
323
355
  readonly renderer_bindSource: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
324
356
  readonly renderer_boundSources: (a: number) => [number, number];
325
357
  readonly renderer_clearSources: (a: number) => void;
358
+ readonly renderer_legend: (a: number, b: number) => [number, number, number];
326
359
  readonly renderer_memoryUsage: (a: number) => [number, number, number];
327
360
  readonly renderer_neededCodepoints: (a: number) => [number, number, number];
328
361
  readonly renderer_neededGlyphRanges: (a: number) => [number, number, number];
@@ -332,6 +365,7 @@ export interface InitOutput {
332
365
  readonly renderer_requestedNeighborOffsets: (a: number, b: number, c: number) => [number, number, number];
333
366
  readonly renderer_setGlyphBudget: (a: number, b: number) => void;
334
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];
335
369
  readonly renderer_tileSize: (a: number) => number;
336
370
  readonly simdEnabled: () => number;
337
371
  readonly threadsEnabled: () => number;
package/simd/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.
@@ -369,6 +387,11 @@ export class Renderer {
369
387
  * fetches exactly what the recipe needs. An empty array means the
370
388
  * centre tile is enough.
371
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
+ *
372
395
  * Throws `UnknownSource` if `name` is not declared in the style.
373
396
  * @param {string} name
374
397
  * @returns {Array<any>}
@@ -425,6 +448,36 @@ export class Renderer {
425
448
  }
426
449
  return ret[0] >>> 0;
427
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
+ }
428
481
  /**
429
482
  * `tile-size` declared by the current style.
430
483
  * @returns {number}
Binary file
@@ -16,6 +16,7 @@ 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];
@@ -25,6 +26,7 @@ export const renderer_renderTile: (a: number, b: number, c: number, d: number, e
25
26
  export const renderer_requestedNeighborOffsets: (a: number, b: number, c: number) => [number, number, number];
26
27
  export const renderer_setGlyphBudget: (a: number, b: number) => void;
27
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];
28
30
  export const renderer_tileSize: (a: number) => number;
29
31
  export const simdEnabled: () => number;
30
32
  export const threadsEnabled: () => number;
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.
@@ -220,6 +230,11 @@ export class Renderer {
220
230
  * fetches exactly what the recipe needs. An empty array means the
221
231
  * centre tile is enough.
222
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
+ *
223
238
  * Throws `UnknownSource` if `name` is not declared in the style.
224
239
  */
225
240
  requestedNeighborOffsets(name: string): Array<any>;
@@ -253,6 +268,23 @@ export class Renderer {
253
268
  * the intermediate cache and drops any pending source bindings.
254
269
  */
255
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;
256
288
  /**
257
289
  * Effective attribution declared by the style (document +
258
290
  * sources), joined with ` | `. Upstream TileJSON / PMTiles
@@ -323,6 +355,7 @@ export interface InitOutput {
323
355
  readonly renderer_bindSource: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
324
356
  readonly renderer_boundSources: (a: number) => [number, number];
325
357
  readonly renderer_clearSources: (a: number) => void;
358
+ readonly renderer_legend: (a: number, b: number) => [number, number, number];
326
359
  readonly renderer_memoryUsage: (a: number) => [number, number, number];
327
360
  readonly renderer_neededCodepoints: (a: number) => [number, number, number];
328
361
  readonly renderer_neededGlyphRanges: (a: number) => [number, number, number];
@@ -332,6 +365,7 @@ export interface InitOutput {
332
365
  readonly renderer_requestedNeighborOffsets: (a: number, b: number, c: number) => [number, number, number];
333
366
  readonly renderer_setGlyphBudget: (a: number, b: number) => void;
334
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];
335
369
  readonly renderer_tileSize: (a: number) => number;
336
370
  readonly simdEnabled: () => number;
337
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.
@@ -369,6 +387,11 @@ export class Renderer {
369
387
  * fetches exactly what the recipe needs. An empty array means the
370
388
  * centre tile is enough.
371
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
+ *
372
395
  * Throws `UnknownSource` if `name` is not declared in the style.
373
396
  * @param {string} name
374
397
  * @returns {Array<any>}
@@ -425,6 +448,36 @@ export class Renderer {
425
448
  }
426
449
  return ret[0] >>> 0;
427
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
+ }
428
481
  /**
429
482
  * `tile-size` declared by the current style.
430
483
  * @returns {number}
package/web/ezu_bg.wasm CHANGED
Binary file
@@ -16,6 +16,7 @@ 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];
@@ -25,6 +26,7 @@ export const renderer_renderTile: (a: number, b: number, c: number, d: number, e
25
26
  export const renderer_requestedNeighborOffsets: (a: number, b: number, c: number) => [number, number, number];
26
27
  export const renderer_setGlyphBudget: (a: number, b: number) => void;
27
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];
28
30
  export const renderer_tileSize: (a: number) => number;
29
31
  export const simdEnabled: () => number;
30
32
  export const threadsEnabled: () => number;