@reearth/ezu 0.10.0 → 0.11.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 CHANGED
@@ -122,6 +122,24 @@ class Renderer {
122
122
  clearSources(): void;
123
123
  boundSources(): string[]; // names with at least one pending tile-scoped binding
124
124
 
125
+ // Every source the style declares, in declaration order — what to
126
+ // fetch, what kind it is, and whether the binding has to be repeated
127
+ // per tile. Walk this rather than parsing the style yourself; `url` is
128
+ // absent only for inline `geojson`, which needs no binding at all, and
129
+ // a `glyphs` url comes back with `{fontstack}` already substituted.
130
+ sources(): Array<{
131
+ name: string;
132
+ type: "mvt" | "pmtiles" | "dem" | "raster" | "geojson"
133
+ | "sprite" | "font" | "glyphs" | "brush" | "image";
134
+ tileScoped: boolean;
135
+ url?: string;
136
+ indexUrl?: string; // a sprite index that is a URL, not inline
137
+ }>;
138
+
139
+ // Cap the resident glyph bytes per fontstack. 0xFFFFFFFF lifts the cap
140
+ // (and reads back as `Infinity` from `memoryUsage().glyphBudget`).
141
+ setGlyphBudget(bytes: number): void;
142
+
125
143
  // Single unified render. `opts.format` picks the encoder; `tileSize`
126
144
  // / `pad` override the canvas for hi-DPI / preview.
127
145
  renderTile(z: number, x: number, y: number, opts?: {
package/bundler/ezu.d.ts CHANGED
@@ -273,6 +273,12 @@ export class Renderer {
273
273
  * before the next tile that needs it. `neededCodepoints()` already
274
274
  * names exactly what to bind, and a host that re-binds every tile
275
275
  * (rather than tracking what it sent) needs no other change.
276
+ *
277
+ * A budget of `0xFFFFFFFF` — the largest value this host can express,
278
+ * since an address here is 32 bits — lifts the cap again, and is what
279
+ * `memoryUsage().glyphBudget` reports as `Infinity`. A number that
280
+ * big cannot be a real ceiling: it is every byte the module could
281
+ * ever address.
276
282
  */
277
283
  setGlyphBudget(bytes: number): void;
278
284
  /**
@@ -305,6 +311,30 @@ export class Renderer {
305
311
  * Throws `UnknownSource` if `name` is not declared in the style.
306
312
  */
307
313
  sourceTile(name: string, z: number, x: number, y: number): any;
314
+ /**
315
+ * Every source the style declares, in declaration order, as an array
316
+ * of `{ name, type, tileScoped, url?, indexUrl? }`.
317
+ *
318
+ * This is what a host walks before it fetches anything: `type` is the
319
+ * style's own word for the kind (`"mvt"`, `"dem"`, `"glyphs"`, …) and
320
+ * says what `bindSource` will do with the bytes, and `url` is where
321
+ * they come from — an XYZ template for a tile pyramid, a document
322
+ * URL, or, for `glyphs`, the endpoint with `{fontstack}` already
323
+ * substituted and `{range}` left to fill in per block. `boundSources`
324
+ * answers the opposite question, what is already bound, and cannot
325
+ * start the loop.
326
+ *
327
+ * `tileScoped` says whether a binding of that kind is dropped by
328
+ * `clearSources` and has to be rebound for the next tile; the rest go
329
+ * into the persistent banks and are bound once.
330
+ *
331
+ * `url` is absent only for a `geojson` source with inline `data`: the
332
+ * style carries the payload, so there is nothing to fetch and nothing
333
+ * to bind. `indexUrl` appears on a `sprite` source whose index is a
334
+ * URL rather than inline — fetch it and pass the text as
335
+ * `bindSource(name, atlasBytes, { index })`.
336
+ */
337
+ sources(): Array<any>;
308
338
  /**
309
339
  * Effective attribution declared by the style (document +
310
340
  * sources), joined with ` | `. Upstream TileJSON / PMTiles
package/bundler/ezu_bg.js CHANGED
@@ -438,6 +438,12 @@ export class Renderer {
438
438
  * before the next tile that needs it. `neededCodepoints()` already
439
439
  * names exactly what to bind, and a host that re-binds every tile
440
440
  * (rather than tracking what it sent) needs no other change.
441
+ *
442
+ * A budget of `0xFFFFFFFF` — the largest value this host can express,
443
+ * since an address here is 32 bits — lifts the cap again, and is what
444
+ * `memoryUsage().glyphBudget` reports as `Infinity`. A number that
445
+ * big cannot be a real ceiling: it is every byte the module could
446
+ * ever address.
441
447
  * @param {number} bytes
442
448
  */
443
449
  setGlyphBudget(bytes) {
@@ -496,6 +502,37 @@ export class Renderer {
496
502
  }
497
503
  return takeFromExternrefTable0(ret[0]);
498
504
  }
505
+ /**
506
+ * Every source the style declares, in declaration order, as an array
507
+ * of `{ name, type, tileScoped, url?, indexUrl? }`.
508
+ *
509
+ * This is what a host walks before it fetches anything: `type` is the
510
+ * style's own word for the kind (`"mvt"`, `"dem"`, `"glyphs"`, …) and
511
+ * says what `bindSource` will do with the bytes, and `url` is where
512
+ * they come from — an XYZ template for a tile pyramid, a document
513
+ * URL, or, for `glyphs`, the endpoint with `{fontstack}` already
514
+ * substituted and `{range}` left to fill in per block. `boundSources`
515
+ * answers the opposite question, what is already bound, and cannot
516
+ * start the loop.
517
+ *
518
+ * `tileScoped` says whether a binding of that kind is dropped by
519
+ * `clearSources` and has to be rebound for the next tile; the rest go
520
+ * into the persistent banks and are bound once.
521
+ *
522
+ * `url` is absent only for a `geojson` source with inline `data`: the
523
+ * style carries the payload, so there is nothing to fetch and nothing
524
+ * to bind. `indexUrl` appears on a `sprite` source whose index is a
525
+ * URL rather than inline — fetch it and pass the text as
526
+ * `bindSource(name, atlasBytes, { index })`.
527
+ * @returns {Array<any>}
528
+ */
529
+ sources() {
530
+ const ret = wasm.renderer_sources(this.__wbg_ptr);
531
+ if (ret[2]) {
532
+ throw takeFromExternrefTable0(ret[1]);
533
+ }
534
+ return takeFromExternrefTable0(ret[0]);
535
+ }
499
536
  /**
500
537
  * `tile-size` declared by the current style.
501
538
  * @returns {number}
Binary file
@@ -27,6 +27,7 @@ export const renderer_requestedNeighborOffsets: (a: number, b: number, c: number
27
27
  export const renderer_setGlyphBudget: (a: number, b: number) => void;
28
28
  export const renderer_setStyle: (a: number, b: number, c: number) => [number, number, number];
29
29
  export const renderer_sourceTile: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
30
+ export const renderer_sources: (a: number) => [number, number, number];
30
31
  export const renderer_tileSize: (a: number) => number;
31
32
  export const simdEnabled: () => number;
32
33
  export const threadsEnabled: () => number;
package/nodejs/ezu.d.ts CHANGED
@@ -273,6 +273,12 @@ export class Renderer {
273
273
  * before the next tile that needs it. `neededCodepoints()` already
274
274
  * names exactly what to bind, and a host that re-binds every tile
275
275
  * (rather than tracking what it sent) needs no other change.
276
+ *
277
+ * A budget of `0xFFFFFFFF` — the largest value this host can express,
278
+ * since an address here is 32 bits — lifts the cap again, and is what
279
+ * `memoryUsage().glyphBudget` reports as `Infinity`. A number that
280
+ * big cannot be a real ceiling: it is every byte the module could
281
+ * ever address.
276
282
  */
277
283
  setGlyphBudget(bytes: number): void;
278
284
  /**
@@ -305,6 +311,30 @@ export class Renderer {
305
311
  * Throws `UnknownSource` if `name` is not declared in the style.
306
312
  */
307
313
  sourceTile(name: string, z: number, x: number, y: number): any;
314
+ /**
315
+ * Every source the style declares, in declaration order, as an array
316
+ * of `{ name, type, tileScoped, url?, indexUrl? }`.
317
+ *
318
+ * This is what a host walks before it fetches anything: `type` is the
319
+ * style's own word for the kind (`"mvt"`, `"dem"`, `"glyphs"`, …) and
320
+ * says what `bindSource` will do with the bytes, and `url` is where
321
+ * they come from — an XYZ template for a tile pyramid, a document
322
+ * URL, or, for `glyphs`, the endpoint with `{fontstack}` already
323
+ * substituted and `{range}` left to fill in per block. `boundSources`
324
+ * answers the opposite question, what is already bound, and cannot
325
+ * start the loop.
326
+ *
327
+ * `tileScoped` says whether a binding of that kind is dropped by
328
+ * `clearSources` and has to be rebound for the next tile; the rest go
329
+ * into the persistent banks and are bound once.
330
+ *
331
+ * `url` is absent only for a `geojson` source with inline `data`: the
332
+ * style carries the payload, so there is nothing to fetch and nothing
333
+ * to bind. `indexUrl` appears on a `sprite` source whose index is a
334
+ * URL rather than inline — fetch it and pass the text as
335
+ * `bindSource(name, atlasBytes, { index })`.
336
+ */
337
+ sources(): Array<any>;
308
338
  /**
309
339
  * Effective attribution declared by the style (document +
310
340
  * sources), joined with ` | `. Upstream TileJSON / PMTiles
package/nodejs/ezu.js CHANGED
@@ -441,6 +441,12 @@ class Renderer {
441
441
  * before the next tile that needs it. `neededCodepoints()` already
442
442
  * names exactly what to bind, and a host that re-binds every tile
443
443
  * (rather than tracking what it sent) needs no other change.
444
+ *
445
+ * A budget of `0xFFFFFFFF` — the largest value this host can express,
446
+ * since an address here is 32 bits — lifts the cap again, and is what
447
+ * `memoryUsage().glyphBudget` reports as `Infinity`. A number that
448
+ * big cannot be a real ceiling: it is every byte the module could
449
+ * ever address.
444
450
  * @param {number} bytes
445
451
  */
446
452
  setGlyphBudget(bytes) {
@@ -499,6 +505,37 @@ class Renderer {
499
505
  }
500
506
  return takeFromExternrefTable0(ret[0]);
501
507
  }
508
+ /**
509
+ * Every source the style declares, in declaration order, as an array
510
+ * of `{ name, type, tileScoped, url?, indexUrl? }`.
511
+ *
512
+ * This is what a host walks before it fetches anything: `type` is the
513
+ * style's own word for the kind (`"mvt"`, `"dem"`, `"glyphs"`, …) and
514
+ * says what `bindSource` will do with the bytes, and `url` is where
515
+ * they come from — an XYZ template for a tile pyramid, a document
516
+ * URL, or, for `glyphs`, the endpoint with `{fontstack}` already
517
+ * substituted and `{range}` left to fill in per block. `boundSources`
518
+ * answers the opposite question, what is already bound, and cannot
519
+ * start the loop.
520
+ *
521
+ * `tileScoped` says whether a binding of that kind is dropped by
522
+ * `clearSources` and has to be rebound for the next tile; the rest go
523
+ * into the persistent banks and are bound once.
524
+ *
525
+ * `url` is absent only for a `geojson` source with inline `data`: the
526
+ * style carries the payload, so there is nothing to fetch and nothing
527
+ * to bind. `indexUrl` appears on a `sprite` source whose index is a
528
+ * URL rather than inline — fetch it and pass the text as
529
+ * `bindSource(name, atlasBytes, { index })`.
530
+ * @returns {Array<any>}
531
+ */
532
+ sources() {
533
+ const ret = wasm.renderer_sources(this.__wbg_ptr);
534
+ if (ret[2]) {
535
+ throw takeFromExternrefTable0(ret[1]);
536
+ }
537
+ return takeFromExternrefTable0(ret[0]);
538
+ }
502
539
  /**
503
540
  * `tile-size` declared by the current style.
504
541
  * @returns {number}
Binary file
@@ -27,6 +27,7 @@ export const renderer_requestedNeighborOffsets: (a: number, b: number, c: number
27
27
  export const renderer_setGlyphBudget: (a: number, b: number) => void;
28
28
  export const renderer_setStyle: (a: number, b: number, c: number) => [number, number, number];
29
29
  export const renderer_sourceTile: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
30
+ export const renderer_sources: (a: number) => [number, number, number];
30
31
  export const renderer_tileSize: (a: number) => number;
31
32
  export const simdEnabled: () => number;
32
33
  export const threadsEnabled: () => number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reearth/ezu",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "Painterly map renderer — WebAssembly bindings",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "repository": {
@@ -273,6 +273,12 @@ export class Renderer {
273
273
  * before the next tile that needs it. `neededCodepoints()` already
274
274
  * names exactly what to bind, and a host that re-binds every tile
275
275
  * (rather than tracking what it sent) needs no other change.
276
+ *
277
+ * A budget of `0xFFFFFFFF` — the largest value this host can express,
278
+ * since an address here is 32 bits — lifts the cap again, and is what
279
+ * `memoryUsage().glyphBudget` reports as `Infinity`. A number that
280
+ * big cannot be a real ceiling: it is every byte the module could
281
+ * ever address.
276
282
  */
277
283
  setGlyphBudget(bytes: number): void;
278
284
  /**
@@ -305,6 +311,30 @@ export class Renderer {
305
311
  * Throws `UnknownSource` if `name` is not declared in the style.
306
312
  */
307
313
  sourceTile(name: string, z: number, x: number, y: number): any;
314
+ /**
315
+ * Every source the style declares, in declaration order, as an array
316
+ * of `{ name, type, tileScoped, url?, indexUrl? }`.
317
+ *
318
+ * This is what a host walks before it fetches anything: `type` is the
319
+ * style's own word for the kind (`"mvt"`, `"dem"`, `"glyphs"`, …) and
320
+ * says what `bindSource` will do with the bytes, and `url` is where
321
+ * they come from — an XYZ template for a tile pyramid, a document
322
+ * URL, or, for `glyphs`, the endpoint with `{fontstack}` already
323
+ * substituted and `{range}` left to fill in per block. `boundSources`
324
+ * answers the opposite question, what is already bound, and cannot
325
+ * start the loop.
326
+ *
327
+ * `tileScoped` says whether a binding of that kind is dropped by
328
+ * `clearSources` and has to be rebound for the next tile; the rest go
329
+ * into the persistent banks and are bound once.
330
+ *
331
+ * `url` is absent only for a `geojson` source with inline `data`: the
332
+ * style carries the payload, so there is nothing to fetch and nothing
333
+ * to bind. `indexUrl` appears on a `sprite` source whose index is a
334
+ * URL rather than inline — fetch it and pass the text as
335
+ * `bindSource(name, atlasBytes, { index })`.
336
+ */
337
+ sources(): Array<any>;
308
338
  /**
309
339
  * Effective attribution declared by the style (document +
310
340
  * sources), joined with ` | `. Upstream TileJSON / PMTiles
@@ -438,6 +438,12 @@ export class Renderer {
438
438
  * before the next tile that needs it. `neededCodepoints()` already
439
439
  * names exactly what to bind, and a host that re-binds every tile
440
440
  * (rather than tracking what it sent) needs no other change.
441
+ *
442
+ * A budget of `0xFFFFFFFF` — the largest value this host can express,
443
+ * since an address here is 32 bits — lifts the cap again, and is what
444
+ * `memoryUsage().glyphBudget` reports as `Infinity`. A number that
445
+ * big cannot be a real ceiling: it is every byte the module could
446
+ * ever address.
441
447
  * @param {number} bytes
442
448
  */
443
449
  setGlyphBudget(bytes) {
@@ -496,6 +502,37 @@ export class Renderer {
496
502
  }
497
503
  return takeFromExternrefTable0(ret[0]);
498
504
  }
505
+ /**
506
+ * Every source the style declares, in declaration order, as an array
507
+ * of `{ name, type, tileScoped, url?, indexUrl? }`.
508
+ *
509
+ * This is what a host walks before it fetches anything: `type` is the
510
+ * style's own word for the kind (`"mvt"`, `"dem"`, `"glyphs"`, …) and
511
+ * says what `bindSource` will do with the bytes, and `url` is where
512
+ * they come from — an XYZ template for a tile pyramid, a document
513
+ * URL, or, for `glyphs`, the endpoint with `{fontstack}` already
514
+ * substituted and `{range}` left to fill in per block. `boundSources`
515
+ * answers the opposite question, what is already bound, and cannot
516
+ * start the loop.
517
+ *
518
+ * `tileScoped` says whether a binding of that kind is dropped by
519
+ * `clearSources` and has to be rebound for the next tile; the rest go
520
+ * into the persistent banks and are bound once.
521
+ *
522
+ * `url` is absent only for a `geojson` source with inline `data`: the
523
+ * style carries the payload, so there is nothing to fetch and nothing
524
+ * to bind. `indexUrl` appears on a `sprite` source whose index is a
525
+ * URL rather than inline — fetch it and pass the text as
526
+ * `bindSource(name, atlasBytes, { index })`.
527
+ * @returns {Array<any>}
528
+ */
529
+ sources() {
530
+ const ret = wasm.renderer_sources(this.__wbg_ptr);
531
+ if (ret[2]) {
532
+ throw takeFromExternrefTable0(ret[1]);
533
+ }
534
+ return takeFromExternrefTable0(ret[0]);
535
+ }
499
536
  /**
500
537
  * `tile-size` declared by the current style.
501
538
  * @returns {number}
Binary file
@@ -27,6 +27,7 @@ export const renderer_requestedNeighborOffsets: (a: number, b: number, c: number
27
27
  export const renderer_setGlyphBudget: (a: number, b: number) => void;
28
28
  export const renderer_setStyle: (a: number, b: number, c: number) => [number, number, number];
29
29
  export const renderer_sourceTile: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
30
+ export const renderer_sources: (a: number) => [number, number, number];
30
31
  export const renderer_tileSize: (a: number) => number;
31
32
  export const simdEnabled: () => number;
32
33
  export const threadsEnabled: () => number;
@@ -273,6 +273,12 @@ export class Renderer {
273
273
  * before the next tile that needs it. `neededCodepoints()` already
274
274
  * names exactly what to bind, and a host that re-binds every tile
275
275
  * (rather than tracking what it sent) needs no other change.
276
+ *
277
+ * A budget of `0xFFFFFFFF` — the largest value this host can express,
278
+ * since an address here is 32 bits — lifts the cap again, and is what
279
+ * `memoryUsage().glyphBudget` reports as `Infinity`. A number that
280
+ * big cannot be a real ceiling: it is every byte the module could
281
+ * ever address.
276
282
  */
277
283
  setGlyphBudget(bytes: number): void;
278
284
  /**
@@ -305,6 +311,30 @@ export class Renderer {
305
311
  * Throws `UnknownSource` if `name` is not declared in the style.
306
312
  */
307
313
  sourceTile(name: string, z: number, x: number, y: number): any;
314
+ /**
315
+ * Every source the style declares, in declaration order, as an array
316
+ * of `{ name, type, tileScoped, url?, indexUrl? }`.
317
+ *
318
+ * This is what a host walks before it fetches anything: `type` is the
319
+ * style's own word for the kind (`"mvt"`, `"dem"`, `"glyphs"`, …) and
320
+ * says what `bindSource` will do with the bytes, and `url` is where
321
+ * they come from — an XYZ template for a tile pyramid, a document
322
+ * URL, or, for `glyphs`, the endpoint with `{fontstack}` already
323
+ * substituted and `{range}` left to fill in per block. `boundSources`
324
+ * answers the opposite question, what is already bound, and cannot
325
+ * start the loop.
326
+ *
327
+ * `tileScoped` says whether a binding of that kind is dropped by
328
+ * `clearSources` and has to be rebound for the next tile; the rest go
329
+ * into the persistent banks and are bound once.
330
+ *
331
+ * `url` is absent only for a `geojson` source with inline `data`: the
332
+ * style carries the payload, so there is nothing to fetch and nothing
333
+ * to bind. `indexUrl` appears on a `sprite` source whose index is a
334
+ * URL rather than inline — fetch it and pass the text as
335
+ * `bindSource(name, atlasBytes, { index })`.
336
+ */
337
+ sources(): Array<any>;
308
338
  /**
309
339
  * Effective attribution declared by the style (document +
310
340
  * sources), joined with ` | `. Upstream TileJSON / PMTiles
@@ -441,6 +441,12 @@ class Renderer {
441
441
  * before the next tile that needs it. `neededCodepoints()` already
442
442
  * names exactly what to bind, and a host that re-binds every tile
443
443
  * (rather than tracking what it sent) needs no other change.
444
+ *
445
+ * A budget of `0xFFFFFFFF` — the largest value this host can express,
446
+ * since an address here is 32 bits — lifts the cap again, and is what
447
+ * `memoryUsage().glyphBudget` reports as `Infinity`. A number that
448
+ * big cannot be a real ceiling: it is every byte the module could
449
+ * ever address.
444
450
  * @param {number} bytes
445
451
  */
446
452
  setGlyphBudget(bytes) {
@@ -499,6 +505,37 @@ class Renderer {
499
505
  }
500
506
  return takeFromExternrefTable0(ret[0]);
501
507
  }
508
+ /**
509
+ * Every source the style declares, in declaration order, as an array
510
+ * of `{ name, type, tileScoped, url?, indexUrl? }`.
511
+ *
512
+ * This is what a host walks before it fetches anything: `type` is the
513
+ * style's own word for the kind (`"mvt"`, `"dem"`, `"glyphs"`, …) and
514
+ * says what `bindSource` will do with the bytes, and `url` is where
515
+ * they come from — an XYZ template for a tile pyramid, a document
516
+ * URL, or, for `glyphs`, the endpoint with `{fontstack}` already
517
+ * substituted and `{range}` left to fill in per block. `boundSources`
518
+ * answers the opposite question, what is already bound, and cannot
519
+ * start the loop.
520
+ *
521
+ * `tileScoped` says whether a binding of that kind is dropped by
522
+ * `clearSources` and has to be rebound for the next tile; the rest go
523
+ * into the persistent banks and are bound once.
524
+ *
525
+ * `url` is absent only for a `geojson` source with inline `data`: the
526
+ * style carries the payload, so there is nothing to fetch and nothing
527
+ * to bind. `indexUrl` appears on a `sprite` source whose index is a
528
+ * URL rather than inline — fetch it and pass the text as
529
+ * `bindSource(name, atlasBytes, { index })`.
530
+ * @returns {Array<any>}
531
+ */
532
+ sources() {
533
+ const ret = wasm.renderer_sources(this.__wbg_ptr);
534
+ if (ret[2]) {
535
+ throw takeFromExternrefTable0(ret[1]);
536
+ }
537
+ return takeFromExternrefTable0(ret[0]);
538
+ }
502
539
  /**
503
540
  * `tile-size` declared by the current style.
504
541
  * @returns {number}
Binary file
@@ -27,6 +27,7 @@ export const renderer_requestedNeighborOffsets: (a: number, b: number, c: number
27
27
  export const renderer_setGlyphBudget: (a: number, b: number) => void;
28
28
  export const renderer_setStyle: (a: number, b: number, c: number) => [number, number, number];
29
29
  export const renderer_sourceTile: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
30
+ export const renderer_sources: (a: number) => [number, number, number];
30
31
  export const renderer_tileSize: (a: number) => number;
31
32
  export const simdEnabled: () => number;
32
33
  export const threadsEnabled: () => number;
package/simd/web/ezu.d.ts CHANGED
@@ -273,6 +273,12 @@ export class Renderer {
273
273
  * before the next tile that needs it. `neededCodepoints()` already
274
274
  * names exactly what to bind, and a host that re-binds every tile
275
275
  * (rather than tracking what it sent) needs no other change.
276
+ *
277
+ * A budget of `0xFFFFFFFF` — the largest value this host can express,
278
+ * since an address here is 32 bits — lifts the cap again, and is what
279
+ * `memoryUsage().glyphBudget` reports as `Infinity`. A number that
280
+ * big cannot be a real ceiling: it is every byte the module could
281
+ * ever address.
276
282
  */
277
283
  setGlyphBudget(bytes: number): void;
278
284
  /**
@@ -305,6 +311,30 @@ export class Renderer {
305
311
  * Throws `UnknownSource` if `name` is not declared in the style.
306
312
  */
307
313
  sourceTile(name: string, z: number, x: number, y: number): any;
314
+ /**
315
+ * Every source the style declares, in declaration order, as an array
316
+ * of `{ name, type, tileScoped, url?, indexUrl? }`.
317
+ *
318
+ * This is what a host walks before it fetches anything: `type` is the
319
+ * style's own word for the kind (`"mvt"`, `"dem"`, `"glyphs"`, …) and
320
+ * says what `bindSource` will do with the bytes, and `url` is where
321
+ * they come from — an XYZ template for a tile pyramid, a document
322
+ * URL, or, for `glyphs`, the endpoint with `{fontstack}` already
323
+ * substituted and `{range}` left to fill in per block. `boundSources`
324
+ * answers the opposite question, what is already bound, and cannot
325
+ * start the loop.
326
+ *
327
+ * `tileScoped` says whether a binding of that kind is dropped by
328
+ * `clearSources` and has to be rebound for the next tile; the rest go
329
+ * into the persistent banks and are bound once.
330
+ *
331
+ * `url` is absent only for a `geojson` source with inline `data`: the
332
+ * style carries the payload, so there is nothing to fetch and nothing
333
+ * to bind. `indexUrl` appears on a `sprite` source whose index is a
334
+ * URL rather than inline — fetch it and pass the text as
335
+ * `bindSource(name, atlasBytes, { index })`.
336
+ */
337
+ sources(): Array<any>;
308
338
  /**
309
339
  * Effective attribution declared by the style (document +
310
340
  * sources), joined with ` | `. Upstream TileJSON / PMTiles
@@ -386,6 +416,7 @@ export interface InitOutput {
386
416
  readonly renderer_setGlyphBudget: (a: number, b: number) => void;
387
417
  readonly renderer_setStyle: (a: number, b: number, c: number) => [number, number, number];
388
418
  readonly renderer_sourceTile: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
419
+ readonly renderer_sources: (a: number) => [number, number, number];
389
420
  readonly renderer_tileSize: (a: number) => number;
390
421
  readonly simdEnabled: () => number;
391
422
  readonly threadsEnabled: () => number;
package/simd/web/ezu.js CHANGED
@@ -440,6 +440,12 @@ export class Renderer {
440
440
  * before the next tile that needs it. `neededCodepoints()` already
441
441
  * names exactly what to bind, and a host that re-binds every tile
442
442
  * (rather than tracking what it sent) needs no other change.
443
+ *
444
+ * A budget of `0xFFFFFFFF` — the largest value this host can express,
445
+ * since an address here is 32 bits — lifts the cap again, and is what
446
+ * `memoryUsage().glyphBudget` reports as `Infinity`. A number that
447
+ * big cannot be a real ceiling: it is every byte the module could
448
+ * ever address.
443
449
  * @param {number} bytes
444
450
  */
445
451
  setGlyphBudget(bytes) {
@@ -498,6 +504,37 @@ export class Renderer {
498
504
  }
499
505
  return takeFromExternrefTable0(ret[0]);
500
506
  }
507
+ /**
508
+ * Every source the style declares, in declaration order, as an array
509
+ * of `{ name, type, tileScoped, url?, indexUrl? }`.
510
+ *
511
+ * This is what a host walks before it fetches anything: `type` is the
512
+ * style's own word for the kind (`"mvt"`, `"dem"`, `"glyphs"`, …) and
513
+ * says what `bindSource` will do with the bytes, and `url` is where
514
+ * they come from — an XYZ template for a tile pyramid, a document
515
+ * URL, or, for `glyphs`, the endpoint with `{fontstack}` already
516
+ * substituted and `{range}` left to fill in per block. `boundSources`
517
+ * answers the opposite question, what is already bound, and cannot
518
+ * start the loop.
519
+ *
520
+ * `tileScoped` says whether a binding of that kind is dropped by
521
+ * `clearSources` and has to be rebound for the next tile; the rest go
522
+ * into the persistent banks and are bound once.
523
+ *
524
+ * `url` is absent only for a `geojson` source with inline `data`: the
525
+ * style carries the payload, so there is nothing to fetch and nothing
526
+ * to bind. `indexUrl` appears on a `sprite` source whose index is a
527
+ * URL rather than inline — fetch it and pass the text as
528
+ * `bindSource(name, atlasBytes, { index })`.
529
+ * @returns {Array<any>}
530
+ */
531
+ sources() {
532
+ const ret = wasm.renderer_sources(this.__wbg_ptr);
533
+ if (ret[2]) {
534
+ throw takeFromExternrefTable0(ret[1]);
535
+ }
536
+ return takeFromExternrefTable0(ret[0]);
537
+ }
501
538
  /**
502
539
  * `tile-size` declared by the current style.
503
540
  * @returns {number}
Binary file
@@ -27,6 +27,7 @@ export const renderer_requestedNeighborOffsets: (a: number, b: number, c: number
27
27
  export const renderer_setGlyphBudget: (a: number, b: number) => void;
28
28
  export const renderer_setStyle: (a: number, b: number, c: number) => [number, number, number];
29
29
  export const renderer_sourceTile: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
30
+ export const renderer_sources: (a: number) => [number, number, number];
30
31
  export const renderer_tileSize: (a: number) => number;
31
32
  export const simdEnabled: () => number;
32
33
  export const threadsEnabled: () => number;
package/web/ezu.d.ts CHANGED
@@ -273,6 +273,12 @@ export class Renderer {
273
273
  * before the next tile that needs it. `neededCodepoints()` already
274
274
  * names exactly what to bind, and a host that re-binds every tile
275
275
  * (rather than tracking what it sent) needs no other change.
276
+ *
277
+ * A budget of `0xFFFFFFFF` — the largest value this host can express,
278
+ * since an address here is 32 bits — lifts the cap again, and is what
279
+ * `memoryUsage().glyphBudget` reports as `Infinity`. A number that
280
+ * big cannot be a real ceiling: it is every byte the module could
281
+ * ever address.
276
282
  */
277
283
  setGlyphBudget(bytes: number): void;
278
284
  /**
@@ -305,6 +311,30 @@ export class Renderer {
305
311
  * Throws `UnknownSource` if `name` is not declared in the style.
306
312
  */
307
313
  sourceTile(name: string, z: number, x: number, y: number): any;
314
+ /**
315
+ * Every source the style declares, in declaration order, as an array
316
+ * of `{ name, type, tileScoped, url?, indexUrl? }`.
317
+ *
318
+ * This is what a host walks before it fetches anything: `type` is the
319
+ * style's own word for the kind (`"mvt"`, `"dem"`, `"glyphs"`, …) and
320
+ * says what `bindSource` will do with the bytes, and `url` is where
321
+ * they come from — an XYZ template for a tile pyramid, a document
322
+ * URL, or, for `glyphs`, the endpoint with `{fontstack}` already
323
+ * substituted and `{range}` left to fill in per block. `boundSources`
324
+ * answers the opposite question, what is already bound, and cannot
325
+ * start the loop.
326
+ *
327
+ * `tileScoped` says whether a binding of that kind is dropped by
328
+ * `clearSources` and has to be rebound for the next tile; the rest go
329
+ * into the persistent banks and are bound once.
330
+ *
331
+ * `url` is absent only for a `geojson` source with inline `data`: the
332
+ * style carries the payload, so there is nothing to fetch and nothing
333
+ * to bind. `indexUrl` appears on a `sprite` source whose index is a
334
+ * URL rather than inline — fetch it and pass the text as
335
+ * `bindSource(name, atlasBytes, { index })`.
336
+ */
337
+ sources(): Array<any>;
308
338
  /**
309
339
  * Effective attribution declared by the style (document +
310
340
  * sources), joined with ` | `. Upstream TileJSON / PMTiles
@@ -386,6 +416,7 @@ export interface InitOutput {
386
416
  readonly renderer_setGlyphBudget: (a: number, b: number) => void;
387
417
  readonly renderer_setStyle: (a: number, b: number, c: number) => [number, number, number];
388
418
  readonly renderer_sourceTile: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
419
+ readonly renderer_sources: (a: number) => [number, number, number];
389
420
  readonly renderer_tileSize: (a: number) => number;
390
421
  readonly simdEnabled: () => number;
391
422
  readonly threadsEnabled: () => number;
package/web/ezu.js CHANGED
@@ -440,6 +440,12 @@ export class Renderer {
440
440
  * before the next tile that needs it. `neededCodepoints()` already
441
441
  * names exactly what to bind, and a host that re-binds every tile
442
442
  * (rather than tracking what it sent) needs no other change.
443
+ *
444
+ * A budget of `0xFFFFFFFF` — the largest value this host can express,
445
+ * since an address here is 32 bits — lifts the cap again, and is what
446
+ * `memoryUsage().glyphBudget` reports as `Infinity`. A number that
447
+ * big cannot be a real ceiling: it is every byte the module could
448
+ * ever address.
443
449
  * @param {number} bytes
444
450
  */
445
451
  setGlyphBudget(bytes) {
@@ -498,6 +504,37 @@ export class Renderer {
498
504
  }
499
505
  return takeFromExternrefTable0(ret[0]);
500
506
  }
507
+ /**
508
+ * Every source the style declares, in declaration order, as an array
509
+ * of `{ name, type, tileScoped, url?, indexUrl? }`.
510
+ *
511
+ * This is what a host walks before it fetches anything: `type` is the
512
+ * style's own word for the kind (`"mvt"`, `"dem"`, `"glyphs"`, …) and
513
+ * says what `bindSource` will do with the bytes, and `url` is where
514
+ * they come from — an XYZ template for a tile pyramid, a document
515
+ * URL, or, for `glyphs`, the endpoint with `{fontstack}` already
516
+ * substituted and `{range}` left to fill in per block. `boundSources`
517
+ * answers the opposite question, what is already bound, and cannot
518
+ * start the loop.
519
+ *
520
+ * `tileScoped` says whether a binding of that kind is dropped by
521
+ * `clearSources` and has to be rebound for the next tile; the rest go
522
+ * into the persistent banks and are bound once.
523
+ *
524
+ * `url` is absent only for a `geojson` source with inline `data`: the
525
+ * style carries the payload, so there is nothing to fetch and nothing
526
+ * to bind. `indexUrl` appears on a `sprite` source whose index is a
527
+ * URL rather than inline — fetch it and pass the text as
528
+ * `bindSource(name, atlasBytes, { index })`.
529
+ * @returns {Array<any>}
530
+ */
531
+ sources() {
532
+ const ret = wasm.renderer_sources(this.__wbg_ptr);
533
+ if (ret[2]) {
534
+ throw takeFromExternrefTable0(ret[1]);
535
+ }
536
+ return takeFromExternrefTable0(ret[0]);
537
+ }
501
538
  /**
502
539
  * `tile-size` declared by the current style.
503
540
  * @returns {number}
package/web/ezu_bg.wasm CHANGED
Binary file
@@ -27,6 +27,7 @@ export const renderer_requestedNeighborOffsets: (a: number, b: number, c: number
27
27
  export const renderer_setGlyphBudget: (a: number, b: number) => void;
28
28
  export const renderer_setStyle: (a: number, b: number, c: number) => [number, number, number];
29
29
  export const renderer_sourceTile: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
30
+ export const renderer_sources: (a: number) => [number, number, number];
30
31
  export const renderer_tileSize: (a: number) => number;
31
32
  export const simdEnabled: () => number;
32
33
  export const threadsEnabled: () => number;