@loaders.gl/mvt 4.2.0-alpha.6 → 4.2.0-beta.2

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.
Files changed (59) hide show
  1. package/dist/dist.dev.js +15 -9
  2. package/dist/dist.min.js +1 -1
  3. package/dist/helpers/binary-util-functions.d.ts +3 -3
  4. package/dist/helpers/binary-util-functions.d.ts.map +1 -1
  5. package/dist/helpers/binary-util-functions.js +3 -0
  6. package/dist/helpers/mapbox-util-functions.d.ts +1 -1
  7. package/dist/helpers/mapbox-util-functions.d.ts.map +1 -1
  8. package/dist/helpers/mapbox-util-functions.js +3 -0
  9. package/dist/index.cjs +15 -11
  10. package/dist/index.cjs.map +3 -3
  11. package/dist/index.d.ts +1 -1
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/lib/binary-vector-tile/vector-tile-feature.d.ts +1 -1
  14. package/dist/lib/binary-vector-tile/vector-tile-feature.d.ts.map +1 -1
  15. package/dist/lib/binary-vector-tile/vector-tile-feature.js +4 -2
  16. package/dist/lib/binary-vector-tile/vector-tile-layer.d.ts +5 -5
  17. package/dist/lib/binary-vector-tile/vector-tile-layer.d.ts.map +1 -1
  18. package/dist/lib/binary-vector-tile/vector-tile-layer.js +8 -5
  19. package/dist/lib/binary-vector-tile/vector-tile.d.ts +3 -3
  20. package/dist/lib/binary-vector-tile/vector-tile.d.ts.map +1 -1
  21. package/dist/lib/binary-vector-tile/vector-tile.js +6 -3
  22. package/dist/lib/mapbox-vector-tile/vector-tile-feature.d.ts +1 -1
  23. package/dist/lib/mapbox-vector-tile/vector-tile-feature.d.ts.map +1 -1
  24. package/dist/lib/mapbox-vector-tile/vector-tile-feature.js +4 -1
  25. package/dist/lib/mapbox-vector-tile/vector-tile-layer.d.ts +2 -2
  26. package/dist/lib/mapbox-vector-tile/vector-tile-layer.d.ts.map +1 -1
  27. package/dist/lib/mapbox-vector-tile/vector-tile-layer.js +5 -4
  28. package/dist/lib/mapbox-vector-tile/vector-tile.d.ts +2 -2
  29. package/dist/lib/mapbox-vector-tile/vector-tile.d.ts.map +1 -1
  30. package/dist/lib/mapbox-vector-tile/vector-tile.js +5 -2
  31. package/dist/lib/parse-mvt.d.ts +2 -2
  32. package/dist/lib/parse-mvt.d.ts.map +1 -1
  33. package/dist/lib/parse-mvt.js +7 -4
  34. package/dist/lib/types.d.ts +0 -10
  35. package/dist/lib/types.d.ts.map +1 -1
  36. package/dist/lib/types.js +3 -0
  37. package/dist/mvt-loader.d.ts +63 -6
  38. package/dist/mvt-loader.d.ts.map +1 -1
  39. package/dist/mvt-loader.js +7 -9
  40. package/dist/mvt-worker.js +12 -10
  41. package/dist/tilejson-loader.d.ts +2 -3
  42. package/dist/tilejson-loader.d.ts.map +1 -1
  43. package/dist/tilejson-loader.js +3 -1
  44. package/dist/workers/mvt-worker.js +3 -0
  45. package/package.json +6 -6
  46. package/src/helpers/binary-util-functions.ts +7 -3
  47. package/src/helpers/mapbox-util-functions.ts +5 -1
  48. package/src/index.ts +1 -1
  49. package/src/lib/binary-vector-tile/vector-tile-feature.ts +5 -1
  50. package/src/lib/binary-vector-tile/vector-tile-layer.ts +11 -7
  51. package/src/lib/binary-vector-tile/vector-tile.ts +13 -5
  52. package/src/lib/mapbox-vector-tile/vector-tile-feature.ts +5 -1
  53. package/src/lib/mapbox-vector-tile/vector-tile-layer.ts +6 -2
  54. package/src/lib/mapbox-vector-tile/vector-tile.ts +6 -2
  55. package/src/lib/parse-mvt.ts +13 -8
  56. package/src/lib/types.ts +3 -11
  57. package/src/mvt-loader.ts +35 -22
  58. package/src/tilejson-loader.ts +5 -2
  59. package/src/workers/mvt-worker.ts +4 -0
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type { MVTLoaderOptions } from "./lib/types.js";
1
+ export type { MVTLoaderOptions } from "./mvt-loader.js";
2
2
  export { MVTLoader, MVTWorkerLoader } from "./mvt-loader.js";
3
3
  export type { TileJSON } from "./lib/parse-tilejson.js";
