@loaders.gl/tiles 5.0.0-alpha.12 → 5.0.0-alpha.13
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/LICENSE +1 -1
- package/README.md +18 -72
- package/dist/dist.dev.js +6979 -42928
- package/dist/dist.min.js +3 -22
- package/dist/image-set.d.ts +1 -1
- package/dist/image-set.d.ts.map +1 -1
- package/dist/index.cjs +2847 -8781
- package/dist/index.cjs.map +3 -4
- package/dist/index.d.ts +4 -45
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -27
- package/dist/index.js.map +1 -1
- package/dist/mlt/bundled.d.ts +3 -0
- package/dist/mlt/bundled.d.ts.map +1 -0
- package/dist/mlt/bundled.js +5 -0
- package/dist/mlt/bundled.js.map +1 -0
- package/dist/mlt/index.cjs +3701 -0
- package/dist/mlt/index.cjs.map +6 -0
- package/dist/mlt/index.d.ts +10 -0
- package/dist/mlt/index.d.ts.map +1 -0
- package/dist/mlt/index.js +12 -0
- package/dist/mlt/index.js.map +1 -0
- package/dist/mlt/lib/encode-mlt-geometry.d.ts +6 -0
- package/dist/mlt/lib/encode-mlt-geometry.d.ts.map +1 -0
- package/dist/mlt/lib/encode-mlt-geometry.js +150 -0
- package/dist/mlt/lib/encode-mlt-geometry.js.map +1 -0
- package/dist/mlt/lib/encode-mlt-streams.d.ts +13 -0
- package/dist/mlt/lib/encode-mlt-streams.d.ts.map +1 -0
- package/dist/mlt/lib/encode-mlt-streams.js +57 -0
- package/dist/mlt/lib/encode-mlt-streams.js.map +1 -0
- package/dist/mlt/lib/encode-mlt.d.ts +6 -0
- package/dist/mlt/lib/encode-mlt.d.ts.map +1 -0
- package/dist/mlt/lib/encode-mlt.js +174 -0
- package/dist/mlt/lib/encode-mlt.js.map +1 -0
- package/dist/mlt/lib/parse-mlt.d.ts +11 -0
- package/dist/mlt/lib/parse-mlt.d.ts.map +1 -0
- package/dist/mlt/lib/parse-mlt.js +675 -0
- package/dist/mlt/lib/parse-mlt.js.map +1 -0
- package/dist/mlt/mlt-format.d.ts +14 -0
- package/dist/mlt/mlt-format.d.ts.map +1 -0
- package/dist/mlt/mlt-format.js +17 -0
- package/dist/mlt/mlt-format.js.map +1 -0
- package/dist/mlt/mlt-loader-with-parser.d.ts +91 -0
- package/dist/mlt/mlt-loader-with-parser.d.ts.map +1 -0
- package/dist/mlt/mlt-loader-with-parser.js +29 -0
- package/dist/mlt/mlt-loader-with-parser.js.map +1 -0
- package/dist/mlt/mlt-loader.d.ts +115 -0
- package/dist/mlt/mlt-loader.d.ts.map +1 -0
- package/dist/mlt/mlt-loader.js +38 -0
- package/dist/mlt/mlt-loader.js.map +1 -0
- package/dist/mlt/mlt-source-loader.d.ts +82 -0
- package/dist/mlt/mlt-source-loader.d.ts.map +1 -0
- package/dist/mlt/mlt-source-loader.js +179 -0
- package/dist/mlt/mlt-source-loader.js.map +1 -0
- package/dist/mlt/mlt-writer.d.ts +45 -0
- package/dist/mlt/mlt-writer.d.ts.map +1 -0
- package/dist/mlt/mlt-writer.js +21 -0
- package/dist/mlt/mlt-writer.js.map +1 -0
- package/dist/mlt/unbundled.d.ts +3 -0
- package/dist/mlt/unbundled.d.ts.map +1 -0
- package/dist/mlt/unbundled.js +5 -0
- package/dist/mlt/unbundled.js.map +1 -0
- package/dist/mvt/arrow-table-tile-source-loader-types.d.ts +36 -0
- package/dist/mvt/arrow-table-tile-source-loader-types.d.ts.map +1 -0
- package/dist/mvt/arrow-table-tile-source-loader-types.js +36 -0
- package/dist/mvt/arrow-table-tile-source-loader-types.js.map +1 -0
- package/dist/mvt/arrow-table-tile-source-loader.cjs +6343 -0
- package/dist/mvt/arrow-table-tile-source-loader.cjs.map +6 -0
- package/dist/mvt/arrow-table-tile-source-loader.d.ts +69 -0
- package/dist/mvt/arrow-table-tile-source-loader.d.ts.map +1 -0
- package/dist/mvt/arrow-table-tile-source-loader.js +216 -0
- package/dist/mvt/arrow-table-tile-source-loader.js.map +1 -0
- package/dist/mvt/arrow-table-tile-source-types.d.ts +21 -0
- package/dist/mvt/arrow-table-tile-source-types.d.ts.map +1 -0
- package/dist/mvt/arrow-table-tile-source-types.js +6 -0
- package/dist/mvt/arrow-table-tile-source-types.js.map +1 -0
- package/dist/mvt/bundled.d.ts +6 -0
- package/dist/mvt/bundled.d.ts.map +1 -0
- package/dist/mvt/bundled.js +7 -0
- package/dist/mvt/bundled.js.map +1 -0
- package/dist/mvt/dist.dev.js +46689 -0
- package/dist/mvt/dist.min.js +94 -0
- package/dist/mvt/index.cjs +10095 -0
- package/dist/mvt/index.cjs.map +6 -0
- package/dist/mvt/index.d.ts +28 -0
- package/dist/mvt/index.d.ts.map +1 -0
- package/dist/mvt/index.js +27 -0
- package/dist/mvt/index.js.map +1 -0
- package/dist/mvt/lib/encode-mvt-arrow.d.ts +6 -0
- package/dist/mvt/lib/encode-mvt-arrow.d.ts.map +1 -0
- package/dist/mvt/lib/encode-mvt-arrow.js +225 -0
- package/dist/mvt/lib/encode-mvt-arrow.js.map +1 -0
- package/dist/mvt/lib/encode-mvt.d.ts +30 -0
- package/dist/mvt/lib/encode-mvt.d.ts.map +1 -0
- package/dist/mvt/lib/encode-mvt.js +20 -0
- package/dist/mvt/lib/encode-mvt.js.map +1 -0
- package/dist/mvt/lib/get-schemas-from-tilejson.d.ts +4 -0
- package/dist/mvt/lib/get-schemas-from-tilejson.d.ts.map +1 -0
- package/dist/mvt/lib/get-schemas-from-tilejson.js +56 -0
- package/dist/mvt/lib/get-schemas-from-tilejson.js.map +1 -0
- package/dist/mvt/lib/is-longitude-latitude-crs.d.ts +3 -0
- package/dist/mvt/lib/is-longitude-latitude-crs.d.ts.map +1 -0
- package/dist/mvt/lib/is-longitude-latitude-crs.js +13 -0
- package/dist/mvt/lib/is-longitude-latitude-crs.js.map +1 -0
- package/dist/mvt/lib/mapbox-vt-pbf/geojson-wrapper.d.ts +25 -0
- package/dist/mvt/lib/mapbox-vt-pbf/geojson-wrapper.d.ts.map +1 -0
- package/dist/mvt/lib/mapbox-vt-pbf/geojson-wrapper.js +73 -0
- package/dist/mvt/lib/mapbox-vt-pbf/geojson-wrapper.js.map +1 -0
- package/dist/mvt/lib/mapbox-vt-pbf/to-vector-tile.d.ts +52 -0
- package/dist/mvt/lib/mapbox-vt-pbf/to-vector-tile.d.ts.map +1 -0
- package/dist/mvt/lib/mapbox-vt-pbf/to-vector-tile.js +165 -0
- package/dist/mvt/lib/mapbox-vt-pbf/to-vector-tile.js.map +1 -0
- package/dist/mvt/lib/mvt-pbf/mvt-constants.d.ts +116 -0
- package/dist/mvt/lib/mvt-pbf/mvt-constants.d.ts.map +1 -0
- package/dist/mvt/lib/mvt-pbf/mvt-constants.js +127 -0
- package/dist/mvt/lib/mvt-pbf/mvt-constants.js.map +1 -0
- package/dist/mvt/lib/mvt-pbf/mvt-types.d.ts +17 -0
- package/dist/mvt/lib/mvt-pbf/mvt-types.d.ts.map +1 -0
- package/dist/mvt/lib/mvt-pbf/mvt-types.js +5 -0
- package/dist/mvt/lib/mvt-pbf/mvt-types.js.map +1 -0
- package/dist/mvt/lib/mvt-pbf/parse-geometry-from-pbf.d.ts +77 -0
- package/dist/mvt/lib/mvt-pbf/parse-geometry-from-pbf.d.ts.map +1 -0
- package/dist/mvt/lib/mvt-pbf/parse-geometry-from-pbf.js +235 -0
- package/dist/mvt/lib/mvt-pbf/parse-geometry-from-pbf.js.map +1 -0
- package/dist/mvt/lib/mvt-pbf/parse-mvt-from-pbf.d.ts +25 -0
- package/dist/mvt/lib/mvt-pbf/parse-mvt-from-pbf.d.ts.map +1 -0
- package/dist/mvt/lib/mvt-pbf/parse-mvt-from-pbf.js +263 -0
- package/dist/mvt/lib/mvt-pbf/parse-mvt-from-pbf.js.map +1 -0
- package/dist/mvt/lib/mvt-pbf/write-mvt-to-pbf.d.ts +4 -0
- package/dist/mvt/lib/mvt-pbf/write-mvt-to-pbf.d.ts.map +1 -0
- package/dist/mvt/lib/mvt-pbf/write-mvt-to-pbf.js +134 -0
- package/dist/mvt/lib/mvt-pbf/write-mvt-to-pbf.js.map +1 -0
- package/dist/mvt/lib/mvt-worker-transport.d.ts +15 -0
- package/dist/mvt/lib/mvt-worker-transport.d.ts.map +1 -0
- package/dist/mvt/lib/mvt-worker-transport.js +54 -0
- package/dist/mvt/lib/mvt-worker-transport.js.map +1 -0
- package/dist/mvt/lib/parse-mvt-geojson.d.ts +6 -0
- package/dist/mvt/lib/parse-mvt-geojson.d.ts.map +1 -0
- package/dist/mvt/lib/parse-mvt-geojson.js +48 -0
- package/dist/mvt/lib/parse-mvt-geojson.js.map +1 -0
- package/dist/mvt/lib/parse-mvt.d.ts +14 -0
- package/dist/mvt/lib/parse-mvt.d.ts.map +1 -0
- package/dist/mvt/lib/parse-mvt.js +105 -0
- package/dist/mvt/lib/parse-mvt.js.map +1 -0
- package/dist/mvt/lib/parse-tilejson.d.ts +74 -0
- package/dist/mvt/lib/parse-tilejson.d.ts.map +1 -0
- package/dist/mvt/lib/parse-tilejson.js +267 -0
- package/dist/mvt/lib/parse-tilejson.js.map +1 -0
- package/dist/mvt/lib/resolve-table-tile-parameters.d.ts +4 -0
- package/dist/mvt/lib/resolve-table-tile-parameters.d.ts.map +1 -0
- package/dist/mvt/lib/resolve-table-tile-parameters.js +16 -0
- package/dist/mvt/lib/resolve-table-tile-parameters.js.map +1 -0
- package/dist/mvt/lib/types.d.ts +88 -0
- package/dist/mvt/lib/types.d.ts.map +1 -0
- package/dist/mvt/lib/types.js.map +1 -0
- package/dist/mvt/lib/utils/geometry-utils.d.ts +83 -0
- package/dist/mvt/lib/utils/geometry-utils.d.ts.map +1 -0
- package/dist/mvt/lib/utils/geometry-utils.js +211 -0
- package/dist/mvt/lib/utils/geometry-utils.js.map +1 -0
- package/dist/mvt/lib/vector-tile/vector-tile-feature.d.ts +72 -0
- package/dist/mvt/lib/vector-tile/vector-tile-feature.d.ts.map +1 -0
- package/dist/mvt/lib/vector-tile/vector-tile-feature.js +350 -0
- package/dist/mvt/lib/vector-tile/vector-tile-feature.js.map +1 -0
- package/dist/mvt/lib/vector-tile/vector-tile-layer.d.ts +29 -0
- package/dist/mvt/lib/vector-tile/vector-tile-layer.d.ts.map +1 -0
- package/dist/mvt/lib/vector-tile/vector-tile-layer.js +108 -0
- package/dist/mvt/lib/vector-tile/vector-tile-layer.js.map +1 -0
- package/dist/mvt/lib/vector-tile/vector-tile.d.ts +9 -0
- package/dist/mvt/lib/vector-tile/vector-tile.d.ts.map +1 -0
- package/dist/mvt/lib/vector-tile/vector-tile.js +28 -0
- package/dist/mvt/lib/vector-tile/vector-tile.js.map +1 -0
- package/dist/mvt/lib/vector-tiler/arrow-tile.d.ts +6 -0
- package/dist/mvt/lib/vector-tiler/arrow-tile.d.ts.map +1 -0
- package/dist/mvt/lib/vector-tiler/arrow-tile.js +84 -0
- package/dist/mvt/lib/vector-tiler/arrow-tile.js.map +1 -0
- package/dist/mvt/lib/vector-tiler/features/clip-features.d.ts +16 -0
- package/dist/mvt/lib/vector-tiler/features/clip-features.d.ts.map +1 -0
- package/dist/mvt/lib/vector-tiler/features/clip-features.js +211 -0
- package/dist/mvt/lib/vector-tiler/features/clip-features.js.map +1 -0
- package/dist/mvt/lib/vector-tiler/features/convert-feature.d.ts +18 -0
- package/dist/mvt/lib/vector-tiler/features/convert-feature.d.ts.map +1 -0
- package/dist/mvt/lib/vector-tiler/features/convert-feature.js +161 -0
- package/dist/mvt/lib/vector-tiler/features/convert-feature.js.map +1 -0
- package/dist/mvt/lib/vector-tiler/features/proto-feature.d.ts +30 -0
- package/dist/mvt/lib/vector-tiler/features/proto-feature.d.ts.map +1 -0
- package/dist/mvt/lib/vector-tiler/features/proto-feature.js +53 -0
- package/dist/mvt/lib/vector-tiler/features/proto-feature.js.map +1 -0
- package/dist/mvt/lib/vector-tiler/features/simplify-path.d.ts +10 -0
- package/dist/mvt/lib/vector-tiler/features/simplify-path.d.ts.map +1 -0
- package/dist/mvt/lib/vector-tiler/features/simplify-path.js +67 -0
- package/dist/mvt/lib/vector-tiler/features/simplify-path.js.map +1 -0
- package/dist/mvt/lib/vector-tiler/features/wrap-features.d.ts +17 -0
- package/dist/mvt/lib/vector-tiler/features/wrap-features.d.ts.map +1 -0
- package/dist/mvt/lib/vector-tiler/features/wrap-features.js +95 -0
- package/dist/mvt/lib/vector-tiler/features/wrap-features.js.map +1 -0
- package/dist/mvt/lib/vector-tiler/proto-tile.d.ts +40 -0
- package/dist/mvt/lib/vector-tiler/proto-tile.d.ts.map +1 -0
- package/dist/mvt/lib/vector-tiler/proto-tile.js +139 -0
- package/dist/mvt/lib/vector-tiler/proto-tile.js.map +1 -0
- package/dist/mvt/lib/vector-tiler/tile-to-geojson.d.ts +12 -0
- package/dist/mvt/lib/vector-tiler/tile-to-geojson.d.ts.map +1 -0
- package/dist/mvt/lib/vector-tiler/tile-to-geojson.js +81 -0
- package/dist/mvt/lib/vector-tiler/tile-to-geojson.js.map +1 -0
- package/dist/mvt/lib/vector-tiler/transform-tile.d.ts +7 -0
- package/dist/mvt/lib/vector-tiler/transform-tile.d.ts.map +1 -0
- package/dist/mvt/lib/vector-tiler/transform-tile.js +42 -0
- package/dist/mvt/lib/vector-tiler/transform-tile.js.map +1 -0
- package/dist/mvt/map-style-format.d.ts +13 -0
- package/dist/mvt/map-style-format.d.ts.map +1 -0
- package/dist/mvt/map-style-format.js +16 -0
- package/dist/mvt/map-style-format.js.map +1 -0
- package/dist/mvt/map-style-loader-with-parser.d.ts +26 -0
- package/dist/mvt/map-style-loader-with-parser.d.ts.map +1 -0
- package/dist/mvt/map-style-loader-with-parser.js +38 -0
- package/dist/mvt/map-style-loader-with-parser.js.map +1 -0
- package/dist/mvt/map-style-loader.d.ts +44 -0
- package/dist/mvt/map-style-loader.d.ts.map +1 -0
- package/dist/mvt/map-style-loader.js +25 -0
- package/dist/mvt/map-style-loader.js.map +1 -0
- package/dist/mvt/map-style-schema.d.ts +58 -0
- package/dist/mvt/map-style-schema.d.ts.map +1 -0
- package/dist/mvt/map-style-schema.js +47 -0
- package/dist/mvt/map-style-schema.js.map +1 -0
- package/dist/mvt/map-style.d.ts +110 -0
- package/dist/mvt/map-style.d.ts.map +1 -0
- package/dist/mvt/map-style.js +90 -0
- package/dist/mvt/map-style.js.map +1 -0
- package/dist/mvt/mvt-format.d.ts +14 -0
- package/dist/mvt/mvt-format.d.ts.map +1 -0
- package/dist/mvt/mvt-format.js +23 -0
- package/dist/mvt/mvt-format.js.map +1 -0
- package/dist/mvt/mvt-geojson-loader-types.d.ts +82 -0
- package/dist/mvt/mvt-geojson-loader-types.d.ts.map +1 -0
- package/dist/mvt/mvt-geojson-loader-types.js +34 -0
- package/dist/mvt/mvt-geojson-loader-types.js.map +1 -0
- package/dist/mvt/mvt-geojson-loader.cjs +1366 -0
- package/dist/mvt/mvt-geojson-loader.cjs.map +6 -0
- package/dist/mvt/mvt-geojson-loader.d.ts +32 -0
- package/dist/mvt/mvt-geojson-loader.d.ts.map +1 -0
- package/dist/mvt/mvt-geojson-loader.js +13 -0
- package/dist/mvt/mvt-geojson-loader.js.map +1 -0
- package/dist/mvt/mvt-loader-with-parser.d.ts +105 -0
- package/dist/mvt/mvt-loader-with-parser.d.ts.map +1 -0
- package/dist/mvt/mvt-loader-with-parser.js +21 -0
- package/dist/mvt/mvt-loader-with-parser.js.map +1 -0
- package/dist/mvt/mvt-loader.d.ts +129 -0
- package/dist/mvt/mvt-loader.d.ts.map +1 -0
- package/dist/mvt/mvt-loader.js +40 -0
- package/dist/mvt/mvt-loader.js.map +1 -0
- package/dist/mvt/mvt-source-loader.d.ts +102 -0
- package/dist/mvt/mvt-source-loader.d.ts.map +1 -0
- package/dist/mvt/mvt-source-loader.js +275 -0
- package/dist/mvt/mvt-source-loader.js.map +1 -0
- package/dist/mvt/mvt-writer.d.ts +28 -0
- package/dist/mvt/mvt-writer.d.ts.map +1 -0
- package/dist/mvt/mvt-writer.js +32 -0
- package/dist/mvt/mvt-writer.js.map +1 -0
- package/dist/mvt/table-tile-source-loader.d.ts +169 -0
- package/dist/mvt/table-tile-source-loader.d.ts.map +1 -0
- package/dist/mvt/table-tile-source-loader.js +478 -0
- package/dist/mvt/table-tile-source-loader.js.map +1 -0
- package/dist/mvt/tilejson-format.d.ts +13 -0
- package/dist/mvt/tilejson-format.d.ts.map +1 -0
- package/dist/mvt/tilejson-format.js +16 -0
- package/dist/mvt/tilejson-format.js.map +1 -0
- package/dist/mvt/tilejson-loader-with-parser.d.ts +13 -0
- package/dist/mvt/tilejson-loader-with-parser.d.ts.map +1 -0
- package/dist/mvt/tilejson-loader-with-parser.js +25 -0
- package/dist/mvt/tilejson-loader-with-parser.js.map +1 -0
- package/dist/mvt/tilejson-loader.d.ts +56 -0
- package/dist/mvt/tilejson-loader.d.ts.map +1 -0
- package/dist/mvt/tilejson-loader.js +28 -0
- package/dist/mvt/tilejson-loader.js.map +1 -0
- package/dist/mvt/tilejson-zod-schema.cjs +79 -0
- package/dist/mvt/tilejson-zod-schema.cjs.map +6 -0
- package/dist/mvt/tilejson-zod-schema.d.ts +218 -0
- package/dist/mvt/tilejson-zod-schema.d.ts.map +1 -0
- package/dist/mvt/tilejson-zod-schema.js +68 -0
- package/dist/mvt/tilejson-zod-schema.js.map +1 -0
- package/dist/mvt/tilejson.schema.json +197 -0
- package/dist/mvt/unbundled.d.ts +8 -0
- package/dist/mvt/unbundled.d.ts.map +1 -0
- package/dist/mvt/unbundled.js +8 -0
- package/dist/mvt/unbundled.js.map +1 -0
- package/dist/mvt/workers/mvt-worker-node.d.ts +2 -0
- package/dist/mvt/workers/mvt-worker-node.d.ts.map +1 -0
- package/dist/mvt/workers/mvt-worker-node.js +8 -0
- package/dist/mvt/workers/mvt-worker-node.js.map +1 -0
- package/dist/mvt/workers/mvt-worker.d.ts +2 -0
- package/dist/mvt/workers/mvt-worker.d.ts.map +1 -0
- package/dist/mvt/workers/mvt-worker.js +7 -0
- package/dist/mvt/workers/mvt-worker.js.map +1 -0
- package/dist/mvt-worker-node.js +72460 -0
- package/dist/mvt-worker-node.js.map +7 -0
- package/dist/mvt-worker.js +21239 -0
- package/dist/pmtiles/bundled.d.ts +3 -0
- package/dist/pmtiles/bundled.d.ts.map +1 -0
- package/dist/pmtiles/bundled.js +5 -0
- package/dist/pmtiles/bundled.js.map +1 -0
- package/dist/pmtiles/dist.dev.js +50530 -0
- package/dist/pmtiles/dist.min.js +94 -0
- package/dist/pmtiles/geoarrow.cjs +6718 -0
- package/dist/pmtiles/geoarrow.cjs.map +6 -0
- package/dist/pmtiles/geoarrow.d.ts +30 -0
- package/dist/pmtiles/geoarrow.d.ts.map +1 -0
- package/dist/pmtiles/geoarrow.js +143 -0
- package/dist/pmtiles/geoarrow.js.map +1 -0
- package/dist/pmtiles/index.cjs +8011 -0
- package/dist/pmtiles/index.cjs.map +6 -0
- package/dist/pmtiles/index.d.ts +14 -0
- package/dist/pmtiles/index.d.ts.map +1 -0
- package/dist/pmtiles/index.js +10 -0
- package/dist/pmtiles/index.js.map +1 -0
- package/dist/pmtiles/lib/blob-source.d.ts +14 -0
- package/dist/pmtiles/lib/blob-source.d.ts.map +1 -0
- package/dist/pmtiles/lib/blob-source.js +32 -0
- package/dist/pmtiles/lib/blob-source.js.map +1 -0
- package/dist/pmtiles/lib/encode-pmtiles.d.ts +8 -0
- package/dist/pmtiles/lib/encode-pmtiles.d.ts.map +1 -0
- package/dist/pmtiles/lib/encode-pmtiles.js +268 -0
- package/dist/pmtiles/lib/encode-pmtiles.js.map +1 -0
- package/dist/pmtiles/lib/parse-pmtiles.d.ts +52 -0
- package/dist/pmtiles/lib/parse-pmtiles.d.ts.map +1 -0
- package/dist/pmtiles/lib/parse-pmtiles.js +95 -0
- package/dist/pmtiles/lib/parse-pmtiles.js.map +1 -0
- package/dist/pmtiles/lib/range-request-source.d.ts +24 -0
- package/dist/pmtiles/lib/range-request-source.d.ts.map +1 -0
- package/dist/pmtiles/lib/range-request-source.js +45 -0
- package/dist/pmtiles/lib/range-request-source.js.map +1 -0
- package/dist/pmtiles/lib/version.d.ts +2 -0
- package/dist/pmtiles/lib/version.d.ts.map +1 -0
- package/dist/pmtiles/lib/version.js +8 -0
- package/dist/pmtiles/lib/version.js.map +1 -0
- package/dist/pmtiles/pmtiles-format.d.ts +14 -0
- package/dist/pmtiles/pmtiles-format.d.ts.map +1 -0
- package/dist/pmtiles/pmtiles-format.js +17 -0
- package/dist/pmtiles/pmtiles-format.js.map +1 -0
- package/dist/pmtiles/pmtiles-loader-with-parser.d.ts +30 -0
- package/dist/pmtiles/pmtiles-loader-with-parser.d.ts.map +1 -0
- package/dist/pmtiles/pmtiles-loader-with-parser.js +41 -0
- package/dist/pmtiles/pmtiles-loader-with-parser.js.map +1 -0
- package/dist/pmtiles/pmtiles-loader.d.ts +41 -0
- package/dist/pmtiles/pmtiles-loader.d.ts.map +1 -0
- package/dist/pmtiles/pmtiles-loader.js +20 -0
- package/dist/pmtiles/pmtiles-loader.js.map +1 -0
- package/dist/pmtiles/pmtiles-source-loader.d.ts +85 -0
- package/dist/pmtiles/pmtiles-source-loader.d.ts.map +1 -0
- package/dist/pmtiles/pmtiles-source-loader.js +239 -0
- package/dist/pmtiles/pmtiles-source-loader.js.map +1 -0
- package/dist/pmtiles/pmtiles-writer-types.d.ts +39 -0
- package/dist/pmtiles/pmtiles-writer-types.d.ts.map +1 -0
- package/dist/{point-cloud-tile-source-types.js → pmtiles/pmtiles-writer-types.js} +1 -1
- package/dist/pmtiles/pmtiles-writer-types.js.map +1 -0
- package/dist/pmtiles/pmtiles-writer.d.ts +22 -0
- package/dist/pmtiles/pmtiles-writer.d.ts.map +1 -0
- package/dist/pmtiles/pmtiles-writer.js +15 -0
- package/dist/pmtiles/pmtiles-writer.js.map +1 -0
- package/dist/pmtiles/raster.cjs +1183 -0
- package/dist/pmtiles/raster.cjs.map +6 -0
- package/dist/pmtiles/raster.d.ts +30 -0
- package/dist/pmtiles/raster.d.ts.map +1 -0
- package/dist/pmtiles/raster.js +212 -0
- package/dist/pmtiles/raster.js.map +1 -0
- package/dist/pmtiles/source-info.d.ts +25 -0
- package/dist/pmtiles/source-info.d.ts.map +1 -0
- package/dist/{types.js → pmtiles/source-info.js} +1 -1
- package/dist/pmtiles/source-info.js.map +1 -0
- package/dist/pmtiles/unbundled.d.ts +3 -0
- package/dist/pmtiles/unbundled.d.ts.map +1 -0
- package/dist/pmtiles/unbundled.js +5 -0
- package/dist/pmtiles/unbundled.js.map +1 -0
- package/dist/raster-set.d.ts +1 -1
- package/dist/raster-set.d.ts.map +1 -1
- package/dist/raster-set.js +1 -1
- package/dist/raster-set.js.map +1 -1
- package/dist/tile-matrix.cjs +81 -0
- package/dist/tile-matrix.cjs.map +6 -0
- package/dist/tile-matrix.d.ts +52 -0
- package/dist/tile-matrix.d.ts.map +1 -0
- package/dist/tile-matrix.js +75 -0
- package/dist/tile-matrix.js.map +1 -0
- package/dist/tileset-2d/tile-2d-header.d.ts +2 -2
- package/dist/tileset-2d/tile-2d-header.d.ts.map +1 -1
- package/dist/tileset-2d/tile-2d-header.js +11 -11
- package/dist/tileset-2d/tile-2d-header.js.map +1 -1
- package/dist/tileset-2d/tileset-2d.d.ts +19 -10
- package/dist/tileset-2d/tileset-2d.d.ts.map +1 -1
- package/dist/tileset-2d/tileset-2d.js +69 -15
- package/dist/tileset-2d/tileset-2d.js.map +1 -1
- package/package.json +101 -25
- package/src/image-set.ts +1 -1
- package/src/index.ts +8 -128
- package/src/mlt/bundled.ts +9 -0
- package/src/mlt/index.ts +18 -0
- package/src/mlt/lib/encode-mlt-geometry.ts +162 -0
- package/src/mlt/lib/encode-mlt-streams.ts +66 -0
- package/src/mlt/lib/encode-mlt.ts +215 -0
- package/src/mlt/lib/parse-mlt.ts +906 -0
- package/src/mlt/libs/mlt-decoder.cjs +4552 -0
- package/src/mlt/mlt-format.ts +19 -0
- package/src/mlt/mlt-loader-with-parser.ts +57 -0
- package/src/mlt/mlt-loader.ts +64 -0
- package/src/mlt/mlt-source-loader.ts +266 -0
- package/src/mlt/mlt-writer.ts +47 -0
- package/src/mlt/unbundled.ts +6 -0
- package/src/mvt/arrow-table-tile-source-loader-types.ts +55 -0
- package/src/mvt/arrow-table-tile-source-loader.ts +307 -0
- package/src/mvt/arrow-table-tile-source-types.ts +32 -0
- package/src/mvt/bundled.ts +14 -0
- package/src/mvt/index.ts +67 -0
- package/src/mvt/lib/encode-mvt-arrow.ts +273 -0
- package/src/mvt/lib/encode-mvt.ts +46 -0
- package/src/mvt/lib/get-schemas-from-tilejson.ts +64 -0
- package/src/mvt/lib/is-longitude-latitude-crs.ts +15 -0
- package/src/mvt/lib/mapbox-vt-pbf/geojson-to-vt.ts.disabled +76 -0
- package/src/mvt/lib/mapbox-vt-pbf/geojson-wrapper.ts +89 -0
- package/src/mvt/lib/mapbox-vt-pbf/to-vector-tile.ts +230 -0
- package/src/mvt/lib/mvt-pbf/mvt-constants.ts +135 -0
- package/src/mvt/lib/mvt-pbf/mvt-types.ts +22 -0
- package/src/mvt/lib/mvt-pbf/parse-geometry-from-pbf.ts +285 -0
- package/src/mvt/lib/mvt-pbf/parse-mvt-from-pbf.ts +310 -0
- package/src/mvt/lib/mvt-pbf/write-mvt-to-pbf.ts +162 -0
- package/src/mvt/lib/mvt-worker-transport.ts +74 -0
- package/src/mvt/lib/parse-mvt-geojson.ts +65 -0
- package/src/mvt/lib/parse-mvt.ts +145 -0
- package/src/mvt/lib/parse-tilejson.ts +397 -0
- package/src/mvt/lib/resolve-table-tile-parameters.ts +23 -0
- package/src/mvt/lib/types.ts +90 -0
- package/src/mvt/lib/utils/geometry-utils.ts +238 -0
- package/src/mvt/lib/vector-tile/LICENSE.txt +31 -0
- package/src/mvt/lib/vector-tile/vector-tile-feature.ts +430 -0
- package/src/mvt/lib/vector-tile/vector-tile-layer.ts +130 -0
- package/src/mvt/lib/vector-tile/vector-tile.ts +32 -0
- package/src/mvt/lib/vector-tiler/LICENSE +19 -0
- package/src/mvt/lib/vector-tiler/arrow-tile.ts +93 -0
- package/src/mvt/lib/vector-tiler/features/clip-features.ts +250 -0
- package/src/mvt/lib/vector-tiler/features/convert-feature.ts +213 -0
- package/src/mvt/lib/vector-tiler/features/proto-feature.ts +104 -0
- package/src/mvt/lib/vector-tiler/features/simplify-path.ts +84 -0
- package/src/mvt/lib/vector-tiler/features/wrap-features.ts +125 -0
- package/src/mvt/lib/vector-tiler/proto-tile.ts +217 -0
- package/src/mvt/lib/vector-tiler/tile-to-geojson.ts +104 -0
- package/src/mvt/lib/vector-tiler/transform-tile.ts +57 -0
- package/src/mvt/map-style-format.ts +18 -0
- package/src/mvt/map-style-loader-with-parser.ts +62 -0
- package/src/mvt/map-style-loader.ts +31 -0
- package/src/mvt/map-style-schema.ts +53 -0
- package/src/mvt/map-style.ts +218 -0
- package/src/mvt/mvt-format.ts +25 -0
- package/src/mvt/mvt-geojson-loader-types.ts +60 -0
- package/src/mvt/mvt-geojson-loader.ts +20 -0
- package/src/mvt/mvt-loader-with-parser.ts +53 -0
- package/src/mvt/mvt-loader.ts +73 -0
- package/src/mvt/mvt-source-loader.ts +410 -0
- package/src/mvt/mvt-writer.ts +35 -0
- package/src/mvt/table-tile-source-loader.ts +672 -0
- package/src/mvt/tilejson-format.ts +18 -0
- package/src/mvt/tilejson-loader-with-parser.ts +38 -0
- package/src/mvt/tilejson-loader.ts +42 -0
- package/src/mvt/tilejson-zod-schema.ts +199 -0
- package/src/mvt/unbundled.ts +13 -0
- package/src/mvt/workers/mvt-worker-node.ts +9 -0
- package/src/mvt/workers/mvt-worker.ts +8 -0
- package/src/pmtiles/bundled.ts +6 -0
- package/src/pmtiles/geoarrow.ts +188 -0
- package/src/pmtiles/index.ts +27 -0
- package/src/pmtiles/lib/blob-source.ts +41 -0
- package/src/pmtiles/lib/encode-pmtiles.ts +322 -0
- package/src/pmtiles/lib/parse-pmtiles.ts +180 -0
- package/src/pmtiles/lib/range-request-source.ts +60 -0
- package/src/pmtiles/lib/version.ts +8 -0
- package/src/pmtiles/pmtiles-format.ts +19 -0
- package/src/pmtiles/pmtiles-loader-with-parser.ts +60 -0
- package/src/pmtiles/pmtiles-loader.ts +30 -0
- package/src/pmtiles/pmtiles-source-loader.ts +346 -0
- package/src/pmtiles/pmtiles-writer-types.ts +45 -0
- package/src/pmtiles/pmtiles-writer.ts +26 -0
- package/src/pmtiles/raster.ts +289 -0
- package/src/pmtiles/source-info.ts +25 -0
- package/src/pmtiles/unbundled.ts +6 -0
- package/src/raster-set.ts +2 -2
- package/src/tile-matrix.ts +138 -0
- package/src/tileset-2d/tile-2d-header.ts +14 -13
- package/src/tileset-2d/tileset-2d.ts +81 -19
- package/dist/constants.d.ts +0 -38
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js +0 -39
- package/dist/constants.js.map +0 -1
- package/dist/point-cloud/point-cloud-tile.d.ts +0 -47
- package/dist/point-cloud/point-cloud-tile.d.ts.map +0 -1
- package/dist/point-cloud/point-cloud-tile.js +0 -70
- package/dist/point-cloud/point-cloud-tile.js.map +0 -1
- package/dist/point-cloud/point-cloud-tileset.d.ts +0 -135
- package/dist/point-cloud/point-cloud-tileset.d.ts.map +0 -1
- package/dist/point-cloud/point-cloud-tileset.js +0 -549
- package/dist/point-cloud/point-cloud-tileset.js.map +0 -1
- package/dist/point-cloud/types.d.ts +0 -81
- package/dist/point-cloud/types.d.ts.map +0 -1
- package/dist/point-cloud/types.js.map +0 -1
- package/dist/point-cloud-tile-source-loader-types.d.ts +0 -31
- package/dist/point-cloud-tile-source-loader-types.d.ts.map +0 -1
- package/dist/point-cloud-tile-source-loader-types.js +0 -34
- package/dist/point-cloud-tile-source-loader-types.js.map +0 -1
- package/dist/point-cloud-tile-source-loader.cjs +0 -81
- package/dist/point-cloud-tile-source-loader.cjs.map +0 -7
- package/dist/point-cloud-tile-source-loader.d.ts +0 -27
- package/dist/point-cloud-tile-source-loader.d.ts.map +0 -1
- package/dist/point-cloud-tile-source-loader.js +0 -17
- package/dist/point-cloud-tile-source-loader.js.map +0 -1
- package/dist/point-cloud-tile-source-types.d.ts +0 -15
- package/dist/point-cloud-tile-source-types.d.ts.map +0 -1
- package/dist/point-cloud-tile-source-types.js.map +0 -1
- package/dist/point-cloud-tile-source.cjs +0 -105
- package/dist/point-cloud-tile-source.cjs.map +0 -7
- package/dist/point-cloud-tile-source.d.ts +0 -36
- package/dist/point-cloud-tile-source.d.ts.map +0 -1
- package/dist/point-cloud-tile-source.js +0 -84
- package/dist/point-cloud-tile-source.js.map +0 -1
- package/dist/spatial/format-spatial-reference.d.ts +0 -68
- package/dist/spatial/format-spatial-reference.d.ts.map +0 -1
- package/dist/spatial/format-spatial-reference.js +0 -291
- package/dist/spatial/format-spatial-reference.js.map +0 -1
- package/dist/spatial/get-spatial-coordinate-frame.d.ts +0 -20
- package/dist/spatial/get-spatial-coordinate-frame.d.ts.map +0 -1
- package/dist/spatial/get-spatial-coordinate-frame.js +0 -139
- package/dist/spatial/get-spatial-coordinate-frame.js.map +0 -1
- package/dist/spatial/i3s-elevation.d.ts +0 -20
- package/dist/spatial/i3s-elevation.d.ts.map +0 -1
- package/dist/spatial/i3s-elevation.js +0 -90
- package/dist/spatial/i3s-elevation.js.map +0 -1
- package/dist/spatial/i3s-spatial-transformer.d.ts +0 -205
- package/dist/spatial/i3s-spatial-transformer.d.ts.map +0 -1
- package/dist/spatial/i3s-spatial-transformer.js +0 -731
- package/dist/spatial/i3s-spatial-transformer.js.map +0 -1
- package/dist/spatial/normalize-crs-identifier.d.ts +0 -15
- package/dist/spatial/normalize-crs-identifier.d.ts.map +0 -1
- package/dist/spatial/normalize-crs-identifier.js +0 -22
- package/dist/spatial/normalize-crs-identifier.js.map +0 -1
- package/dist/spatial/spatial-coordinate-transformer.d.ts +0 -54
- package/dist/spatial/spatial-coordinate-transformer.d.ts.map +0 -1
- package/dist/spatial/spatial-coordinate-transformer.js +0 -311
- package/dist/spatial/spatial-coordinate-transformer.js.map +0 -1
- package/dist/spatial/spatial-resource-registry.d.ts +0 -47
- package/dist/spatial/spatial-resource-registry.d.ts.map +0 -1
- package/dist/spatial/spatial-resource-registry.js +0 -76
- package/dist/spatial/spatial-resource-registry.js.map +0 -1
- package/dist/spatial/spatial-types.d.ts +0 -190
- package/dist/spatial/spatial-types.d.ts.map +0 -1
- package/dist/spatial/spatial-types.js +0 -192
- package/dist/spatial/spatial-types.js.map +0 -1
- package/dist/spatial/tiles-3d-spatial-transformer.d.ts +0 -32
- package/dist/spatial/tiles-3d-spatial-transformer.d.ts.map +0 -1
- package/dist/spatial/tiles-3d-spatial-transformer.js +0 -163
- package/dist/spatial/tiles-3d-spatial-transformer.js.map +0 -1
- package/dist/tileset-3d/common/indexed-archive-tileset-source.d.ts +0 -60
- package/dist/tileset-3d/common/indexed-archive-tileset-source.d.ts.map +0 -1
- package/dist/tileset-3d/common/indexed-archive-tileset-source.js +0 -130
- package/dist/tileset-3d/common/indexed-archive-tileset-source.js.map +0 -1
- package/dist/tileset-3d/common/tile-3d-contracts.d.ts +0 -63
- package/dist/tileset-3d/common/tile-3d-contracts.d.ts.map +0 -1
- package/dist/tileset-3d/common/tile-3d-contracts.js +0 -51
- package/dist/tileset-3d/common/tile-3d-contracts.js.map +0 -1
- package/dist/tileset-3d/common/tile-3d.d.ts +0 -410
- package/dist/tileset-3d/common/tile-3d.d.ts.map +0 -1
- package/dist/tileset-3d/common/tile-3d.js +0 -1056
- package/dist/tileset-3d/common/tile-3d.js.map +0 -1
- package/dist/tileset-3d/common/tileset-3d.d.ts +0 -369
- package/dist/tileset-3d/common/tileset-3d.d.ts.map +0 -1
- package/dist/tileset-3d/common/tileset-3d.js +0 -879
- package/dist/tileset-3d/common/tileset-3d.js.map +0 -1
- package/dist/tileset-3d/common/tileset-cache.d.ts +0 -29
- package/dist/tileset-3d/common/tileset-cache.d.ts.map +0 -1
- package/dist/tileset-3d/common/tileset-cache.js +0 -82
- package/dist/tileset-3d/common/tileset-cache.js.map +0 -1
- package/dist/tileset-3d/common/tileset-content-traversal.d.ts +0 -37
- package/dist/tileset-3d/common/tileset-content-traversal.d.ts.map +0 -1
- package/dist/tileset-3d/common/tileset-content-traversal.js +0 -80
- package/dist/tileset-3d/common/tileset-content-traversal.js.map +0 -1
- package/dist/tileset-3d/common/tileset-observability.d.ts +0 -60
- package/dist/tileset-3d/common/tileset-observability.d.ts.map +0 -1
- package/dist/tileset-3d/common/tileset-observability.js +0 -39
- package/dist/tileset-3d/common/tileset-observability.js.map +0 -1
- package/dist/tileset-3d/common/tileset-source.d.ts +0 -228
- package/dist/tileset-3d/common/tileset-source.d.ts.map +0 -1
- package/dist/tileset-3d/common/tileset-source.js +0 -17
- package/dist/tileset-3d/common/tileset-source.js.map +0 -1
- package/dist/tileset-3d/common/tileset-traverser.d.ts +0 -88
- package/dist/tileset-3d/common/tileset-traverser.d.ts.map +0 -1
- package/dist/tileset-3d/common/tileset-traverser.js +0 -341
- package/dist/tileset-3d/common/tileset-traverser.js.map +0 -1
- package/dist/tileset-3d/format-3d-tiles/implicit-tiling.d.ts +0 -182
- package/dist/tileset-3d/format-3d-tiles/implicit-tiling.d.ts.map +0 -1
- package/dist/tileset-3d/format-3d-tiles/implicit-tiling.js +0 -678
- package/dist/tileset-3d/format-3d-tiles/implicit-tiling.js.map +0 -1
- package/dist/tileset-3d/format-3d-tiles/tiles-3d-source.d.ts +0 -221
- package/dist/tileset-3d/format-3d-tiles/tiles-3d-source.d.ts.map +0 -1
- package/dist/tileset-3d/format-3d-tiles/tiles-3d-source.js +0 -770
- package/dist/tileset-3d/format-3d-tiles/tiles-3d-source.js.map +0 -1
- package/dist/tileset-3d/format-3d-tiles/tileset-3d-traverser.d.ts +0 -111
- package/dist/tileset-3d/format-3d-tiles/tileset-3d-traverser.d.ts.map +0 -1
- package/dist/tileset-3d/format-3d-tiles/tileset-3d-traverser.js +0 -339
- package/dist/tileset-3d/format-3d-tiles/tileset-3d-traverser.js.map +0 -1
- package/dist/tileset-3d/format-i3s/i3s-pending-tiles-register.d.ts +0 -27
- package/dist/tileset-3d/format-i3s/i3s-pending-tiles-register.d.ts.map +0 -1
- package/dist/tileset-3d/format-i3s/i3s-pending-tiles-register.js +0 -45
- package/dist/tileset-3d/format-i3s/i3s-pending-tiles-register.js.map +0 -1
- package/dist/tileset-3d/format-i3s/i3s-source.d.ts +0 -116
- package/dist/tileset-3d/format-i3s/i3s-source.d.ts.map +0 -1
- package/dist/tileset-3d/format-i3s/i3s-source.js +0 -450
- package/dist/tileset-3d/format-i3s/i3s-source.js.map +0 -1
- package/dist/tileset-3d/format-i3s/i3s-tile-manager.d.ts +0 -34
- package/dist/tileset-3d/format-i3s/i3s-tile-manager.d.ts.map +0 -1
- package/dist/tileset-3d/format-i3s/i3s-tile-manager.js +0 -81
- package/dist/tileset-3d/format-i3s/i3s-tile-manager.js.map +0 -1
- package/dist/tileset-3d/format-i3s/i3s-tileset-traverser.d.ts +0 -25
- package/dist/tileset-3d/format-i3s/i3s-tileset-traverser.d.ts.map +0 -1
- package/dist/tileset-3d/format-i3s/i3s-tileset-traverser.js +0 -84
- package/dist/tileset-3d/format-i3s/i3s-tileset-traverser.js.map +0 -1
- package/dist/tileset-3d/helpers/3d-tiles-options.d.ts +0 -5
- package/dist/tileset-3d/helpers/3d-tiles-options.d.ts.map +0 -1
- package/dist/tileset-3d/helpers/3d-tiles-options.js +0 -9
- package/dist/tileset-3d/helpers/3d-tiles-options.js.map +0 -1
- package/dist/tileset-3d/helpers/bounding-volume.d.ts +0 -23
- package/dist/tileset-3d/helpers/bounding-volume.d.ts.map +0 -1
- package/dist/tileset-3d/helpers/bounding-volume.js +0 -236
- package/dist/tileset-3d/helpers/bounding-volume.js.map +0 -1
- package/dist/tileset-3d/helpers/frame-state.d.ts +0 -93
- package/dist/tileset-3d/helpers/frame-state.d.ts.map +0 -1
- package/dist/tileset-3d/helpers/frame-state.js +0 -211
- package/dist/tileset-3d/helpers/frame-state.js.map +0 -1
- package/dist/tileset-3d/helpers/i3s-lod.d.ts +0 -20
- package/dist/tileset-3d/helpers/i3s-lod.d.ts.map +0 -1
- package/dist/tileset-3d/helpers/i3s-lod.js +0 -95
- package/dist/tileset-3d/helpers/i3s-lod.js.map +0 -1
- package/dist/tileset-3d/helpers/s2-bounding-volume.d.ts +0 -17
- package/dist/tileset-3d/helpers/s2-bounding-volume.d.ts.map +0 -1
- package/dist/tileset-3d/helpers/s2-bounding-volume.js +0 -17
- package/dist/tileset-3d/helpers/s2-bounding-volume.js.map +0 -1
- package/dist/tileset-3d/helpers/tiles-3d-lod.d.ts +0 -72
- package/dist/tileset-3d/helpers/tiles-3d-lod.d.ts.map +0 -1
- package/dist/tileset-3d/helpers/tiles-3d-lod.js +0 -257
- package/dist/tileset-3d/helpers/tiles-3d-lod.js.map +0 -1
- package/dist/tileset-3d/helpers/tiles-3d-request-priority.d.ts +0 -134
- package/dist/tileset-3d/helpers/tiles-3d-request-priority.d.ts.map +0 -1
- package/dist/tileset-3d/helpers/tiles-3d-request-priority.js +0 -179
- package/dist/tileset-3d/helpers/tiles-3d-request-priority.js.map +0 -1
- package/dist/tileset-3d/helpers/transform-utils.d.ts +0 -3
- package/dist/tileset-3d/helpers/transform-utils.d.ts.map +0 -1
- package/dist/tileset-3d/helpers/transform-utils.js +0 -86
- package/dist/tileset-3d/helpers/transform-utils.js.map +0 -1
- package/dist/tileset-3d/helpers/zoom.d.ts +0 -46
- package/dist/tileset-3d/helpers/zoom.d.ts.map +0 -1
- package/dist/tileset-3d/helpers/zoom.js +0 -86
- package/dist/tileset-3d/helpers/zoom.js.map +0 -1
- package/dist/types.d.ts +0 -48
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/utils/doubly-linked-list-node.d.ts +0 -11
- package/dist/utils/doubly-linked-list-node.d.ts.map +0 -1
- package/dist/utils/doubly-linked-list-node.js +0 -20
- package/dist/utils/doubly-linked-list-node.js.map +0 -1
- package/dist/utils/doubly-linked-list.d.ts +0 -30
- package/dist/utils/doubly-linked-list.d.ts.map +0 -1
- package/dist/utils/doubly-linked-list.js +0 -93
- package/dist/utils/doubly-linked-list.js.map +0 -1
- package/dist/utils/managed-array.d.ts +0 -85
- package/dist/utils/managed-array.d.ts.map +0 -1
- package/dist/utils/managed-array.js +0 -152
- package/dist/utils/managed-array.js.map +0 -1
- package/src/constants.ts +0 -59
- package/src/point-cloud/point-cloud-tile.ts +0 -80
- package/src/point-cloud/point-cloud-tileset.ts +0 -767
- package/src/point-cloud/types.ts +0 -99
- package/src/point-cloud-tile-source-loader-types.ts +0 -53
- package/src/point-cloud-tile-source-loader.ts +0 -32
- package/src/point-cloud-tile-source-types.ts +0 -20
- package/src/point-cloud-tile-source.ts +0 -112
- package/src/spatial/format-spatial-reference.ts +0 -385
- package/src/spatial/get-spatial-coordinate-frame.ts +0 -169
- package/src/spatial/i3s-elevation.ts +0 -96
- package/src/spatial/i3s-spatial-transformer.ts +0 -1021
- package/src/spatial/normalize-crs-identifier.ts +0 -26
- package/src/spatial/spatial-coordinate-transformer.ts +0 -397
- package/src/spatial/spatial-resource-registry.ts +0 -90
- package/src/spatial/spatial-types.ts +0 -422
- package/src/spatial/tiles-3d-spatial-transformer.ts +0 -194
- package/src/tileset-3d/common/indexed-archive-tileset-source.ts +0 -205
- package/src/tileset-3d/common/tile-3d-contracts.ts +0 -115
- package/src/tileset-3d/common/tile-3d.ts +0 -1310
- package/src/tileset-3d/common/tileset-3d.ts +0 -1210
- package/src/tileset-3d/common/tileset-cache.ts +0 -111
- package/src/tileset-3d/common/tileset-content-traversal.ts +0 -114
- package/src/tileset-3d/common/tileset-observability.ts +0 -100
- package/src/tileset-3d/common/tileset-source.ts +0 -284
- package/src/tileset-3d/common/tileset-traverser.ts +0 -416
- package/src/tileset-3d/format-3d-tiles/implicit-tiling.ts +0 -1056
- package/src/tileset-3d/format-3d-tiles/tiles-3d-source.ts +0 -1025
- package/src/tileset-3d/format-3d-tiles/tileset-3d-traverser.ts +0 -391
- package/src/tileset-3d/format-i3s/i3s-pending-tiles-register.ts +0 -48
- package/src/tileset-3d/format-i3s/i3s-source.ts +0 -557
- package/src/tileset-3d/format-i3s/i3s-tile-manager.ts +0 -105
- package/src/tileset-3d/format-i3s/i3s-tileset-traverser.ts +0 -102
- package/src/tileset-3d/helpers/3d-tiles-options.ts +0 -11
- package/src/tileset-3d/helpers/bounding-volume.ts +0 -281
- package/src/tileset-3d/helpers/frame-state.ts +0 -322
- package/src/tileset-3d/helpers/i3s-lod.ts +0 -109
- package/src/tileset-3d/helpers/s2-bounding-volume.ts +0 -32
- package/src/tileset-3d/helpers/tiles-3d-lod.ts +0 -370
- package/src/tileset-3d/helpers/tiles-3d-request-priority.ts +0 -301
- package/src/tileset-3d/helpers/transform-utils.ts +0 -109
- package/src/tileset-3d/helpers/zoom.ts +0 -120
- package/src/types.ts +0 -54
- package/src/utils/doubly-linked-list-node.ts +0 -22
- package/src/utils/doubly-linked-list.ts +0 -105
- package/src/utils/managed-array.ts +0 -174
- /package/dist/{point-cloud → mvt/lib}/types.js +0 -0
|
@@ -1,879 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
// Copyright (c) vis.gl contributors
|
|
3
|
-
// This file is derived from the Cesium code base under Apache 2 license
|
|
4
|
-
// See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
|
|
5
|
-
import { Matrix4, Vector3 } from '@math.gl/core';
|
|
6
|
-
import { Ellipsoid } from '@math.gl/geospatial';
|
|
7
|
-
import { Stats } from '@probe.gl/stats';
|
|
8
|
-
import { RequestScheduler } from '@loaders.gl/loader-utils';
|
|
9
|
-
import { TilesetCache } from "./tileset-cache.js";
|
|
10
|
-
import { calculateTransformProps } from "../helpers/transform-utils.js";
|
|
11
|
-
import { getFrameState, limitSelectedTiles, updateCameraMotionState } from "../helpers/frame-state.js";
|
|
12
|
-
import { calculateDynamicScreenSpaceErrorDensity, updateRootTransformForDynamicScreenSpaceError } from "../helpers/tiles-3d-lod.js";
|
|
13
|
-
import { interpolateLinearly } from "../helpers/tiles-3d-request-priority.js";
|
|
14
|
-
import { TILESET_TYPE } from "../../constants.js";
|
|
15
|
-
import { applyTilesetSpatialOptions, createTilesetSpatialReference } from "../../spatial/spatial-types.js";
|
|
16
|
-
import { isTileset3DSource } from "./tileset-source.js";
|
|
17
|
-
const BYTES_PER_MEBIBYTE = 1024 * 1024;
|
|
18
|
-
const DEFAULT_CACHE_BYTES = 512 * BYTES_PER_MEBIBYTE;
|
|
19
|
-
const DEFAULT_MAXIMUM_CACHE_OVERFLOW_BYTES = 512 * BYTES_PER_MEBIBYTE;
|
|
20
|
-
const DEFAULT_I3S_CACHE_BYTES = 32 * BYTES_PER_MEBIBYTE;
|
|
21
|
-
const DEFAULT_I3S_MAXIMUM_CACHE_OVERFLOW_BYTES = BYTES_PER_MEBIBYTE;
|
|
22
|
-
/**
|
|
23
|
-
* Validates a byte-based tile-cache budget.
|
|
24
|
-
*
|
|
25
|
-
* Fractions are accepted because JavaScript memory estimates are numbers, but negative, infinite,
|
|
26
|
-
* and `NaN` values cannot define a stable cache threshold.
|
|
27
|
-
*
|
|
28
|
-
* @param value - Proposed cache budget in bytes.
|
|
29
|
-
* @param optionName - Public option name used in an actionable error message.
|
|
30
|
-
* @returns The validated byte budget.
|
|
31
|
-
*/
|
|
32
|
-
function validateCacheByteLength(value, optionName) {
|
|
33
|
-
if (!Number.isFinite(value) || value < 0) {
|
|
34
|
-
throw new Error(`${optionName} must be a finite number greater than or equal to 0`);
|
|
35
|
-
}
|
|
36
|
-
return value;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Resolves the base cache target from the byte-native option or its fallback.
|
|
40
|
-
*
|
|
41
|
-
* @param options - Options that may contain a byte-native cache value.
|
|
42
|
-
* @param fallbackCacheBytes - Existing or default cache target in bytes.
|
|
43
|
-
* @returns The resolved and validated cache target in bytes.
|
|
44
|
-
*/
|
|
45
|
-
function resolveCacheBytes(options, fallbackCacheBytes) {
|
|
46
|
-
const cacheBytes = options.cacheBytes ?? fallbackCacheBytes;
|
|
47
|
-
return validateCacheByteLength(cacheBytes, 'cacheBytes');
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Resolves cache overflow headroom from the byte-native option or its fallback.
|
|
51
|
-
*
|
|
52
|
-
* @param options - Options that may contain a byte-native overflow value.
|
|
53
|
-
* @param fallbackOverflowBytes - Existing or default overflow headroom in bytes.
|
|
54
|
-
* @returns The resolved and validated overflow headroom in bytes.
|
|
55
|
-
*/
|
|
56
|
-
function resolveMaximumCacheOverflowBytes(options, fallbackOverflowBytes) {
|
|
57
|
-
const maximumCacheOverflowBytes = options.maximumCacheOverflowBytes ?? fallbackOverflowBytes;
|
|
58
|
-
return validateCacheByteLength(maximumCacheOverflowBytes, 'maximumCacheOverflowBytes');
|
|
59
|
-
}
|
|
60
|
-
const DEFAULT_PROPS = {
|
|
61
|
-
description: '',
|
|
62
|
-
ellipsoid: Ellipsoid.WGS84,
|
|
63
|
-
modelMatrix: new Matrix4(),
|
|
64
|
-
throttleRequests: true,
|
|
65
|
-
maxRequests: 64,
|
|
66
|
-
cacheBytes: DEFAULT_CACHE_BYTES,
|
|
67
|
-
maximumCacheOverflowBytes: DEFAULT_MAXIMUM_CACHE_OVERFLOW_BYTES,
|
|
68
|
-
maximumTilesSelected: 0,
|
|
69
|
-
debounceTime: 0,
|
|
70
|
-
onTileLoad: () => { },
|
|
71
|
-
onTileUnload: () => { },
|
|
72
|
-
onTileError: () => { },
|
|
73
|
-
onSourceError: () => { },
|
|
74
|
-
onTilesetError: () => { },
|
|
75
|
-
onTraversalComplete: (selectedTiles) => selectedTiles,
|
|
76
|
-
onUpdate: () => { },
|
|
77
|
-
contentLoader: undefined,
|
|
78
|
-
viewDistanceScale: 1.0,
|
|
79
|
-
progressiveResolutionHeightFraction: 0.3,
|
|
80
|
-
foveatedScreenSpaceError: true,
|
|
81
|
-
foveatedConeSize: 0.1,
|
|
82
|
-
foveatedMinimumScreenSpaceErrorRelaxation: 0,
|
|
83
|
-
foveatedInterpolationCallback: interpolateLinearly,
|
|
84
|
-
foveatedTimeDelay: 0.2,
|
|
85
|
-
maximumScreenSpaceError: 8,
|
|
86
|
-
skipLevelOfDetail: false,
|
|
87
|
-
baseScreenSpaceError: 1024,
|
|
88
|
-
skipScreenSpaceErrorFactor: 16,
|
|
89
|
-
skipLevels: 1,
|
|
90
|
-
immediatelyLoadDesiredLevelOfDetail: false,
|
|
91
|
-
dynamicScreenSpaceError: true,
|
|
92
|
-
dynamicScreenSpaceErrorDensity: 2.0e-4,
|
|
93
|
-
dynamicScreenSpaceErrorFactor: 24,
|
|
94
|
-
dynamicScreenSpaceErrorHeightFalloff: 0.25,
|
|
95
|
-
memoryAdjustedScreenSpaceError: true,
|
|
96
|
-
loadTiles: true,
|
|
97
|
-
updateTransforms: true,
|
|
98
|
-
viewportTraversersMap: null,
|
|
99
|
-
loadOptions: { fetch: {} },
|
|
100
|
-
attributions: [],
|
|
101
|
-
basePath: '',
|
|
102
|
-
i3s: {},
|
|
103
|
-
spatial: {}
|
|
104
|
-
};
|
|
105
|
-
const TILES_TOTAL = 'Tiles In Tileset(s)';
|
|
106
|
-
const TILES_IN_MEMORY = 'Tiles In Memory';
|
|
107
|
-
const TILES_IN_VIEW = 'Tiles In View';
|
|
108
|
-
const TILES_RENDERABLE = 'Tiles To Render';
|
|
109
|
-
const TILES_LOADED = 'Tiles Loaded';
|
|
110
|
-
const TILES_LOADING = 'Tiles Loading';
|
|
111
|
-
const TILES_UNLOADED = 'Tiles Unloaded';
|
|
112
|
-
const TILES_LOAD_FAILED = 'Failed Tile Loads';
|
|
113
|
-
const POINTS_COUNT = 'Points/Vertices';
|
|
114
|
-
const TILES_GPU_MEMORY = 'Tile Memory Use';
|
|
115
|
-
const MAXIMUM_SSE = 'Maximum Screen Space Error';
|
|
116
|
-
/**
|
|
117
|
-
* Shared runtime for tile traversal, selection, cache management, and request scheduling.
|
|
118
|
-
*
|
|
119
|
-
* Format-specific loading behavior is delegated to a {@link Tileset3DSource} implementation.
|
|
120
|
-
*/
|
|
121
|
-
export class Tileset3D {
|
|
122
|
-
options;
|
|
123
|
-
loadOptions;
|
|
124
|
-
/** Source implementation responsible for format-specific initialization and loading. */
|
|
125
|
-
source;
|
|
126
|
-
type;
|
|
127
|
-
tileset;
|
|
128
|
-
loader;
|
|
129
|
-
url;
|
|
130
|
-
basePath;
|
|
131
|
-
modelMatrix;
|
|
132
|
-
ellipsoid;
|
|
133
|
-
lodMetricType;
|
|
134
|
-
lodMetricValue;
|
|
135
|
-
refine;
|
|
136
|
-
root = null;
|
|
137
|
-
roots = {};
|
|
138
|
-
asset = {};
|
|
139
|
-
/** Inline metadata schema declared by the source tileset, when present. */
|
|
140
|
-
schema = null;
|
|
141
|
-
/** External metadata schema URI declared by the source tileset, when present. */
|
|
142
|
-
schemaUri = null;
|
|
143
|
-
/** Metadata groups declared by the source tileset, in source order. */
|
|
144
|
-
groups = [];
|
|
145
|
-
/** Tileset-wide metadata entity, preserved without property-table decoding. */
|
|
146
|
-
metadata = null;
|
|
147
|
-
/** Tileset statistics metadata, preserved for application-level inspection. */
|
|
148
|
-
statistics = null;
|
|
149
|
-
/** Normalized source and target coordinate reference system metadata. */
|
|
150
|
-
spatialReference = createTilesetSpatialReference({});
|
|
151
|
-
description = '';
|
|
152
|
-
properties;
|
|
153
|
-
extras = null;
|
|
154
|
-
attributions = {};
|
|
155
|
-
credits = {};
|
|
156
|
-
stats;
|
|
157
|
-
contentFormats;
|
|
158
|
-
cartographicCenter = null;
|
|
159
|
-
cartesianCenter = null;
|
|
160
|
-
zoom = 1;
|
|
161
|
-
boundingVolume = null;
|
|
162
|
-
/** Effective dynamic SSE density calculated for the most recently traversed viewport. */
|
|
163
|
-
dynamicScreenSpaceErrorComputedDensity = 0;
|
|
164
|
-
/** Estimated bytes currently retained by loaded tile content. */
|
|
165
|
-
gpuMemoryUsageInBytes = 0;
|
|
166
|
-
/** Active SSE threshold after optional cache-pressure adjustment, in logical/CSS pixels. */
|
|
167
|
-
memoryAdjustedScreenSpaceError = 0.0;
|
|
168
|
-
_cacheBytes = DEFAULT_CACHE_BYTES;
|
|
169
|
-
_maximumCacheOverflowBytes = DEFAULT_MAXIMUM_CACHE_OVERFLOW_BYTES;
|
|
170
|
-
_frameNumber = 0;
|
|
171
|
-
_tiles = {};
|
|
172
|
-
_pendingCount = 0;
|
|
173
|
-
selectedTiles = [];
|
|
174
|
-
traverseCounter = 0;
|
|
175
|
-
geometricError = 0;
|
|
176
|
-
lastUpdatedVieports = null;
|
|
177
|
-
_requestedTiles = [];
|
|
178
|
-
_emptyTiles = [];
|
|
179
|
-
frameStateData = {};
|
|
180
|
-
/** Last camera pose retained independently for each viewport. */
|
|
181
|
-
_cameraMotionStates = {};
|
|
182
|
-
/** Pending traversal that releases requests after camera motion settles. */
|
|
183
|
-
_deferredTraversalTimeout = null;
|
|
184
|
-
_traverser;
|
|
185
|
-
_cache = new TilesetCache();
|
|
186
|
-
_requestScheduler;
|
|
187
|
-
/** Drawn fallback instances retained independently for each viewport tree. */
|
|
188
|
-
_heldTiles = new Set();
|
|
189
|
-
updatePromise = null;
|
|
190
|
-
tilesetInitializationPromise;
|
|
191
|
-
/**
|
|
192
|
-
* Creates a tileset runtime from an explicit source implementation.
|
|
193
|
-
* @param source Source-backed tileset implementation.
|
|
194
|
-
* @param options Traversal and runtime options.
|
|
195
|
-
*/
|
|
196
|
-
constructor(source, options) {
|
|
197
|
-
if (!isTileset3DSource(source)) {
|
|
198
|
-
throw new Error('Tileset3D requires a Tileset3DSource instance');
|
|
199
|
-
}
|
|
200
|
-
const suppliedOptions = options || {};
|
|
201
|
-
const usesTiles3DCacheDefaults = source.type === TILESET_TYPE.TILES3D;
|
|
202
|
-
const defaultCacheBytes = usesTiles3DCacheDefaults
|
|
203
|
-
? DEFAULT_PROPS.cacheBytes
|
|
204
|
-
: DEFAULT_I3S_CACHE_BYTES;
|
|
205
|
-
const defaultMaximumCacheOverflowBytes = usesTiles3DCacheDefaults
|
|
206
|
-
? DEFAULT_PROPS.maximumCacheOverflowBytes
|
|
207
|
-
: DEFAULT_I3S_MAXIMUM_CACHE_OVERFLOW_BYTES;
|
|
208
|
-
const cacheBytes = resolveCacheBytes(suppliedOptions, defaultCacheBytes);
|
|
209
|
-
const maximumCacheOverflowBytes = resolveMaximumCacheOverflowBytes(suppliedOptions, defaultMaximumCacheOverflowBytes);
|
|
210
|
-
this.options = {
|
|
211
|
-
...DEFAULT_PROPS,
|
|
212
|
-
...suppliedOptions,
|
|
213
|
-
cacheBytes,
|
|
214
|
-
maximumCacheOverflowBytes,
|
|
215
|
-
skipLevelOfDetail: suppliedOptions.skipLevelOfDetail ?? source.type === TILESET_TYPE.TILES3D,
|
|
216
|
-
memoryAdjustedScreenSpaceError: suppliedOptions.memoryAdjustedScreenSpaceError ?? usesTiles3DCacheDefaults
|
|
217
|
-
};
|
|
218
|
-
this.loadOptions = this.options.loadOptions || {};
|
|
219
|
-
this.source = source;
|
|
220
|
-
this.tileset = null;
|
|
221
|
-
this.loader = this.source.loader;
|
|
222
|
-
this.type = this.source.type;
|
|
223
|
-
this.url = this.source.url;
|
|
224
|
-
this.basePath = this.source.basePath;
|
|
225
|
-
this.modelMatrix = this.options.modelMatrix;
|
|
226
|
-
this.ellipsoid = this.options.ellipsoid;
|
|
227
|
-
this.lodMetricType = '';
|
|
228
|
-
this.lodMetricValue = 0;
|
|
229
|
-
this.refine = '';
|
|
230
|
-
this.contentFormats = this.source.contentFormats;
|
|
231
|
-
this._traverser = this._initializeTraverser();
|
|
232
|
-
this._requestScheduler = new RequestScheduler({
|
|
233
|
-
throttleRequests: this.options.throttleRequests,
|
|
234
|
-
maxRequests: this.options.maxRequests
|
|
235
|
-
});
|
|
236
|
-
this.memoryAdjustedScreenSpaceError = this.options.maximumScreenSpaceError;
|
|
237
|
-
this._cacheBytes = cacheBytes;
|
|
238
|
-
this._maximumCacheOverflowBytes = maximumCacheOverflowBytes;
|
|
239
|
-
const metadata = this._getSourceMetadata();
|
|
240
|
-
if (metadata) {
|
|
241
|
-
this.spatialReference = applyTilesetSpatialOptions(metadata.spatialReference, this.options.spatial);
|
|
242
|
-
}
|
|
243
|
-
this.stats = new Stats({ id: this.url });
|
|
244
|
-
this._initializeStats();
|
|
245
|
-
this.tilesetInitializationPromise = this._initializeTileSet();
|
|
246
|
-
}
|
|
247
|
-
destroy() {
|
|
248
|
-
this._clearDeferredTraversal();
|
|
249
|
-
this.source.destroy?.();
|
|
250
|
-
this._destroy();
|
|
251
|
-
}
|
|
252
|
-
isLoaded() {
|
|
253
|
-
return this._pendingCount === 0 && this._frameNumber !== 0 && this._requestedTiles.length === 0;
|
|
254
|
-
}
|
|
255
|
-
get tiles() {
|
|
256
|
-
return Object.values(this._tiles);
|
|
257
|
-
}
|
|
258
|
-
get frameNumber() {
|
|
259
|
-
return this._frameNumber;
|
|
260
|
-
}
|
|
261
|
-
/**
|
|
262
|
-
* Returns the tiles requested during the most recent completed traversal.
|
|
263
|
-
*
|
|
264
|
-
* A defensive copy makes request ordering deterministic for diagnostics and prevents callers
|
|
265
|
-
* from mutating the scheduler's working set.
|
|
266
|
-
*/
|
|
267
|
-
get requestedTiles() {
|
|
268
|
-
return this._requestedTiles.slice();
|
|
269
|
-
}
|
|
270
|
-
/**
|
|
271
|
-
* Returns empty tiles considered during the most recent completed traversal.
|
|
272
|
-
*
|
|
273
|
-
* Empty tiles can still be useful hierarchy placeholders, but their IDs are included in
|
|
274
|
-
* observability snapshots so applications can distinguish traversal work from render content.
|
|
275
|
-
*/
|
|
276
|
-
get emptyTiles() {
|
|
277
|
-
return this._emptyTiles.slice();
|
|
278
|
-
}
|
|
279
|
-
/**
|
|
280
|
-
* Gets or sets the soft target, in bytes, for cached tile content not needed this frame.
|
|
281
|
-
*
|
|
282
|
-
* Current-frame tiles remain protected even when their estimated memory exceeds this target.
|
|
283
|
-
* Reducing the value makes unused least-recently-used tiles eligible for eviction on the next
|
|
284
|
-
* traversal.
|
|
285
|
-
* @default 536870912 for 3D Tiles; 33554432 for I3S
|
|
286
|
-
*/
|
|
287
|
-
get cacheBytes() {
|
|
288
|
-
return this._cacheBytes;
|
|
289
|
-
}
|
|
290
|
-
set cacheBytes(value) {
|
|
291
|
-
this._cacheBytes = validateCacheByteLength(value, 'cacheBytes');
|
|
292
|
-
this.options.cacheBytes = this._cacheBytes;
|
|
293
|
-
}
|
|
294
|
-
/**
|
|
295
|
-
* Gets or sets the additional current-frame headroom, in bytes, before memory-adjusted SSE rises.
|
|
296
|
-
*
|
|
297
|
-
* The pressure ceiling is `cacheBytes + maximumCacheOverflowBytes`. This value does not change
|
|
298
|
-
* the base target used to evict tiles that were not touched in the current frame.
|
|
299
|
-
* @default 536870912 for 3D Tiles; 1048576 for I3S
|
|
300
|
-
*/
|
|
301
|
-
get maximumCacheOverflowBytes() {
|
|
302
|
-
return this._maximumCacheOverflowBytes;
|
|
303
|
-
}
|
|
304
|
-
set maximumCacheOverflowBytes(value) {
|
|
305
|
-
this._maximumCacheOverflowBytes = validateCacheByteLength(value, 'maximumCacheOverflowBytes');
|
|
306
|
-
this.options.maximumCacheOverflowBytes = this._maximumCacheOverflowBytes;
|
|
307
|
-
}
|
|
308
|
-
get queryParams() {
|
|
309
|
-
const rootUrl = this.source.getTileUrl(this.url);
|
|
310
|
-
const queryIndex = rootUrl.indexOf('?');
|
|
311
|
-
return queryIndex >= 0 ? rootUrl.slice(queryIndex + 1) : '';
|
|
312
|
-
}
|
|
313
|
-
/**
|
|
314
|
-
* Updates traversal and runtime options while retaining unspecified byte budgets.
|
|
315
|
-
*
|
|
316
|
-
* @param props - Partial runtime options to apply.
|
|
317
|
-
*/
|
|
318
|
-
setProps(props) {
|
|
319
|
-
const cacheBytes = resolveCacheBytes(props, this.cacheBytes);
|
|
320
|
-
const maximumCacheOverflowBytes = resolveMaximumCacheOverflowBytes(props, this.maximumCacheOverflowBytes);
|
|
321
|
-
this.options = {
|
|
322
|
-
...this.options,
|
|
323
|
-
...props,
|
|
324
|
-
cacheBytes,
|
|
325
|
-
maximumCacheOverflowBytes
|
|
326
|
-
};
|
|
327
|
-
this._cacheBytes = cacheBytes;
|
|
328
|
-
this._maximumCacheOverflowBytes = maximumCacheOverflowBytes;
|
|
329
|
-
}
|
|
330
|
-
getTileUrl(tilePath) {
|
|
331
|
-
return this.source.getTileUrl(tilePath);
|
|
332
|
-
}
|
|
333
|
-
hasExtension(extensionName) {
|
|
334
|
-
return Boolean(this.source.hasExtension?.(extensionName));
|
|
335
|
-
}
|
|
336
|
-
update(viewports = null) {
|
|
337
|
-
this.tilesetInitializationPromise.then(() => {
|
|
338
|
-
if (!viewports && this.lastUpdatedVieports) {
|
|
339
|
-
viewports = this.lastUpdatedVieports;
|
|
340
|
-
}
|
|
341
|
-
else {
|
|
342
|
-
this.lastUpdatedVieports = viewports;
|
|
343
|
-
}
|
|
344
|
-
if (viewports) {
|
|
345
|
-
this.doUpdate(viewports);
|
|
346
|
-
}
|
|
347
|
-
});
|
|
348
|
-
}
|
|
349
|
-
async selectTiles(viewports = null) {
|
|
350
|
-
await this.tilesetInitializationPromise;
|
|
351
|
-
if (viewports) {
|
|
352
|
-
this.lastUpdatedVieports = viewports;
|
|
353
|
-
}
|
|
354
|
-
if (!this.updatePromise) {
|
|
355
|
-
this.updatePromise = new Promise(resolve => {
|
|
356
|
-
setTimeout(() => {
|
|
357
|
-
if (this.lastUpdatedVieports) {
|
|
358
|
-
this.doUpdate(this.lastUpdatedVieports);
|
|
359
|
-
}
|
|
360
|
-
resolve(this._frameNumber);
|
|
361
|
-
this.updatePromise = null;
|
|
362
|
-
}, this.options.debounceTime);
|
|
363
|
-
});
|
|
364
|
-
}
|
|
365
|
-
return this.updatePromise;
|
|
366
|
-
}
|
|
367
|
-
/**
|
|
368
|
-
* Moves the active LOD threshold toward the configured SSE or away from cache pressure.
|
|
369
|
-
*
|
|
370
|
-
* Usage below {@link Tileset3D.cacheBytes} restores quality in two-percent steps. Usage above
|
|
371
|
-
* `cacheBytes + maximumCacheOverflowBytes` reduces refinement in two-percent steps. Values in
|
|
372
|
-
* the overflow window leave the threshold unchanged, preventing rapid load/evict oscillation.
|
|
373
|
-
*/
|
|
374
|
-
adjustScreenSpaceError() {
|
|
375
|
-
if (this.gpuMemoryUsageInBytes < this.cacheBytes) {
|
|
376
|
-
this.memoryAdjustedScreenSpaceError = Math.max(this.memoryAdjustedScreenSpaceError / 1.02, this.options.maximumScreenSpaceError);
|
|
377
|
-
}
|
|
378
|
-
else if (this.gpuMemoryUsageInBytes > this.cacheBytes + this.maximumCacheOverflowBytes) {
|
|
379
|
-
this.memoryAdjustedScreenSpaceError *= 1.02;
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
doUpdate(viewports) {
|
|
383
|
-
if ('loadTiles' in this.options && !this.options.loadTiles) {
|
|
384
|
-
return;
|
|
385
|
-
}
|
|
386
|
-
if (this.traverseCounter > 0) {
|
|
387
|
-
return;
|
|
388
|
-
}
|
|
389
|
-
const preparedViewports = viewports instanceof Array ? viewports : [viewports];
|
|
390
|
-
const activeViewportIds = new Set(preparedViewports.map(viewport => viewport.id));
|
|
391
|
-
// A viewport may be removed between frames. Discard its completed state before aggregating
|
|
392
|
-
// requested and selected tiles so observability reflects only the current traversal inputs.
|
|
393
|
-
for (const frameStateId of Object.keys(this.frameStateData)) {
|
|
394
|
-
if (!activeViewportIds.has(frameStateId)) {
|
|
395
|
-
delete this.frameStateData[frameStateId];
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
this._cache.reset();
|
|
399
|
-
this._frameNumber++;
|
|
400
|
-
this.traverseCounter = preparedViewports.length;
|
|
401
|
-
const currentTime = Date.now();
|
|
402
|
-
let minimumDeferredTraversalDelay = Number.POSITIVE_INFINITY;
|
|
403
|
-
const viewportsToTraverse = [];
|
|
404
|
-
for (const viewport of preparedViewports) {
|
|
405
|
-
const id = viewport.id;
|
|
406
|
-
if (this._needTraverse(id)) {
|
|
407
|
-
viewportsToTraverse.push(id);
|
|
408
|
-
}
|
|
409
|
-
else {
|
|
410
|
-
this.traverseCounter--;
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
for (const viewport of preparedViewports) {
|
|
414
|
-
const id = viewport.id;
|
|
415
|
-
if (!this.roots[id]) {
|
|
416
|
-
this.roots[id] = this._initializeTileHeaders(this.tileset, null);
|
|
417
|
-
}
|
|
418
|
-
if (!viewportsToTraverse.includes(id)) {
|
|
419
|
-
continue;
|
|
420
|
-
}
|
|
421
|
-
const frameState = getFrameState(viewport, this._frameNumber);
|
|
422
|
-
const root = this.roots[id];
|
|
423
|
-
const cameraMotionUpdate = updateCameraMotionState(this._cameraMotionStates[id], frameState.camera.position, frameState.camera.direction, currentTime);
|
|
424
|
-
this._cameraMotionStates[id] = cameraMotionUpdate.state;
|
|
425
|
-
frameState.camera.timeSinceMovement = cameraMotionUpdate.timeSinceMovement;
|
|
426
|
-
// Dynamic SSE reads the root's inverse computed transform before traversal updates tile
|
|
427
|
-
// visibility. Refresh it from the current tileset model matrix here so animated local
|
|
428
|
-
// box/sphere tilesets never calculate their height falloff one transform behind the frame.
|
|
429
|
-
updateRootTransformForDynamicScreenSpaceError(root, this.modelMatrix);
|
|
430
|
-
frameState.dynamicScreenSpaceErrorDensity =
|
|
431
|
-
this.type === TILESET_TYPE.TILES3D &&
|
|
432
|
-
this.options.dynamicScreenSpaceError &&
|
|
433
|
-
!frameState.viewport.orthographic
|
|
434
|
-
? calculateDynamicScreenSpaceErrorDensity(root, frameState, this.options)
|
|
435
|
-
: 0;
|
|
436
|
-
// Keep the legacy diagnostic field, but traversal reads the per-viewport frame value above.
|
|
437
|
-
this.dynamicScreenSpaceErrorComputedDensity = frameState.dynamicScreenSpaceErrorDensity;
|
|
438
|
-
this._traverser.traverse(root, frameState, this.options);
|
|
439
|
-
if (Object.keys(this._traverser.deferredTiles).length > 0) {
|
|
440
|
-
minimumDeferredTraversalDelay = Math.min(minimumDeferredTraversalDelay, Math.max(this.options.foveatedTimeDelay - cameraMotionUpdate.timeSinceMovement, 0));
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
if (Number.isFinite(minimumDeferredTraversalDelay)) {
|
|
444
|
-
this._scheduleDeferredTraversal(minimumDeferredTraversalDelay);
|
|
445
|
-
}
|
|
446
|
-
else {
|
|
447
|
-
this._clearDeferredTraversal();
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
/**
|
|
451
|
-
* Schedules one follow-up traversal when the moving-camera deferral window expires.
|
|
452
|
-
*
|
|
453
|
-
* Replacing an existing timer ensures continuing camera movement pushes the retry window forward
|
|
454
|
-
* instead of creating a queue of redundant traversals.
|
|
455
|
-
*
|
|
456
|
-
* @param delayInSeconds - Remaining stationary delay before deferred requests become eligible.
|
|
457
|
-
*/
|
|
458
|
-
_scheduleDeferredTraversal(delayInSeconds) {
|
|
459
|
-
this._clearDeferredTraversal();
|
|
460
|
-
this._deferredTraversalTimeout = setTimeout(() => {
|
|
461
|
-
this._deferredTraversalTimeout = null;
|
|
462
|
-
this.selectTiles().catch((error) => {
|
|
463
|
-
const traversalError = error instanceof Error ? error : new Error(String(error));
|
|
464
|
-
this._onTilesetError(traversalError);
|
|
465
|
-
});
|
|
466
|
-
}, Math.max(delayInSeconds * 1000, 0));
|
|
467
|
-
}
|
|
468
|
-
/** Clears a pending moving-camera follow-up traversal. */
|
|
469
|
-
_clearDeferredTraversal() {
|
|
470
|
-
if (this._deferredTraversalTimeout !== null) {
|
|
471
|
-
clearTimeout(this._deferredTraversalTimeout);
|
|
472
|
-
this._deferredTraversalTimeout = null;
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
_needTraverse(viewportId) {
|
|
476
|
-
let traverserId = viewportId;
|
|
477
|
-
if (this.options.viewportTraversersMap) {
|
|
478
|
-
traverserId = this.options.viewportTraversersMap[viewportId];
|
|
479
|
-
}
|
|
480
|
-
return traverserId === viewportId;
|
|
481
|
-
}
|
|
482
|
-
_onTraversalEnd(frameState) {
|
|
483
|
-
const id = frameState.viewport.id;
|
|
484
|
-
if (!this.frameStateData[id]) {
|
|
485
|
-
this.frameStateData[id] = { selectedTiles: [], _requestedTiles: [], _emptyTiles: [] };
|
|
486
|
-
}
|
|
487
|
-
const currentFrameStateData = this.frameStateData[id];
|
|
488
|
-
const selectedTiles = Object.values(this._traverser.selectedTiles);
|
|
489
|
-
const [filteredSelectedTiles, unselectedTiles] = limitSelectedTiles(selectedTiles, frameState, this.options.maximumTilesSelected);
|
|
490
|
-
currentFrameStateData.selectedTiles = filteredSelectedTiles;
|
|
491
|
-
for (const tile of unselectedTiles) {
|
|
492
|
-
tile.unselect();
|
|
493
|
-
}
|
|
494
|
-
currentFrameStateData._requestedTiles = Object.values(this._traverser.requestedTiles);
|
|
495
|
-
currentFrameStateData._emptyTiles = Object.values(this._traverser.emptyTiles);
|
|
496
|
-
this.traverseCounter--;
|
|
497
|
-
if (this.traverseCounter > 0) {
|
|
498
|
-
return;
|
|
499
|
-
}
|
|
500
|
-
this._updateTiles();
|
|
501
|
-
}
|
|
502
|
-
_updateTiles() {
|
|
503
|
-
const previousSelectedTiles = this.selectedTiles;
|
|
504
|
-
this.selectedTiles = [];
|
|
505
|
-
this._requestedTiles = [];
|
|
506
|
-
this._emptyTiles = [];
|
|
507
|
-
for (const frameStateKey in this.frameStateData) {
|
|
508
|
-
const frameStateDataValue = this.frameStateData[frameStateKey];
|
|
509
|
-
this.selectedTiles = this.selectedTiles.concat(frameStateDataValue.selectedTiles);
|
|
510
|
-
this._requestedTiles = this._requestedTiles.concat(frameStateDataValue._requestedTiles);
|
|
511
|
-
this._emptyTiles = this._emptyTiles.concat(frameStateDataValue._emptyTiles);
|
|
512
|
-
}
|
|
513
|
-
this.selectedTiles = this.options.onTraversalComplete(this.selectedTiles);
|
|
514
|
-
const selectedTiles = new Set(this.selectedTiles);
|
|
515
|
-
const hasUndrawnTiles = this.selectedTiles.some(tile => !tile.tileDrawn);
|
|
516
|
-
let heldBackCount = 0;
|
|
517
|
-
if (hasUndrawnTiles) {
|
|
518
|
-
const activeRoots = new Set(Object.keys(this.frameStateData).map(viewportId => this.roots[viewportId]));
|
|
519
|
-
const descendantReadiness = new Map();
|
|
520
|
-
for (const tile of this.selectedTiles) {
|
|
521
|
-
for (let ancestor = tile.parent; ancestor; ancestor = ancestor.parent) {
|
|
522
|
-
descendantReadiness.set(ancestor, (descendantReadiness.get(ancestor) ?? true) && tile.tileDrawn);
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
// Drawing can finish between traversals. Promote only previously selected
|
|
526
|
-
// geometry that actually drew; pending tiles cannot provide visible fallback.
|
|
527
|
-
for (const tile of previousSelectedTiles) {
|
|
528
|
-
if (tile.tileDrawn)
|
|
529
|
-
this._heldTiles.add(tile);
|
|
530
|
-
}
|
|
531
|
-
for (const tile of this._heldTiles) {
|
|
532
|
-
let root = tile;
|
|
533
|
-
while (root.parent)
|
|
534
|
-
root = root.parent;
|
|
535
|
-
// Removed viewport trees cannot contribute fallback to the remaining views.
|
|
536
|
-
if (!activeRoots.has(root)) {
|
|
537
|
-
this._heldTiles.delete(tile);
|
|
538
|
-
continue;
|
|
539
|
-
}
|
|
540
|
-
if (selectedTiles.has(tile))
|
|
541
|
-
continue;
|
|
542
|
-
if (tile.contentAvailable &&
|
|
543
|
-
!this._hasDrawnReplacement(tile, selectedTiles, descendantReadiness)) {
|
|
544
|
-
tile._selectedFrame = this._frameNumber;
|
|
545
|
-
this.selectedTiles.push(tile);
|
|
546
|
-
heldBackCount++;
|
|
547
|
-
}
|
|
548
|
-
else {
|
|
549
|
-
this._heldTiles.delete(tile);
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
else {
|
|
554
|
-
this._heldTiles = selectedTiles;
|
|
555
|
-
}
|
|
556
|
-
if (heldBackCount > 0) {
|
|
557
|
-
setTimeout(() => {
|
|
558
|
-
this.selectTiles();
|
|
559
|
-
}, 0);
|
|
560
|
-
}
|
|
561
|
-
for (const tile of this.selectedTiles) {
|
|
562
|
-
this._tiles[tile.id] = tile;
|
|
563
|
-
}
|
|
564
|
-
this._loadTiles();
|
|
565
|
-
this._unloadTiles();
|
|
566
|
-
this._updateStats();
|
|
567
|
-
if (this._tilesChanged(previousSelectedTiles, this.selectedTiles)) {
|
|
568
|
-
this.options.onUpdate();
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
/**
|
|
572
|
-
* Releases fallback geometry once its own selected replacement has drawn.
|
|
573
|
-
* Unrelated pending branches must not delay this region's handoff. When no related
|
|
574
|
-
* replacement is selected, retain the fallback until the complete selection has drawn.
|
|
575
|
-
*/
|
|
576
|
-
_hasDrawnReplacement(tile, selectedTiles, descendantReadiness) {
|
|
577
|
-
for (let ancestor = tile.parent; ancestor; ancestor = ancestor.parent) {
|
|
578
|
-
if (selectedTiles.has(ancestor)) {
|
|
579
|
-
return ancestor.tileDrawn;
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
return descendantReadiness.get(tile) === true;
|
|
583
|
-
}
|
|
584
|
-
_tilesChanged(oldSelectedTiles, selectedTiles) {
|
|
585
|
-
if (oldSelectedTiles.length !== selectedTiles.length) {
|
|
586
|
-
return true;
|
|
587
|
-
}
|
|
588
|
-
const oldSet = new Set(oldSelectedTiles.map(tile => tile.id));
|
|
589
|
-
const newSet = new Set(selectedTiles.map(tile => tile.id));
|
|
590
|
-
let changed = oldSelectedTiles.some(tile => !newSet.has(tile.id));
|
|
591
|
-
changed = changed || selectedTiles.some(tile => !oldSet.has(tile.id));
|
|
592
|
-
return changed;
|
|
593
|
-
}
|
|
594
|
-
_loadTiles() {
|
|
595
|
-
this._requestedTiles.sort((tileA, tileB) => tileA._priority - tileB._priority);
|
|
596
|
-
for (const tile of this._requestedTiles) {
|
|
597
|
-
if (tile.contentUnloaded) {
|
|
598
|
-
this._loadTile(tile);
|
|
599
|
-
}
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
_unloadTiles() {
|
|
603
|
-
this._cache.unloadTiles(this, (tileset, tile) => tileset._unloadTile(tile));
|
|
604
|
-
if (this.options.memoryAdjustedScreenSpaceError) {
|
|
605
|
-
this.adjustScreenSpaceError();
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
_updateStats() {
|
|
609
|
-
let tilesRenderable = 0;
|
|
610
|
-
let pointsRenderable = 0;
|
|
611
|
-
for (const tile of this.selectedTiles) {
|
|
612
|
-
if (tile.contentAvailable && tile.content) {
|
|
613
|
-
tilesRenderable++;
|
|
614
|
-
const contents = tile.contents.length ? tile.contents : [tile.content];
|
|
615
|
-
for (const content of contents) {
|
|
616
|
-
if (content.pointCount) {
|
|
617
|
-
pointsRenderable += content.pointCount;
|
|
618
|
-
}
|
|
619
|
-
else {
|
|
620
|
-
pointsRenderable += content.vertexCount || 0;
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
this.stats.get(TILES_IN_VIEW).count = this.selectedTiles.length;
|
|
626
|
-
this.stats.get(TILES_RENDERABLE).count = tilesRenderable;
|
|
627
|
-
this.stats.get(POINTS_COUNT).count = pointsRenderable;
|
|
628
|
-
this.stats.get(MAXIMUM_SSE).count = this.memoryAdjustedScreenSpaceError;
|
|
629
|
-
}
|
|
630
|
-
async _initializeTileSet() {
|
|
631
|
-
try {
|
|
632
|
-
const initializePromise = this.source.initialize();
|
|
633
|
-
const initialMetadata = this._getSourceMetadata();
|
|
634
|
-
if (initialMetadata) {
|
|
635
|
-
this._syncSourceState(initialMetadata);
|
|
636
|
-
}
|
|
637
|
-
if (initialMetadata?.tileset?.root &&
|
|
638
|
-
typeof initialMetadata.tileset.root.then !== 'function' &&
|
|
639
|
-
(!this.source.prepareTileset || this.spatialReference?.status === 'native')) {
|
|
640
|
-
this.root = this._initializeTileHeaders(initialMetadata.tileset, null);
|
|
641
|
-
this._applyViewState();
|
|
642
|
-
}
|
|
643
|
-
await initializePromise;
|
|
644
|
-
const metadata = this.source.getMetadata();
|
|
645
|
-
this._syncSourceState(metadata);
|
|
646
|
-
await this.source.prepareTileset?.(this);
|
|
647
|
-
if (!this.root) {
|
|
648
|
-
this.root = this._initializeTileHeaders(metadata.tileset, null);
|
|
649
|
-
}
|
|
650
|
-
this._applyViewState();
|
|
651
|
-
}
|
|
652
|
-
catch (error) {
|
|
653
|
-
const sourceError = error instanceof Error ? error : new Error(String(error));
|
|
654
|
-
this._onSourceError(sourceError, this.root);
|
|
655
|
-
this._onTilesetError(sourceError);
|
|
656
|
-
throw sourceError;
|
|
657
|
-
}
|
|
658
|
-
}
|
|
659
|
-
_initializeStats() {
|
|
660
|
-
this.stats.get(TILES_TOTAL);
|
|
661
|
-
this.stats.get(TILES_LOADING);
|
|
662
|
-
this.stats.get(TILES_IN_MEMORY);
|
|
663
|
-
this.stats.get(TILES_IN_VIEW);
|
|
664
|
-
this.stats.get(TILES_RENDERABLE);
|
|
665
|
-
this.stats.get(TILES_LOADED);
|
|
666
|
-
this.stats.get(TILES_UNLOADED);
|
|
667
|
-
this.stats.get(TILES_LOAD_FAILED);
|
|
668
|
-
this.stats.get(POINTS_COUNT);
|
|
669
|
-
this.stats.get(TILES_GPU_MEMORY, 'memory');
|
|
670
|
-
this.stats.get(MAXIMUM_SSE);
|
|
671
|
-
}
|
|
672
|
-
_initializeTileHeaders(tilesetJson, parentTileHeader) {
|
|
673
|
-
return this.source.initializeTileHeaders(this, tilesetJson, parentTileHeader);
|
|
674
|
-
}
|
|
675
|
-
_initializeTraverser() {
|
|
676
|
-
return this.source.createTraverser({
|
|
677
|
-
basePath: this.basePath,
|
|
678
|
-
onTraversalEnd: this._onTraversalEnd.bind(this)
|
|
679
|
-
});
|
|
680
|
-
}
|
|
681
|
-
_destroyTileHeaders(parentTile) {
|
|
682
|
-
this._destroySubtree(parentTile);
|
|
683
|
-
}
|
|
684
|
-
async _loadTile(tile) {
|
|
685
|
-
let loadResult = null;
|
|
686
|
-
try {
|
|
687
|
-
this._onStartTileLoading();
|
|
688
|
-
loadResult = await tile.loadContent();
|
|
689
|
-
}
|
|
690
|
-
catch (error) {
|
|
691
|
-
const tileError = error instanceof Error ? error : new Error('load failed');
|
|
692
|
-
this._onSourceError(tileError, tile);
|
|
693
|
-
this._onTileLoadError(tile, tileError);
|
|
694
|
-
}
|
|
695
|
-
finally {
|
|
696
|
-
this._onEndTileLoading();
|
|
697
|
-
this._onTileLoad(tile, loadResult);
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
/**
|
|
701
|
-
* Loads a source-managed lazy child-header group and reports failures through tile callbacks.
|
|
702
|
-
*
|
|
703
|
-
* Subtree metadata shares the normal loading counters but is not reported as render content and
|
|
704
|
-
* is not added to the GPU cache. Traversal is notified separately after the promise settles.
|
|
705
|
-
*
|
|
706
|
-
* @param tile - Runtime tile that owns the lazy subtree reference.
|
|
707
|
-
* @param frameState - View state that made the subtree eligible for refinement.
|
|
708
|
-
*/
|
|
709
|
-
async _loadTileChildren(tile, frameState) {
|
|
710
|
-
try {
|
|
711
|
-
this._onStartTileLoading();
|
|
712
|
-
await tile.loadChildren(frameState);
|
|
713
|
-
}
|
|
714
|
-
catch (error) {
|
|
715
|
-
const tileError = error instanceof Error ? error : new Error('subtree load failed');
|
|
716
|
-
this._onSourceError(tileError, tile);
|
|
717
|
-
this._onTileLoadError(tile, tileError);
|
|
718
|
-
}
|
|
719
|
-
finally {
|
|
720
|
-
this._onEndTileLoading();
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
_onTileLoadError(tile, error) {
|
|
724
|
-
this.stats.get(TILES_LOAD_FAILED).incrementCount();
|
|
725
|
-
const message = error.message || error.toString();
|
|
726
|
-
const url = tile.url;
|
|
727
|
-
console.error(`A 3D tile failed to load: ${tile.url} ${message}`);
|
|
728
|
-
this.options.onTileError(tile, message, url);
|
|
729
|
-
}
|
|
730
|
-
_onSourceError(error, tile = null) {
|
|
731
|
-
this.options.onSourceError(error, this.source, tile);
|
|
732
|
-
}
|
|
733
|
-
_onTilesetError(error) {
|
|
734
|
-
this.options.onTilesetError(error, this);
|
|
735
|
-
}
|
|
736
|
-
_onTileLoad(tile, loadResult) {
|
|
737
|
-
if (!loadResult?.loaded) {
|
|
738
|
-
return;
|
|
739
|
-
}
|
|
740
|
-
if (tile.content) {
|
|
741
|
-
calculateTransformProps(tile, tile.content);
|
|
742
|
-
}
|
|
743
|
-
this.source.onTileLoaded?.(this, tile, loadResult);
|
|
744
|
-
this._syncSourceState(this.source.getMetadata());
|
|
745
|
-
const totalTiles = this.source.getTilesTotalCount?.();
|
|
746
|
-
if (totalTiles) {
|
|
747
|
-
this.stats.get(TILES_TOTAL).reset();
|
|
748
|
-
this.stats.get(TILES_TOTAL).addCount(totalTiles);
|
|
749
|
-
}
|
|
750
|
-
this._addTileToCache(tile);
|
|
751
|
-
this.options.onTileLoad(tile);
|
|
752
|
-
}
|
|
753
|
-
_onStartTileLoading() {
|
|
754
|
-
this._pendingCount++;
|
|
755
|
-
this.stats.get(TILES_LOADING).incrementCount();
|
|
756
|
-
}
|
|
757
|
-
_onEndTileLoading() {
|
|
758
|
-
this._pendingCount--;
|
|
759
|
-
this.stats.get(TILES_LOADING).decrementCount();
|
|
760
|
-
}
|
|
761
|
-
_addTileToCache(tile) {
|
|
762
|
-
this._cache.add(this, tile, tileset => tileset._updateCacheStats(tile));
|
|
763
|
-
}
|
|
764
|
-
_updateCacheStats(tile) {
|
|
765
|
-
this.stats.get(TILES_LOADED).incrementCount();
|
|
766
|
-
this.stats.get(TILES_IN_MEMORY).incrementCount();
|
|
767
|
-
this.gpuMemoryUsageInBytes += tile.gpuMemoryUsageInBytes || 0;
|
|
768
|
-
this.stats.get(TILES_GPU_MEMORY).count = this.gpuMemoryUsageInBytes;
|
|
769
|
-
if (this.options.memoryAdjustedScreenSpaceError) {
|
|
770
|
-
this.adjustScreenSpaceError();
|
|
771
|
-
}
|
|
772
|
-
}
|
|
773
|
-
_unloadTile(tile) {
|
|
774
|
-
this.gpuMemoryUsageInBytes -= tile.gpuMemoryUsageInBytes || 0;
|
|
775
|
-
this.stats.get(TILES_IN_MEMORY).decrementCount();
|
|
776
|
-
this.stats.get(TILES_UNLOADED).incrementCount();
|
|
777
|
-
this.stats.get(TILES_GPU_MEMORY).count = this.gpuMemoryUsageInBytes;
|
|
778
|
-
this.options.onTileUnload(tile);
|
|
779
|
-
tile.unloadContent();
|
|
780
|
-
}
|
|
781
|
-
_destroy() {
|
|
782
|
-
const stack = [];
|
|
783
|
-
if (this.root) {
|
|
784
|
-
stack.push(this.root);
|
|
785
|
-
}
|
|
786
|
-
while (stack.length > 0) {
|
|
787
|
-
const tile = stack.pop();
|
|
788
|
-
for (const child of tile.children) {
|
|
789
|
-
stack.push(child);
|
|
790
|
-
}
|
|
791
|
-
this._destroyTile(tile);
|
|
792
|
-
}
|
|
793
|
-
this.root = null;
|
|
794
|
-
}
|
|
795
|
-
_destroySubtree(tile) {
|
|
796
|
-
const rootTile = tile;
|
|
797
|
-
const stack = [rootTile];
|
|
798
|
-
while (stack.length > 0) {
|
|
799
|
-
tile = stack.pop();
|
|
800
|
-
for (const child of tile.children) {
|
|
801
|
-
stack.push(child);
|
|
802
|
-
}
|
|
803
|
-
if (tile !== rootTile) {
|
|
804
|
-
this._destroyTile(tile);
|
|
805
|
-
}
|
|
806
|
-
}
|
|
807
|
-
rootTile.children = [];
|
|
808
|
-
}
|
|
809
|
-
_destroyTile(tile) {
|
|
810
|
-
this._cache.unloadTile(this, tile);
|
|
811
|
-
this._unloadTile(tile);
|
|
812
|
-
tile.destroy();
|
|
813
|
-
}
|
|
814
|
-
_syncSourceState(metadata) {
|
|
815
|
-
this.tileset = metadata.tileset;
|
|
816
|
-
this.loader = metadata.loader;
|
|
817
|
-
this.type = metadata.type;
|
|
818
|
-
this.url = metadata.url;
|
|
819
|
-
this.basePath = metadata.basePath;
|
|
820
|
-
this.lodMetricType = metadata.lodMetricType;
|
|
821
|
-
this.lodMetricValue = metadata.lodMetricValue;
|
|
822
|
-
this.refine = metadata.refine;
|
|
823
|
-
this.contentFormats = this.source.contentFormats;
|
|
824
|
-
this.asset = this.source.asset || this.asset;
|
|
825
|
-
const tileset = metadata.tileset;
|
|
826
|
-
this.schema = tileset.schema || null;
|
|
827
|
-
this.schemaUri = tileset.schemaUri || null;
|
|
828
|
-
this.groups = tileset.groups || [];
|
|
829
|
-
this.metadata = tileset.metadata || null;
|
|
830
|
-
this.statistics = tileset.statistics ?? null;
|
|
831
|
-
const spatialReference = applyTilesetSpatialOptions(metadata.spatialReference, this.options.spatial);
|
|
832
|
-
this.spatialReference = preserveTransformedSpatialReference(this.spatialReference, spatialReference);
|
|
833
|
-
this.properties = this.source.properties ?? this.properties;
|
|
834
|
-
this.extras = this.source.extras ?? this.extras;
|
|
835
|
-
if (this.options.attributions?.length) {
|
|
836
|
-
this.credits = { attributions: this.options.attributions };
|
|
837
|
-
}
|
|
838
|
-
else {
|
|
839
|
-
this.credits = this.source.credits || this.credits;
|
|
840
|
-
}
|
|
841
|
-
}
|
|
842
|
-
_applyViewState() {
|
|
843
|
-
const viewState = this.source.getViewState(this.root);
|
|
844
|
-
this.asset = viewState.asset || this.source.asset || {};
|
|
845
|
-
this.properties = viewState.properties ?? this.source.properties;
|
|
846
|
-
this.extras = viewState.extras ?? this.source.extras ?? null;
|
|
847
|
-
this.credits = viewState.credits ||
|
|
848
|
-
this.source.credits ||
|
|
849
|
-
this.credits || { attributions: this.options.attributions || [] };
|
|
850
|
-
this.description = viewState.description || this.options.description || '';
|
|
851
|
-
this.boundingVolume = viewState.boundingVolume || this.root?.boundingVolume || null;
|
|
852
|
-
this.cartographicCenter = viewState.cartographicCenter || new Vector3();
|
|
853
|
-
this.cartesianCenter = viewState.cartesianCenter || null;
|
|
854
|
-
this.zoom = viewState.zoom || 1;
|
|
855
|
-
this.geometricError = this.tileset?.geometricError || 0;
|
|
856
|
-
}
|
|
857
|
-
/**
|
|
858
|
-
* Returns normalized source metadata when initialization has already populated it.
|
|
859
|
-
*/
|
|
860
|
-
_getSourceMetadata() {
|
|
861
|
-
try {
|
|
862
|
-
return this.source.getMetadata();
|
|
863
|
-
}
|
|
864
|
-
catch {
|
|
865
|
-
return null;
|
|
866
|
-
}
|
|
867
|
-
}
|
|
868
|
-
}
|
|
869
|
-
/** Preserve a completed runtime operation when asynchronous source metadata describes the same request. */
|
|
870
|
-
function preserveTransformedSpatialReference(current, next) {
|
|
871
|
-
return current?.status === 'transformed' &&
|
|
872
|
-
current.sourceCrs === next.sourceCrs &&
|
|
873
|
-
current.targetCrs === next.targetCrs &&
|
|
874
|
-
current.targetHeightReference === next.targetHeightReference &&
|
|
875
|
-
current.outputCoordinates === next.outputCoordinates
|
|
876
|
-
? current
|
|
877
|
-
: next;
|
|
878
|
-
}
|
|
879
|
-
//# sourceMappingURL=tileset-3d.js.map
|