4
4
  export type { TileJSONLoaderOptions } from "./tilejson-loader.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,YAAY,EAAC,gBAAgB,EAAC,uBAAoB;AAClD,OAAO,EAAC,SAAS,EAAE,eAAe,EAAC,wBAAqB;AAExD,YAAY,EAAC,QAAQ,EAAC,gCAA6B;AACnD,YAAY,EAAC,qBAAqB,EAAC,6BAA0B;AAC7D,OAAO,EAAC,cAAc,EAAC,6BAA0B;AAEjD,OAAO,EAAC,SAAS,EAAC,wBAAqB;AAIvC,YAAY,EAAC,mBAAmB,EAAC,6CAA0C;AAC3E,OAAO,EAAC,YAAY,EAAC,6CAA0C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,YAAY,EAAC,gBAAgB,EAAC,wBAAqB;AACnD,OAAO,EAAC,SAAS,EAAE,eAAe,EAAC,wBAAqB;AAExD,YAAY,EAAC,QAAQ,EAAC,gCAA6B;AACnD,YAAY,EAAC,qBAAqB,EAAC,6BAA0B;AAC7D,OAAO,EAAC,cAAc,EAAC,6BAA0B;AAEjD,OAAO,EAAC,SAAS,EAAC,wBAAqB;AAIvC,YAAY,EAAC,mBAAmB,EAAC,6CAA0C;AAC3E,OAAO,EAAC,YAAY,EAAC,6CAA0C"}
@@ -4,7 +4,7 @@ import { classifyRings } from "../../helpers/binary-util-functions.js";
4
4
  export declare const TEST_EXPORTS: {
5
5
  classifyRings: typeof classifyRings;
6
6
  };
7
- export default class VectorTileFeature {
7
+ export declare class BinaryVectorTileFeature {
8
8
  properties: {
9
9
  [x: string]: string | number | boolean | null;
10
10
  };
@@ -1 +1 @@
1
- {"version":3,"file":"vector-tile-feature.d.ts","sourceRoot":"","sources":["../../../src/lib/binary-vector-tile/vector-tile-feature.ts"],"names":[],"mappings":"AAEA,OAAO,QAAQ,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAC,WA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CAWf"}
@@ -1,4 +1,6 @@
1
- // This code is forked from https://github.com/mapbox/vector-tile-js under BSD 3-clause license.
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
2
4
  import { classifyRings, project, readFeature } from "../../helpers/binary-util-functions.js";
3
5
  // Reduce GC by reusing variables
4
6
  let endPos;
@@ -11,7 +13,7 @@ let i;
11
13
  export const TEST_EXPORTS = {
12
14
  classifyRings
13
15
  };
14
- export default class VectorTileFeature {
16
+ export class BinaryVectorTileFeature {
15
17
  properties;
16
18
  extent;
17
19
  type;
@@ -1,7 +1,7 @@
1
- import VectorTileFeature from "./vector-tile-feature.js";
1
+ import { BinaryVectorTileFeature } from "./vector-tile-feature.js";
2
2
  import Protobuf from 'pbf';
3
3
  import { GeojsonGeometryInfo } from '@loaders.gl/schema';
4
- export default class VectorTileLayer {
4
+ export declare class BinaryVectorTileLayer {
5
5
  version: number;
6
6
  name: string;
7
7
  extent: number;
@@ -12,12 +12,12 @@ export default class VectorTileLayer {
12
12
  _features: number[];
13
13
  constructor(pbf: Protobuf, end: number);
14
14
  /**
15
- * return feature `i` from this layer as a `VectorTileFeature`
15
+ * return feature `i` from this layer as a `BinaryVectorTileFeature`
16
16
  *
17
17
  * @param index
18
18
  * @param geometryInfo
19
- * @returns {VectorTileFeature}
19
+ * @returns {BinaryVectorTileFeature}
20
20
  */
21
- feature(i: number, geometryInfo: GeojsonGeometryInfo): VectorTileFeature;
21
+ feature(i: number, geometryInfo: GeojsonGeometryInfo): BinaryVectorTileFeature;
22
22
  }
23
23
  //# sourceMappingURL=vector-tile-layer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"vector-tile-layer.d.ts","sourceRoot":"","sources":["../../../src/lib/binary-vector-tile/vector-tile-layer.ts"],"names":[],"mappings":"AAGA,OAAO,iBAAiB,iCAA8B;AACtD,OAAO,QAAQ,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAC,mBAAmB,EAAC,MAAM,oBAAo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+1,10 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
1
4
  /* eslint-disable indent */
2
5
  // This code is forked from https://github.com/mapbox/vector-tile-js under BSD 3-clause license.
3
- import VectorTileFeature from "./vector-tile-feature.js";
4
- export default class VectorTileLayer {
6
+ import { BinaryVectorTileFeature } from "./vector-tile-feature.js";
7
+ export class BinaryVectorTileLayer {
5
8
  version;
6
9
  name;
7
10
  extent;
@@ -25,11 +28,11 @@ export default class VectorTileLayer {
25
28
  this.length = this._features.length;
26
29
  }
27
30
  /**
28
- * return feature `i` from this layer as a `VectorTileFeature`
31
+ * return feature `i` from this layer as a `BinaryVectorTileFeature`
29
32
  *
30
33
  * @param index
31
34
  * @param geometryInfo
32
- * @returns {VectorTileFeature}
35
+ * @returns {BinaryVectorTileFeature}
33
36
  */
34
37
  feature(i, geometryInfo) {
35
38
  if (i < 0 || i >= this._features.length) {
@@ -37,7 +40,7 @@ export default class VectorTileLayer {
37
40
  }
38
41
  this._pbf.pos = this._features[i];
39
42
  const end = this._pbf.readVarint() + this._pbf.pos;
40
- return new VectorTileFeature(this._pbf, end, this.extent, this._keys, this._values, geometryInfo);
43
+ return new BinaryVectorTileFeature(this._pbf, end, this.extent, this._keys, this._values, geometryInfo);
41
44
  }
42
45
  }
43
46
  /**
@@ -1,8 +1,8 @@
1
- import VectorTileLayer from "./vector-tile-layer.js";
1
+ import { BinaryVectorTileLayer } from "./vector-tile-layer.js";
2
2
  import Protobuf from 'pbf';
3
- export default class VectorTile {
3
+ export declare class BinaryVectorTile {
4
4
  layers: {
5
- [x: string]: VectorTileLayer;
5
+ [x: string]: BinaryVectorTileLayer;
6
6
  };
7
7
  constructor(pbf: Protobuf, end?: number);
8
8
  }
@@ -1 +1 @@
1
- {"version":3,"file":"vector-tile.d.ts","sourceRoot":"","sources":["../../../src/lib/binary-vector-tile/vector-tile.ts"],"names":[],"mappings":"AAEA,OAAO,eAAe,+BAA4B;AAClD,OAAO,QAAQ,MAAM,KAAK,CAAC;AAE3B,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B,MAAM,EAAE;QAAC,CAAC,CAAC,EAAE,MAAM,GAAG,eAAe,CAAA;KAAC,CAAC;gBAC3B,GAAG,EAAE,QAAQ,EAAE,GAAG,CAAC,EAAE,MAAM;CAGxC"}
1
+ {"version":3,"file":"vector-tile.d.ts","sourceRoot":"","sources":["../../../src/lib/binary-vector-tile/vector-tile.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,qBAAqB,EAAC,+BAA4B;AAC1D,OAAO,QAAQ,MAAM,KAAK,CAAC;AAE3B,qBAAa,gBAAgB;IAC3B,MAAM,EAAE;QAAC,CAAC,CAAC,EAAE,MAAM,GAAG,qBAAqB,CAAA;KAAC,CAAC;gBACjC,GAAG,EAAE,QAAQ,EAAE,GAAG,CAAC,EAAE,MAAM;CAGxC"}
@@ -1,6 +1,9 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
1
4
  // This code is forked from https://github.com/mapbox/vector-tile-js under BSD 3-clause license.
2
- import VectorTileLayer from "./vector-tile-layer.js";
3
- export default class VectorTile {
5
+ import { BinaryVectorTileLayer } from "./vector-tile-layer.js";
6
+ export class BinaryVectorTile {
4
7
  layers;
5
8
  constructor(pbf, end) {
6
9
  this.layers = pbf.readFields(readTile, {}, end);
@@ -15,7 +18,7 @@ export default class VectorTile {
15
18
  function readTile(tag, layers, pbf) {
16
19
  if (tag === 3) {
17
20
  if (pbf) {
18
- const layer = new VectorTileLayer(pbf, pbf.readVarint() + pbf.pos);
21
+ const layer = new BinaryVectorTileLayer(pbf, pbf.readVarint() + pbf.pos);
19
22
  if (layer.length && layers) {
20
23
  layers[layer.name] = layer;
21
24
  }
@@ -1,6 +1,6 @@
1
1
  import Protobuf from 'pbf';
2
2
  import { MVTMapboxCoordinates, MVTMapboxGeometry } from "../types.js";
3
- export default class VectorTileFeature {
3
+ export declare class VectorTileFeature {
4
4
  properties: {
5
5
  [x: string]: string | number | boolean | null;
6
6
  };
@@ -1 +1 @@
1
- {"version":3,"file":"vector-tile-feature.d.ts","sourceRoot":"","sources":["../../../src/lib/mapbox-vector-tile/vector-tile-feature.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAC,oBAAoB,EAAE,iBAAiB,EAAC,oBAAiB;AAGjE,MAAM,CAAC,OAAO,OAAO,iBAAiB;IACpC,UAAU,EAAE;QAAC,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;KAAC,CAAC;IAC5D,MAAM,EAAE,GAAG,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC;IAC9C,MAAM,KAAK,KAAK,aAEf;gBAGC,GAAG,EAAE,QAAQ,EACb,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,GAAG,EACX,IAAI,EAAE,MAAM,EAAE,EACd,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,EAAE;IAkB9C,YAAY,IAAI,iBAAiB;IA+CjC,IAAI;IAsCJ,UAAU,CAAC,SAAS,KAAA;IAuDpB,SAAS,CACP,OAAO,EAAE;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAC,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE;QAAC,MAAM,EAAE,GAAG,CAAA;KAAC,KAAK,IAAI,CAAC,GAC9F,oBAAoB;CAmBxB"}
1
+ {"version":3,"file":"vector-tile-feature.d.ts","sourceRoot":"","sources":["../../../src/lib/mapbox-vector-tile/vector-tile-feature.ts"],"names":[],"mappings":"AAKA,OAAO,QAAQ,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAC,oBAAoB,EAAE,iBAAiB,EAAC,oBAAiB;AAGjE,qBAAa,iBAAiB;IAC5B,UAAU,EAAE;QAAC,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;KAAC,CAAC;IAC5D,MAAM,EAAE,GAAG,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC;IAC9C,MAAM,KAAK,KAAK,aAEf;gBAGC,GAAG,EAAE,QAAQ,EACb,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,GAAG,EACX,IAAI,EAAE,MAAM,EAAE,EACd,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,EAAE;IAkB9C,YAAY,IAAI,iBAAiB;IA+CjC,IAAI;IAsCJ,UAAU,CAAC,SAAS,KAAA;IAuDpB,SAAS,CACP,OAAO,EAAE;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAC,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE;QAAC,MAAM,EAAE,GAAG,CAAA;KAAC,KAAK,IAAI,CAAC,GAC9F,oBAAoB;CAmBxB"}
@@ -1,5 +1,8 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
1
4
  import { readFeature, classifyRings } from "../../helpers/mapbox-util-functions.js";
2
- export default class VectorTileFeature {
5
+ export class VectorTileFeature {
3
6
  properties;
4
7
  extent;
5
8
  type;
@@ -1,6 +1,6 @@
1
1
  import Protobuf from 'pbf';
2
- import VectorTileFeature from "./vector-tile-feature.js";
3
- export default class VectorTileLayer {
2
+ import { VectorTileFeature } from "./vector-tile-feature.js";
3
+ export declare class VectorTileLayer {
4
4
  version: number;
5
5
  name: string;
6
6
  extent: number;
@@ -1 +1 @@
1
- {"version":3,"file":"vector-tile-layer.d.ts","sourceRoot":"","sources":["../../../src/lib/mapbox-vector-tile/vector-tile-layer.ts"],"names":[],"mappings":"AAGA,OAAO,QAAQ,MAAM,KAAK,CAAC;AAC3B,OAAO,iBAAiB,iCAA8B;AAEtD,MAAM,CAAC,OAAO,OAAO,eAAe;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC;IAC9C,SAAS,EAAE,MAAM,EAAE,CAAC;gBACR,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM;IAkBtC;;;;OAIG;IAEH,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,iBAAiB;CAUtC"}
1
+ {"version":3,"file":"vector-tile-layer.d.ts","sourceRoot":"","sources":["../../../src/lib/mapbox-vector-tile/vector-tile-layer.ts"],"names":[],"mappings":"AAOA,OAAO,QAAQ,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAC,iBAAiB,EAAC,iCAA8B;AAExD,qBAAa,eAAe;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC;IAC9C,SAAS,EAAE,MAAM,EAAE,CAAC;gBACR,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM;IAkBtC;;;;OAIG;IAEH,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,iBAAiB;CAUtC"}
@@ -1,7 +1,8 @@
1
- /* eslint-disable indent */
2
- // This code is forked from https://github.com/mapbox/vector-tile-js under BSD 3-clause license.
3
- import VectorTileFeature from "./vector-tile-feature.js";
4
- export default class VectorTileLayer {
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
4
+ import { VectorTileFeature } from "./vector-tile-feature.js";
5
+ export class VectorTileLayer {
5
6
  version;
6
7
  name;
7
8
  extent;
@@ -1,6 +1,6 @@
1
- import VectorTileLayer from "./vector-tile-layer.js";
1
+ import { VectorTileLayer } from "./vector-tile-layer.js";
2
2
  import Protobuf from 'pbf';
3
- export default class VectorTile {
3
+ export declare class VectorTile {
4
4
  layers: {
5
5
  [x: string]: VectorTileLayer;
6
6
  };
@@ -1 +1 @@
1
- {"version":3,"file":"vector-tile.d.ts","sourceRoot":"","sources":["../../../src/lib/mapbox-vector-tile/vector-tile.ts"],"names":[],"mappings":"AAEA,OAAO,eAAe,+BAA4B;AAClD,OAAO,QAAQ,MAAM,KAAK,CAAC;AAE3B,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B,MAAM,EAAE;QAAC,CAAC,CAAC,EAAE,MAAM,GAAG,eAAe,CAAA;KAAC,CAAC;gBAC3B,GAAG,EAAE,QAAQ,EAAE,GAAG,CAAC,EAAE,MAAM;CAGxC"}
1
+ {"version":3,"file":"vector-tile.d.ts","sourceRoot":"","sources":["../../../src/lib/mapbox-vector-tile/vector-tile.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,eAAe,EAAC,+BAA4B;AACpD,OAAO,QAAQ,MAAM,KAAK,CAAC;AAE3B,qBAAa,UAAU;IACrB,MAAM,EAAE;QAAC,CAAC,CAAC,EAAE,MAAM,GAAG,eAAe,CAAA;KAAC,CAAC;gBAC3B,GAAG,EAAE,QAAQ,EAAE,GAAG,CAAC,EAAE,MAAM;CAGxC"}
@@ -1,6 +1,9 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
1
4
  // This code is forked from https://github.com/mapbox/vector-tile-js under BSD 3-clause license.
2
- import VectorTileLayer from "./vector-tile-layer.js";
3
- export default class VectorTile {
5
+ import { VectorTileLayer } from "./vector-tile-layer.js";
6
+ export class VectorTile {
4
7
  layers;
5
8
  constructor(pbf, end) {
6
9
  this.layers = pbf.readFields(readTile, {}, end);
@@ -1,5 +1,5 @@
1
1
  import type { Feature, BinaryFeatureCollection, GeoJSONTable } from '@loaders.gl/schema';
2
- import type { MVTLoaderOptions } from "../lib/types.js";
2
+ import type { MVTLoaderOptions } from "../mvt-loader.js";
3
3
  /**
4
4
  * Parse MVT arrayBuffer and return GeoJSON.
5
5
  *
@@ -7,7 +7,7 @@ import type { MVTLoaderOptions } from "../lib/types.js";
7
7
  * @param options
8
8
  * @returns A GeoJSON geometry object or a binary representation
9
9
  */
10
- export default function parseMVT(arrayBuffer: ArrayBuffer, options?: MVTLoaderOptions): BinaryFeatureCollection | GeoJSONTable | Feature<import("geojson").Geometry, import("geojson").GeoJsonProperties>[] | {
10
+ export declare function parseMVT(arrayBuffer: ArrayBuffer, options?: MVTLoaderOptions): BinaryFeatureCollection | GeoJSONTable | Feature<import("geojson").Geometry, import("geojson").GeoJsonProperties>[] | {
11
11
  shape: string;
12
12
  data: BinaryFeatureCollection;
13
13
  };
@@ -1 +1 @@
1
- {"version":3,"file":"parse-mvt.d.ts","sourceRoot":"","sources":["../../src/lib/parse-mvt.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,OAAO,EAEP,uBAAuB,EACvB,YAAY,EACb,MAAM,oBAAoB,CAAC;AAG5B,OAAO,KAAK,EAAmC,gBAAgB,EAAC,wBAAqB;AAOrF;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,gBAAgB;;;EAyBpF"}
1
+ {"version":3,"file":"parse-mvt.d.ts","sourceRoot":"","sources":["../../src/lib/parse-mvt.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAEV,OAAO,EAEP,uBAAuB,EACvB,YAAY,EACb,MAAM,oBAAoB,CAAC;AAI5B,OAAO,KAAK,EAAC,gBAAgB,EAAC,yBAAsB;AAOpD;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,gBAAgB;;;EAyB5E"}
@@ -1,7 +1,10 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
1
4
  import { flatGeojsonToBinary } from '@loaders.gl/gis';
2
5
  import Protobuf from 'pbf';
3
- import VectorTile from "./mapbox-vector-tile/vector-tile.js";
4
- import BinaryVectorTile from "./binary-vector-tile/vector-tile.js";
6
+ import { VectorTile } from "./mapbox-vector-tile/vector-tile.js";
7
+ import { BinaryVectorTile } from "./binary-vector-tile/vector-tile.js";
5
8
  /**
6
9
  * Parse MVT arrayBuffer and return GeoJSON.
7
10
  *
@@ -9,7 +12,7 @@ import BinaryVectorTile from "./binary-vector-tile/vector-tile.js";
9
12
  * @param options
10
13
  * @returns A GeoJSON geometry object or a binary representation
11
14
  */
12
- export default function parseMVT(arrayBuffer, options) {
15
+ export function parseMVT(arrayBuffer, options) {
13
16
  const mvtOptions = normalizeOptions(options);
14
17
  const shape = options?.gis?.format || options?.mvt?.shape || options?.shape;
15
18
  switch (shape) {
@@ -132,7 +135,7 @@ function getDecodedFeature(feature, options, layerName) {
132
135
  */
133
136
  function getDecodedFeatureBinary(feature, options, layerName) {
134
137
  const decodedFeature = feature.toBinaryCoordinates(
135
- // @ts-expect-error What is going on here?
138
+ // @ts-expect-error
136
139
  options.coordinates === 'wgs84' ? options.tileIndex : transformToLocalCoordinatesBinary);
137
140
  // Add layer name to GeoJSON properties
138
141
  if (options.layerProperty && decodedFeature.properties) {
@@ -1,4 +1,3 @@
1
- import type { LoaderOptions } from '@loaders.gl/loader-utils';
2
1
  /** For local coordinates, the tileIndex is not required */
3
2
  type MVTLocalCoordinatesOptions = {
4
3
  /**
@@ -54,14 +53,5 @@ export type MVTMapboxCoordinates = {
54
53
  };
55
54
  id?: number;
56
55
  };
57
- export type MVTLoaderOptions = LoaderOptions & {
58
- mvt?: MVTOptions;
59
- gis?: {
60
- /** `true`: parser will output the data in binary format. Equivalent to loading the data as GeoJSON and then applying geojsonToBinary */
61
- binary?: boolean;
62
- /** @deprecated. Use options.mvt.shape */
63
- format?: 'geojson-table' | 'columnar-table' | 'geojson' | 'binary' | 'binary-geometry';
64
- };
65
- };
66
56
  export {};
67
57
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAE5D,2DAA2D;AAC3D,KAAK,0BAA0B,GAAG;IAChC;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,IAAI,CAAC;CACjB,CAAC;AAEF,sDAAsD;AACtD,KAAK,0BAA0B,GAAG;IAChC;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;OAGG;IACH,SAAS,CAAC,EAAE;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC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
1
4
  export {};
@@ -1,13 +1,70 @@
1
- import type { Loader, LoaderWithParser } from '@loaders.gl/loader-utils';
2
- import type { MVTLoaderOptions } from "./lib/types.js";
1
+ import type { LoaderOptions } from '@loaders.gl/loader-utils';
2
+ import { parseMVT } from "./lib/parse-mvt.js";
3
+ import type { MVTOptions } from "./lib/types.js";
4
+ export type MVTLoaderOptions = LoaderOptions & {
5
+ mvt?: MVTOptions & {
6
+ /** Override the URL to the worker bundle (by default loads from unpkg.com) */
7
+ workerUrl?: string;
8
+ };
9
+ gis?: {
10
+ /** `true`: parser will output the data in binary format. Equivalent to loading the data as GeoJSON and then applying geojsonToBinary */
11
+ binary?: boolean;
12
+ /** @deprecated. Use options.mvt.shape */
13
+ format?: 'geojson-table' | 'columnar-table' | 'geojson' | 'binary' | 'binary-geometry';
14
+ };
15
+ };
3
16
  /**
4
17
  * Worker loader for the Mapbox Vector Tile format
5
18
  */
6
- export declare const MVTWorkerLoader: Loader<any, // BinaryFeatureCollection | GeoJSONTable | Feature<Geometry, GeoJsonProperties>,
7
- never, MVTLoaderOptions>;
19
+ export declare const MVTWorkerLoader: {
20
+ readonly dataType: any;
21
+ readonly batchType: never;
22
+ readonly name: "Mapbox Vector Tile";
23
+ readonly id: "mvt";
24
+ readonly module: "mvt";
25
+ readonly version: any;
26
+ readonly extensions: ["mvt", "pbf"];
27
+ readonly mimeTypes: ["application/vnd.mapbox-vector-tile", "application/x-protobuf"];
28
+ readonly worker: true;
29
+ readonly category: "geometry";
30
+ readonly options: {
31
+ readonly mvt: {
32
+ readonly shape: "geojson";
33
+ readonly coordinates: "local";
34
+ readonly layerProperty: "layerName";
35
+ readonly layers: undefined;
36
+ readonly tileIndex: null;
37
+ };
38
+ };
39
+ };
8
40
  /**
9
41
  * Loader for the Mapbox Vector Tile format
10
42
  */
11
- export declare const MVTLoader: LoaderWithParser<any, // BinaryFeatureCollection | GeoJSONTable | Feature<Geometry, GeoJsonProperties>,
12
- never, MVTLoaderOptions>;
43
+ export declare const MVTLoader: {
44
+ readonly parse: (arrayBuffer: ArrayBuffer, options?: MVTLoaderOptions) => Promise<import("@loaders.gl/schema").BinaryFeatureCollection | import("@loaders.gl/schema").GeoJSONTable | import("geojson").Feature<import("geojson").Geometry, import("geojson").GeoJsonProperties>[] | {
45
+ shape: string;
46
+ data: import("@loaders.gl/schema").BinaryFeatureCollection;
47
+ }>;
48
+ readonly parseSync: typeof parseMVT;
49
+ readonly binary: true;
50
+ readonly dataType: any;
51
+ readonly batchType: never;
52
+ readonly name: "Mapbox Vector Tile";
53
+ readonly id: "mvt";
54
+ readonly module: "mvt";
55
+ readonly version: any;
56
+ readonly extensions: ["mvt", "pbf"];
57
+ readonly mimeTypes: ["application/vnd.mapbox-vector-tile", "application/x-protobuf"];
58
+ readonly worker: true;
59
+ readonly category: "geometry";
60
+ readonly options: {
61
+ readonly mvt: {
62
+ readonly shape: "geojson";
63
+ readonly coordinates: "local";
64
+ readonly layerProperty: "layerName";
65
+ readonly layers: undefined;
66
+ readonly tileIndex: null;
67
+ };
68
+ };
69
+ };
13
70
  //# sourceMappingURL=mvt-loader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mvt-loader.d.ts","sourceRoot":"","sources":["../src/mvt-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAE,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AACvE,OAAO,KAAK,EAAC,gBAAgB,EAAC,uBAAoB;AAclD;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAClC,GAAG,EAAE,iFAAiF;AACtF,KAAK,EACL,gBAAgB,CAyBjB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,gBAAgB,CACtC,GAAG,EAAE,iFAAiF;AACtF,KAAK,EACL,gBAAgB,CAMjB,CAAC"}
1
+ {"version":3,"file":"mvt-loader.d.ts","sourceRoot":"","sources":["../src/mvt-loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAA2B,aAAa,EAAC,MAAM,0BAA0B,CAAC;AACtF,OAAO,EAAC,QAAQ,EAAC,2BAAwB;AACzC,OAAO,KAAK,EAAC,UAAU,EAAC,uBAAoB;AAM5C,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC7C,GAAG,CAAC,EAAE,UAAU,GAAG;QACjB,8EAA8E;QAC9E,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,GAAG,CAAC,EAAE;QACJ,wIAAwI;QACxI,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,yCAAyC;QACzC,MAAM,CAAC,EAAE,eAAe,GAAG,gBAAgB,GAAG,SAAS,GAAG,QAAQ,GAAG,iBAAiB,CAAC;KACxF,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;CA+B3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS;yDAEiB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;CAOtD,CAAC"}
@@ -1,18 +1,16 @@
1
- // import type {
2
- // Feature,
3
- // BinaryFeatureCollection,
4
- // GeoJSONTable,
5
- // Geometry,
6
- // GeoJsonProperties
7
- // } from '@loaders.gl/schema';
8
- import parseMVT from "./lib/parse-mvt.js";
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
4
+ import { parseMVT } from "./lib/parse-mvt.js";
9
5
  // __VERSION__ is injected by babel-plugin-version-inline
10
6
  // @ts-ignore TS2304: Cannot find name '__VERSION__'.
11
- const VERSION = typeof "4.2.0-alpha.5" !== 'undefined' ? "4.2.0-alpha.5" : 'latest';
7
+ const VERSION = typeof "4.2.0-beta.1" !== 'undefined' ? "4.2.0-beta.1" : 'latest';
12
8
  /**
13
9
  * Worker loader for the Mapbox Vector Tile format
14
10
  */
15
11
  export const MVTWorkerLoader = {
12
+ dataType: null,
13
+ batchType: null,
16
14
  name: 'Mapbox Vector Tile',
17
15
  id: 'mvt',
18
16
  module: 'mvt',
@@ -2004,7 +2004,7 @@
2004
2004
  var x;
2005
2005
  var y;
2006
2006
  var i;
2007
- var VectorTileFeature2 = class {
2007
+ var BinaryVectorTileFeature = class {
2008
2008
  properties;
2009
2009
  extent;
2010
2010
  type;
@@ -2119,7 +2119,7 @@
2119
2119
  };
2120
2120
 
2121
2121
  // src/lib/binary-vector-tile/vector-tile-layer.ts
2122
- var VectorTileLayer2 = class {
2122
+ var BinaryVectorTileLayer = class {
2123
2123
  version;
2124
2124
  name;
2125
2125
  extent;
@@ -2141,11 +2141,11 @@
2141
2141
  this.length = this._features.length;
2142
2142
  }
2143
2143
  /**
2144
- * return feature `i` from this layer as a `VectorTileFeature`
2144
+ * return feature `i` from this layer as a `BinaryVectorTileFeature`
2145
2145
  *
2146
2146
  * @param index
2147
2147
  * @param geometryInfo
2148
- * @returns {VectorTileFeature}
2148
+ * @returns {BinaryVectorTileFeature}
2149
2149
  */
2150
2150
  feature(i2, geometryInfo) {
2151
2151
  if (i2 < 0 || i2 >= this._features.length) {
@@ -2153,7 +2153,7 @@
2153
2153
  }
2154
2154
  this._pbf.pos = this._features[i2];
2155
2155
  const end = this._pbf.readVarint() + this._pbf.pos;
2156
- return new VectorTileFeature2(
2156
+ return new BinaryVectorTileFeature(
2157
2157
  this._pbf,
2158
2158
  end,
2159
2159
  this.extent,
@@ -2190,7 +2190,7 @@
2190
2190
  }
2191
2191
 
2192
2192
  // src/lib/binary-vector-tile/vector-tile.ts
2193
- var VectorTile2 = class {
2193
+ var BinaryVectorTile = class {
2194
2194
  layers;
2195
2195
  constructor(pbf, end) {
2196
2196
  this.layers = pbf.readFields(readTile2, {}, end);
@@ -2199,7 +2199,7 @@
2199
2199
  function readTile2(tag, layers, pbf) {
2200
2200
  if (tag === 3) {
2201
2201
  if (pbf) {
2202
- const layer = new VectorTileLayer2(pbf, pbf.readVarint() + pbf.pos);
2202
+ const layer = new BinaryVectorTileLayer(pbf, pbf.readVarint() + pbf.pos);
2203
2203
  if (layer.length && layers) {
2204
2204
  layers[layer.name] = layer;
2205
2205
  }
@@ -2255,7 +2255,7 @@
2255
2255
  if (arrayBuffer.byteLength <= 0) {
2256
2256
  return [features, geometryInfo];
2257
2257
  }
2258
- const tile = new VectorTile2(new import_pbf.default(arrayBuffer));
2258
+ const tile = new BinaryVectorTile(new import_pbf.default(arrayBuffer));
2259
2259
  const selectedLayers = options && Array.isArray(options.layers) ? options.layers : Object.keys(tile.layers);
2260
2260
  selectedLayers.forEach((layerName) => {
2261
2261
  const vectorTileLayer = tile.layers[layerName];
@@ -2314,7 +2314,7 @@
2314
2314
  }
2315
2315
  function getDecodedFeatureBinary(feature, options, layerName) {
2316
2316
  const decodedFeature = feature.toBinaryCoordinates(
2317
- // @ts-expect-error What is going on here?
2317
+ // @ts-expect-error
2318
2318
  options.coordinates === "wgs84" ? options.tileIndex : transformToLocalCoordinatesBinary
2319
2319
  );
2320
2320
  if (options.layerProperty && decodedFeature.properties) {
@@ -2338,8 +2338,10 @@
2338
2338
  }
2339
2339
 
2340
2340
  // src/mvt-loader.ts
2341
- var VERSION = true ? "4.2.0-alpha.5" : "latest";
2341
+ var VERSION = true ? "4.2.0-beta.1" : "latest";
2342
2342
  var MVTWorkerLoader = {
2343
+ dataType: null,
2344
+ batchType: null,
2343
2345
  name: "Mapbox Vector Tile",
2344
2346
  id: "mvt",
2345
2347
  module: "mvt",
@@ -1,5 +1,4 @@
1
- import type { LoaderWithParser, LoaderOptions } from '@loaders.gl/loader-utils';
2
- import type { TileJSON } from "./lib/parse-tilejson.js";
1
+ import type { LoaderOptions } from '@loaders.gl/loader-utils';
3
2
  export type TileJSONLoaderOptions = LoaderOptions & {
4
3
  /** Options for the TileJSONLoader */
5
4
  tilejson?: {
@@ -10,5 +9,5 @@ export type TileJSONLoaderOptions = LoaderOptions & {
10
9
  /**
11
10
  * Loader for TileJSON metadata
12
11
  */
13
- export declare const TileJSONLoader: LoaderWithParser<TileJSON, never, TileJSONLoaderOptions>;
12
+ export declare const TileJSONLoader: any;
14
13
  //# sourceMappingURL=tilejson-loader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tilejson-loader.d.ts","sourceRoot":"","sources":["../src/tilejson-loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,gBAAgB,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAC9E,OAAO,KAAK,EAAC,QAAQ,EAAC,gCAA6B;AAOnD,MAAM,MAAM,qBAAqB,GAAG,aAAa,GAAG;IAClD,qCAAqC;IACrC,QAAQ,CAAC,EAAE;QACT,kCAAkC;QAClC,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,gBAAgB,CAAC,QAAQ,EAAE,KAAK,EAAE,qBAAqB,CAyBnF,CAAC"}
1
+ {"version":3,"file":"tilejson-loader.d.ts","sourceRoot":"","sources":["../src/tilejson-loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAmB,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAQ9E,MAAM,MAAM,qBAAqB,GAAG,aAAa,GAAG;IAClD,qCAAqC;IACrC,QAAQ,CAAC,EAAE;QACT,kCAAkC;QAClC,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,KA4BkD,CAAC"}
@@ -4,11 +4,13 @@
4
4
  import { parseTileJSON } from "./lib/parse-tilejson.js";
5
5
  // __VERSION__ is injected by babel-plugin-version-inline
6
6
  // @ts-ignore TS2304: Cannot find name '__VERSION__'.
7
- const VERSION = typeof "4.2.0-alpha.5" !== 'undefined' ? "4.2.0-alpha.5" : 'latest';
7
+ const VERSION = typeof "4.2.0-beta.1" !== 'undefined' ? "4.2.0-beta.1" : 'latest';
8
8
  /**
9
9
  * Loader for TileJSON metadata
10
10
  */
11
11
  export const TileJSONLoader = {
12
+ dataType: null,
13
+ batchType: null,
12
14
  name: 'TileJSON',
13
15
  id: 'tilejson',
14
16
  module: 'pmtiles',
@@ -1,3 +1,6 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright vis.gl contributors
1
4
  import { MVTLoader } from "../mvt-loader.js";
2
5
  import { createLoaderWorker } from '@loaders.gl/loader-utils';
3
6
  createLoaderWorker(MVTLoader);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@loaders.gl/mvt",
3
3
  "description": "Loader for Mapbox Vector Tiles",
4
- "version": "4.2.0-alpha.6",
4
+ "version": "4.2.0-beta.2",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "publishConfig": {
@@ -41,10 +41,10 @@
41
41
  "build-worker": "esbuild src/workers/mvt-worker.ts --bundle --outfile=dist/mvt-worker.js --define:__VERSION__=\\\"$npm_package_version\\\""
42
42
  },
43
43
  "dependencies": {
44
- "@loaders.gl/gis": "4.2.0-alpha.6",
45
- "@loaders.gl/images": "4.2.0-alpha.6",
46
- "@loaders.gl/loader-utils": "4.2.0-alpha.6",
47
- "@loaders.gl/schema": "4.2.0-alpha.6",
44
+ "@loaders.gl/gis": "4.2.0-beta.2",
45
+ "@loaders.gl/images": "4.2.0-beta.2",
46
+ "@loaders.gl/loader-utils": "4.2.0-beta.2",
47
+ "@loaders.gl/schema": "4.2.0-beta.2",
48
48
  "@math.gl/polygon": "^4.0.0",
49
49
  "pbf": "^3.2.1"
50
50
  },
@@ -54,5 +54,5 @@
54
54
  "peerDependencies": {
55
55
  "@loaders.gl/core": "^4.0.0"
56
56
  },
57
- "gitHead": "37bd8ca71763529f18727ee4bf29dd176aa914ca"
57
+ "gitHead": "13c03663fec365a4d24c06377d50035cebd7ba9f"
58
58
  }