@loaders.gl/tiles 5.0.0-alpha.11 → 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.
Files changed (698) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +18 -72
  3. package/dist/dist.dev.js +5874 -23815
  4. package/dist/dist.min.js +3 -3
  5. package/dist/image-set.d.ts +1 -1
  6. package/dist/image-set.d.ts.map +1 -1
  7. package/dist/index.cjs +2803 -10209
  8. package/dist/index.cjs.map +3 -3
  9. package/dist/index.d.ts +4 -43
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +3 -26
  12. package/dist/index.js.map +1 -1
  13. package/dist/mlt/bundled.d.ts +3 -0
  14. package/dist/mlt/bundled.d.ts.map +1 -0
  15. package/dist/mlt/bundled.js +5 -0
  16. package/dist/mlt/bundled.js.map +1 -0
  17. package/dist/mlt/index.cjs +3701 -0
  18. package/dist/mlt/index.cjs.map +6 -0
  19. package/dist/mlt/index.d.ts +10 -0
  20. package/dist/mlt/index.d.ts.map +1 -0
  21. package/dist/mlt/index.js +12 -0
  22. package/dist/mlt/index.js.map +1 -0
  23. package/dist/mlt/lib/encode-mlt-geometry.d.ts +6 -0
  24. package/dist/mlt/lib/encode-mlt-geometry.d.ts.map +1 -0
  25. package/dist/mlt/lib/encode-mlt-geometry.js +150 -0
  26. package/dist/mlt/lib/encode-mlt-geometry.js.map +1 -0
  27. package/dist/mlt/lib/encode-mlt-streams.d.ts +13 -0
  28. package/dist/mlt/lib/encode-mlt-streams.d.ts.map +1 -0
  29. package/dist/mlt/lib/encode-mlt-streams.js +57 -0
  30. package/dist/mlt/lib/encode-mlt-streams.js.map +1 -0
  31. package/dist/mlt/lib/encode-mlt.d.ts +6 -0
  32. package/dist/mlt/lib/encode-mlt.d.ts.map +1 -0
  33. package/dist/mlt/lib/encode-mlt.js +174 -0
  34. package/dist/mlt/lib/encode-mlt.js.map +1 -0
  35. package/dist/mlt/lib/parse-mlt.d.ts +11 -0
  36. package/dist/mlt/lib/parse-mlt.d.ts.map +1 -0
  37. package/dist/mlt/lib/parse-mlt.js +675 -0
  38. package/dist/mlt/lib/parse-mlt.js.map +1 -0
  39. package/dist/mlt/mlt-format.d.ts +14 -0
  40. package/dist/mlt/mlt-format.d.ts.map +1 -0
  41. package/dist/mlt/mlt-format.js +17 -0
  42. package/dist/mlt/mlt-format.js.map +1 -0
  43. package/dist/mlt/mlt-loader-with-parser.d.ts +91 -0
  44. package/dist/mlt/mlt-loader-with-parser.d.ts.map +1 -0
  45. package/dist/mlt/mlt-loader-with-parser.js +29 -0
  46. package/dist/mlt/mlt-loader-with-parser.js.map +1 -0
  47. package/dist/mlt/mlt-loader.d.ts +115 -0
  48. package/dist/mlt/mlt-loader.d.ts.map +1 -0
  49. package/dist/mlt/mlt-loader.js +38 -0
  50. package/dist/mlt/mlt-loader.js.map +1 -0
  51. package/dist/mlt/mlt-source-loader.d.ts +82 -0
  52. package/dist/mlt/mlt-source-loader.d.ts.map +1 -0
  53. package/dist/mlt/mlt-source-loader.js +179 -0
  54. package/dist/mlt/mlt-source-loader.js.map +1 -0
  55. package/dist/mlt/mlt-writer.d.ts +45 -0
  56. package/dist/mlt/mlt-writer.d.ts.map +1 -0
  57. package/dist/mlt/mlt-writer.js +21 -0
  58. package/dist/mlt/mlt-writer.js.map +1 -0
  59. package/dist/mlt/unbundled.d.ts +3 -0
  60. package/dist/mlt/unbundled.d.ts.map +1 -0
  61. package/dist/mlt/unbundled.js +5 -0
  62. package/dist/mlt/unbundled.js.map +1 -0
  63. package/dist/mvt/arrow-table-tile-source-loader-types.d.ts +36 -0
  64. package/dist/mvt/arrow-table-tile-source-loader-types.d.ts.map +1 -0
  65. package/dist/mvt/arrow-table-tile-source-loader-types.js +36 -0
  66. package/dist/mvt/arrow-table-tile-source-loader-types.js.map +1 -0
  67. package/dist/mvt/arrow-table-tile-source-loader.cjs +6343 -0
  68. package/dist/mvt/arrow-table-tile-source-loader.cjs.map +6 -0
  69. package/dist/mvt/arrow-table-tile-source-loader.d.ts +69 -0
  70. package/dist/mvt/arrow-table-tile-source-loader.d.ts.map +1 -0
  71. package/dist/mvt/arrow-table-tile-source-loader.js +216 -0
  72. package/dist/mvt/arrow-table-tile-source-loader.js.map +1 -0
  73. package/dist/mvt/arrow-table-tile-source-types.d.ts +21 -0
  74. package/dist/mvt/arrow-table-tile-source-types.d.ts.map +1 -0
  75. package/dist/mvt/arrow-table-tile-source-types.js +6 -0
  76. package/dist/mvt/arrow-table-tile-source-types.js.map +1 -0
  77. package/dist/mvt/bundled.d.ts +6 -0
  78. package/dist/mvt/bundled.d.ts.map +1 -0
  79. package/dist/mvt/bundled.js +7 -0
  80. package/dist/mvt/bundled.js.map +1 -0
  81. package/dist/mvt/dist.dev.js +46689 -0
  82. package/dist/mvt/dist.min.js +94 -0
  83. package/dist/mvt/index.cjs +10095 -0
  84. package/dist/mvt/index.cjs.map +6 -0
  85. package/dist/mvt/index.d.ts +28 -0
  86. package/dist/mvt/index.d.ts.map +1 -0
  87. package/dist/mvt/index.js +27 -0
  88. package/dist/mvt/index.js.map +1 -0
  89. package/dist/mvt/lib/encode-mvt-arrow.d.ts +6 -0
  90. package/dist/mvt/lib/encode-mvt-arrow.d.ts.map +1 -0
  91. package/dist/mvt/lib/encode-mvt-arrow.js +225 -0
  92. package/dist/mvt/lib/encode-mvt-arrow.js.map +1 -0
  93. package/dist/mvt/lib/encode-mvt.d.ts +30 -0
  94. package/dist/mvt/lib/encode-mvt.d.ts.map +1 -0
  95. package/dist/mvt/lib/encode-mvt.js +20 -0
  96. package/dist/mvt/lib/encode-mvt.js.map +1 -0
  97. package/dist/mvt/lib/get-schemas-from-tilejson.d.ts +4 -0
  98. package/dist/mvt/lib/get-schemas-from-tilejson.d.ts.map +1 -0
  99. package/dist/mvt/lib/get-schemas-from-tilejson.js +56 -0
  100. package/dist/mvt/lib/get-schemas-from-tilejson.js.map +1 -0
  101. package/dist/mvt/lib/is-longitude-latitude-crs.d.ts +3 -0
  102. package/dist/mvt/lib/is-longitude-latitude-crs.d.ts.map +1 -0
  103. package/dist/mvt/lib/is-longitude-latitude-crs.js +13 -0
  104. package/dist/mvt/lib/is-longitude-latitude-crs.js.map +1 -0
  105. package/dist/mvt/lib/mapbox-vt-pbf/geojson-wrapper.d.ts +25 -0
  106. package/dist/mvt/lib/mapbox-vt-pbf/geojson-wrapper.d.ts.map +1 -0
  107. package/dist/mvt/lib/mapbox-vt-pbf/geojson-wrapper.js +73 -0
  108. package/dist/mvt/lib/mapbox-vt-pbf/geojson-wrapper.js.map +1 -0
  109. package/dist/mvt/lib/mapbox-vt-pbf/to-vector-tile.d.ts +52 -0
  110. package/dist/mvt/lib/mapbox-vt-pbf/to-vector-tile.d.ts.map +1 -0
  111. package/dist/mvt/lib/mapbox-vt-pbf/to-vector-tile.js +165 -0
  112. package/dist/mvt/lib/mapbox-vt-pbf/to-vector-tile.js.map +1 -0
  113. package/dist/mvt/lib/mvt-pbf/mvt-constants.d.ts +116 -0
  114. package/dist/mvt/lib/mvt-pbf/mvt-constants.d.ts.map +1 -0
  115. package/dist/mvt/lib/mvt-pbf/mvt-constants.js +127 -0
  116. package/dist/mvt/lib/mvt-pbf/mvt-constants.js.map +1 -0
  117. package/dist/mvt/lib/mvt-pbf/mvt-types.d.ts +17 -0
  118. package/dist/mvt/lib/mvt-pbf/mvt-types.d.ts.map +1 -0
  119. package/dist/mvt/lib/mvt-pbf/mvt-types.js +5 -0
  120. package/dist/mvt/lib/mvt-pbf/mvt-types.js.map +1 -0
  121. package/dist/mvt/lib/mvt-pbf/parse-geometry-from-pbf.d.ts +77 -0
  122. package/dist/mvt/lib/mvt-pbf/parse-geometry-from-pbf.d.ts.map +1 -0
  123. package/dist/mvt/lib/mvt-pbf/parse-geometry-from-pbf.js +235 -0
  124. package/dist/mvt/lib/mvt-pbf/parse-geometry-from-pbf.js.map +1 -0
  125. package/dist/mvt/lib/mvt-pbf/parse-mvt-from-pbf.d.ts +25 -0
  126. package/dist/mvt/lib/mvt-pbf/parse-mvt-from-pbf.d.ts.map +1 -0
  127. package/dist/mvt/lib/mvt-pbf/parse-mvt-from-pbf.js +263 -0
  128. package/dist/mvt/lib/mvt-pbf/parse-mvt-from-pbf.js.map +1 -0
  129. package/dist/mvt/lib/mvt-pbf/write-mvt-to-pbf.d.ts +4 -0
  130. package/dist/mvt/lib/mvt-pbf/write-mvt-to-pbf.d.ts.map +1 -0
  131. package/dist/mvt/lib/mvt-pbf/write-mvt-to-pbf.js +134 -0
  132. package/dist/mvt/lib/mvt-pbf/write-mvt-to-pbf.js.map +1 -0
  133. package/dist/mvt/lib/mvt-worker-transport.d.ts +15 -0
  134. package/dist/mvt/lib/mvt-worker-transport.d.ts.map +1 -0
  135. package/dist/mvt/lib/mvt-worker-transport.js +54 -0
  136. package/dist/mvt/lib/mvt-worker-transport.js.map +1 -0
  137. package/dist/mvt/lib/parse-mvt-geojson.d.ts +6 -0
  138. package/dist/mvt/lib/parse-mvt-geojson.d.ts.map +1 -0
  139. package/dist/mvt/lib/parse-mvt-geojson.js +48 -0
  140. package/dist/mvt/lib/parse-mvt-geojson.js.map +1 -0
  141. package/dist/mvt/lib/parse-mvt.d.ts +14 -0
  142. package/dist/mvt/lib/parse-mvt.d.ts.map +1 -0
  143. package/dist/mvt/lib/parse-mvt.js +105 -0
  144. package/dist/mvt/lib/parse-mvt.js.map +1 -0
  145. package/dist/mvt/lib/parse-tilejson.d.ts +74 -0
  146. package/dist/mvt/lib/parse-tilejson.d.ts.map +1 -0
  147. package/dist/mvt/lib/parse-tilejson.js +267 -0
  148. package/dist/mvt/lib/parse-tilejson.js.map +1 -0
  149. package/dist/mvt/lib/resolve-table-tile-parameters.d.ts +4 -0
  150. package/dist/mvt/lib/resolve-table-tile-parameters.d.ts.map +1 -0
  151. package/dist/mvt/lib/resolve-table-tile-parameters.js +16 -0
  152. package/dist/mvt/lib/resolve-table-tile-parameters.js.map +1 -0
  153. package/dist/mvt/lib/types.d.ts +88 -0
  154. package/dist/mvt/lib/types.d.ts.map +1 -0
  155. package/dist/mvt/lib/types.js.map +1 -0
  156. package/dist/mvt/lib/utils/geometry-utils.d.ts +83 -0
  157. package/dist/mvt/lib/utils/geometry-utils.d.ts.map +1 -0
  158. package/dist/mvt/lib/utils/geometry-utils.js +211 -0
  159. package/dist/mvt/lib/utils/geometry-utils.js.map +1 -0
  160. package/dist/mvt/lib/vector-tile/vector-tile-feature.d.ts +72 -0
  161. package/dist/mvt/lib/vector-tile/vector-tile-feature.d.ts.map +1 -0
  162. package/dist/mvt/lib/vector-tile/vector-tile-feature.js +350 -0
  163. package/dist/mvt/lib/vector-tile/vector-tile-feature.js.map +1 -0
  164. package/dist/mvt/lib/vector-tile/vector-tile-layer.d.ts +29 -0
  165. package/dist/mvt/lib/vector-tile/vector-tile-layer.d.ts.map +1 -0
  166. package/dist/mvt/lib/vector-tile/vector-tile-layer.js +108 -0
  167. package/dist/mvt/lib/vector-tile/vector-tile-layer.js.map +1 -0
  168. package/dist/mvt/lib/vector-tile/vector-tile.d.ts +9 -0
  169. package/dist/mvt/lib/vector-tile/vector-tile.d.ts.map +1 -0
  170. package/dist/mvt/lib/vector-tile/vector-tile.js +28 -0
  171. package/dist/mvt/lib/vector-tile/vector-tile.js.map +1 -0
  172. package/dist/mvt/lib/vector-tiler/arrow-tile.d.ts +6 -0
  173. package/dist/mvt/lib/vector-tiler/arrow-tile.d.ts.map +1 -0
  174. package/dist/mvt/lib/vector-tiler/arrow-tile.js +84 -0
  175. package/dist/mvt/lib/vector-tiler/arrow-tile.js.map +1 -0
  176. package/dist/mvt/lib/vector-tiler/features/clip-features.d.ts +16 -0
  177. package/dist/mvt/lib/vector-tiler/features/clip-features.d.ts.map +1 -0
  178. package/dist/mvt/lib/vector-tiler/features/clip-features.js +211 -0
  179. package/dist/mvt/lib/vector-tiler/features/clip-features.js.map +1 -0
  180. package/dist/mvt/lib/vector-tiler/features/convert-feature.d.ts +18 -0
  181. package/dist/mvt/lib/vector-tiler/features/convert-feature.d.ts.map +1 -0
  182. package/dist/mvt/lib/vector-tiler/features/convert-feature.js +161 -0
  183. package/dist/mvt/lib/vector-tiler/features/convert-feature.js.map +1 -0
  184. package/dist/mvt/lib/vector-tiler/features/proto-feature.d.ts +30 -0
  185. package/dist/mvt/lib/vector-tiler/features/proto-feature.d.ts.map +1 -0
  186. package/dist/mvt/lib/vector-tiler/features/proto-feature.js +53 -0
  187. package/dist/mvt/lib/vector-tiler/features/proto-feature.js.map +1 -0
  188. package/dist/mvt/lib/vector-tiler/features/simplify-path.d.ts +10 -0
  189. package/dist/mvt/lib/vector-tiler/features/simplify-path.d.ts.map +1 -0
  190. package/dist/mvt/lib/vector-tiler/features/simplify-path.js +67 -0
  191. package/dist/mvt/lib/vector-tiler/features/simplify-path.js.map +1 -0
  192. package/dist/mvt/lib/vector-tiler/features/wrap-features.d.ts +17 -0
  193. package/dist/mvt/lib/vector-tiler/features/wrap-features.d.ts.map +1 -0
  194. package/dist/mvt/lib/vector-tiler/features/wrap-features.js +95 -0
  195. package/dist/mvt/lib/vector-tiler/features/wrap-features.js.map +1 -0
  196. package/dist/mvt/lib/vector-tiler/proto-tile.d.ts +40 -0
  197. package/dist/mvt/lib/vector-tiler/proto-tile.d.ts.map +1 -0
  198. package/dist/mvt/lib/vector-tiler/proto-tile.js +139 -0
  199. package/dist/mvt/lib/vector-tiler/proto-tile.js.map +1 -0
  200. package/dist/mvt/lib/vector-tiler/tile-to-geojson.d.ts +12 -0
  201. package/dist/mvt/lib/vector-tiler/tile-to-geojson.d.ts.map +1 -0
  202. package/dist/mvt/lib/vector-tiler/tile-to-geojson.js +81 -0
  203. package/dist/mvt/lib/vector-tiler/tile-to-geojson.js.map +1 -0
  204. package/dist/mvt/lib/vector-tiler/transform-tile.d.ts +7 -0
  205. package/dist/mvt/lib/vector-tiler/transform-tile.d.ts.map +1 -0
  206. package/dist/mvt/lib/vector-tiler/transform-tile.js +42 -0
  207. package/dist/mvt/lib/vector-tiler/transform-tile.js.map +1 -0
  208. package/dist/mvt/map-style-format.d.ts +13 -0
  209. package/dist/mvt/map-style-format.d.ts.map +1 -0
  210. package/dist/mvt/map-style-format.js +16 -0
  211. package/dist/mvt/map-style-format.js.map +1 -0
  212. package/dist/mvt/map-style-loader-with-parser.d.ts +26 -0
  213. package/dist/mvt/map-style-loader-with-parser.d.ts.map +1 -0
  214. package/dist/mvt/map-style-loader-with-parser.js +38 -0
  215. package/dist/mvt/map-style-loader-with-parser.js.map +1 -0
  216. package/dist/mvt/map-style-loader.d.ts +44 -0
  217. package/dist/mvt/map-style-loader.d.ts.map +1 -0
  218. package/dist/mvt/map-style-loader.js +25 -0
  219. package/dist/mvt/map-style-loader.js.map +1 -0
  220. package/dist/mvt/map-style-schema.d.ts +58 -0
  221. package/dist/mvt/map-style-schema.d.ts.map +1 -0
  222. package/dist/mvt/map-style-schema.js +47 -0
  223. package/dist/mvt/map-style-schema.js.map +1 -0
  224. package/dist/mvt/map-style.d.ts +110 -0
  225. package/dist/mvt/map-style.d.ts.map +1 -0
  226. package/dist/mvt/map-style.js +90 -0
  227. package/dist/mvt/map-style.js.map +1 -0
  228. package/dist/mvt/mvt-format.d.ts +14 -0
  229. package/dist/mvt/mvt-format.d.ts.map +1 -0
  230. package/dist/mvt/mvt-format.js +23 -0
  231. package/dist/mvt/mvt-format.js.map +1 -0
  232. package/dist/mvt/mvt-geojson-loader-types.d.ts +82 -0
  233. package/dist/mvt/mvt-geojson-loader-types.d.ts.map +1 -0
  234. package/dist/mvt/mvt-geojson-loader-types.js +34 -0
  235. package/dist/mvt/mvt-geojson-loader-types.js.map +1 -0
  236. package/dist/mvt/mvt-geojson-loader.cjs +1366 -0
  237. package/dist/mvt/mvt-geojson-loader.cjs.map +6 -0
  238. package/dist/mvt/mvt-geojson-loader.d.ts +32 -0
  239. package/dist/mvt/mvt-geojson-loader.d.ts.map +1 -0
  240. package/dist/mvt/mvt-geojson-loader.js +13 -0
  241. package/dist/mvt/mvt-geojson-loader.js.map +1 -0
  242. package/dist/mvt/mvt-loader-with-parser.d.ts +105 -0
  243. package/dist/mvt/mvt-loader-with-parser.d.ts.map +1 -0
  244. package/dist/mvt/mvt-loader-with-parser.js +21 -0
  245. package/dist/mvt/mvt-loader-with-parser.js.map +1 -0
  246. package/dist/mvt/mvt-loader.d.ts +129 -0
  247. package/dist/mvt/mvt-loader.d.ts.map +1 -0
  248. package/dist/mvt/mvt-loader.js +40 -0
  249. package/dist/mvt/mvt-loader.js.map +1 -0
  250. package/dist/mvt/mvt-source-loader.d.ts +102 -0
  251. package/dist/mvt/mvt-source-loader.d.ts.map +1 -0
  252. package/dist/mvt/mvt-source-loader.js +275 -0
  253. package/dist/mvt/mvt-source-loader.js.map +1 -0
  254. package/dist/mvt/mvt-writer.d.ts +28 -0
  255. package/dist/mvt/mvt-writer.d.ts.map +1 -0
  256. package/dist/mvt/mvt-writer.js +32 -0
  257. package/dist/mvt/mvt-writer.js.map +1 -0
  258. package/dist/mvt/table-tile-source-loader.d.ts +169 -0
  259. package/dist/mvt/table-tile-source-loader.d.ts.map +1 -0
  260. package/dist/mvt/table-tile-source-loader.js +478 -0
  261. package/dist/mvt/table-tile-source-loader.js.map +1 -0
  262. package/dist/mvt/tilejson-format.d.ts +13 -0
  263. package/dist/mvt/tilejson-format.d.ts.map +1 -0
  264. package/dist/mvt/tilejson-format.js +16 -0
  265. package/dist/mvt/tilejson-format.js.map +1 -0
  266. package/dist/mvt/tilejson-loader-with-parser.d.ts +13 -0
  267. package/dist/mvt/tilejson-loader-with-parser.d.ts.map +1 -0
  268. package/dist/mvt/tilejson-loader-with-parser.js +25 -0
  269. package/dist/mvt/tilejson-loader-with-parser.js.map +1 -0
  270. package/dist/mvt/tilejson-loader.d.ts +56 -0
  271. package/dist/mvt/tilejson-loader.d.ts.map +1 -0
  272. package/dist/mvt/tilejson-loader.js +28 -0
  273. package/dist/mvt/tilejson-loader.js.map +1 -0
  274. package/dist/mvt/tilejson-zod-schema.cjs +79 -0
  275. package/dist/mvt/tilejson-zod-schema.cjs.map +6 -0
  276. package/dist/mvt/tilejson-zod-schema.d.ts +218 -0
  277. package/dist/mvt/tilejson-zod-schema.d.ts.map +1 -0
  278. package/dist/mvt/tilejson-zod-schema.js +68 -0
  279. package/dist/mvt/tilejson-zod-schema.js.map +1 -0
  280. package/dist/mvt/tilejson.schema.json +197 -0
  281. package/dist/mvt/unbundled.d.ts +8 -0
  282. package/dist/mvt/unbundled.d.ts.map +1 -0
  283. package/dist/mvt/unbundled.js +8 -0
  284. package/dist/mvt/unbundled.js.map +1 -0
  285. package/dist/mvt/workers/mvt-worker-node.d.ts +2 -0
  286. package/dist/mvt/workers/mvt-worker-node.d.ts.map +1 -0
  287. package/dist/mvt/workers/mvt-worker-node.js +8 -0
  288. package/dist/mvt/workers/mvt-worker-node.js.map +1 -0
  289. package/dist/mvt/workers/mvt-worker.d.ts +2 -0
  290. package/dist/mvt/workers/mvt-worker.d.ts.map +1 -0
  291. package/dist/mvt/workers/mvt-worker.js +7 -0
  292. package/dist/mvt/workers/mvt-worker.js.map +1 -0
  293. package/dist/mvt-worker-node.js +72460 -0
  294. package/dist/mvt-worker-node.js.map +7 -0
  295. package/dist/mvt-worker.js +21239 -0
  296. package/dist/pmtiles/bundled.d.ts +3 -0
  297. package/dist/pmtiles/bundled.d.ts.map +1 -0
  298. package/dist/pmtiles/bundled.js +5 -0
  299. package/dist/pmtiles/bundled.js.map +1 -0
  300. package/dist/pmtiles/dist.dev.js +50530 -0
  301. package/dist/pmtiles/dist.min.js +94 -0
  302. package/dist/pmtiles/geoarrow.cjs +6718 -0
  303. package/dist/pmtiles/geoarrow.cjs.map +6 -0
  304. package/dist/pmtiles/geoarrow.d.ts +30 -0
  305. package/dist/pmtiles/geoarrow.d.ts.map +1 -0
  306. package/dist/pmtiles/geoarrow.js +143 -0
  307. package/dist/pmtiles/geoarrow.js.map +1 -0
  308. package/dist/pmtiles/index.cjs +8011 -0
  309. package/dist/pmtiles/index.cjs.map +6 -0
  310. package/dist/pmtiles/index.d.ts +14 -0
  311. package/dist/pmtiles/index.d.ts.map +1 -0
  312. package/dist/pmtiles/index.js +10 -0
  313. package/dist/pmtiles/index.js.map +1 -0
  314. package/dist/pmtiles/lib/blob-source.d.ts +14 -0
  315. package/dist/pmtiles/lib/blob-source.d.ts.map +1 -0
  316. package/dist/pmtiles/lib/blob-source.js +32 -0
  317. package/dist/pmtiles/lib/blob-source.js.map +1 -0
  318. package/dist/pmtiles/lib/encode-pmtiles.d.ts +8 -0
  319. package/dist/pmtiles/lib/encode-pmtiles.d.ts.map +1 -0
  320. package/dist/pmtiles/lib/encode-pmtiles.js +268 -0
  321. package/dist/pmtiles/lib/encode-pmtiles.js.map +1 -0
  322. package/dist/pmtiles/lib/parse-pmtiles.d.ts +52 -0
  323. package/dist/pmtiles/lib/parse-pmtiles.d.ts.map +1 -0
  324. package/dist/pmtiles/lib/parse-pmtiles.js +95 -0
  325. package/dist/pmtiles/lib/parse-pmtiles.js.map +1 -0
  326. package/dist/pmtiles/lib/range-request-source.d.ts +24 -0
  327. package/dist/pmtiles/lib/range-request-source.d.ts.map +1 -0
  328. package/dist/pmtiles/lib/range-request-source.js +45 -0
  329. package/dist/pmtiles/lib/range-request-source.js.map +1 -0
  330. package/dist/pmtiles/lib/version.d.ts +2 -0
  331. package/dist/pmtiles/lib/version.d.ts.map +1 -0
  332. package/dist/pmtiles/lib/version.js +8 -0
  333. package/dist/pmtiles/lib/version.js.map +1 -0
  334. package/dist/pmtiles/pmtiles-format.d.ts +14 -0
  335. package/dist/pmtiles/pmtiles-format.d.ts.map +1 -0
  336. package/dist/pmtiles/pmtiles-format.js +17 -0
  337. package/dist/pmtiles/pmtiles-format.js.map +1 -0
  338. package/dist/pmtiles/pmtiles-loader-with-parser.d.ts +30 -0
  339. package/dist/pmtiles/pmtiles-loader-with-parser.d.ts.map +1 -0
  340. package/dist/pmtiles/pmtiles-loader-with-parser.js +41 -0
  341. package/dist/pmtiles/pmtiles-loader-with-parser.js.map +1 -0
  342. package/dist/pmtiles/pmtiles-loader.d.ts +41 -0
  343. package/dist/pmtiles/pmtiles-loader.d.ts.map +1 -0
  344. package/dist/pmtiles/pmtiles-loader.js +20 -0
  345. package/dist/pmtiles/pmtiles-loader.js.map +1 -0
  346. package/dist/pmtiles/pmtiles-source-loader.d.ts +85 -0
  347. package/dist/pmtiles/pmtiles-source-loader.d.ts.map +1 -0
  348. package/dist/pmtiles/pmtiles-source-loader.js +239 -0
  349. package/dist/pmtiles/pmtiles-source-loader.js.map +1 -0
  350. package/dist/pmtiles/pmtiles-writer-types.d.ts +39 -0
  351. package/dist/pmtiles/pmtiles-writer-types.d.ts.map +1 -0
  352. package/dist/pmtiles/pmtiles-writer-types.js +5 -0
  353. package/dist/pmtiles/pmtiles-writer-types.js.map +1 -0
  354. package/dist/pmtiles/pmtiles-writer.d.ts +22 -0
  355. package/dist/pmtiles/pmtiles-writer.d.ts.map +1 -0
  356. package/dist/pmtiles/pmtiles-writer.js +15 -0
  357. package/dist/pmtiles/pmtiles-writer.js.map +1 -0
  358. package/dist/pmtiles/raster.cjs +1183 -0
  359. package/dist/pmtiles/raster.cjs.map +6 -0
  360. package/dist/pmtiles/raster.d.ts +30 -0
  361. package/dist/pmtiles/raster.d.ts.map +1 -0
  362. package/dist/pmtiles/raster.js +212 -0
  363. package/dist/pmtiles/raster.js.map +1 -0
  364. package/dist/pmtiles/source-info.d.ts +25 -0
  365. package/dist/pmtiles/source-info.d.ts.map +1 -0
  366. package/dist/{types.js → pmtiles/source-info.js} +1 -1
  367. package/dist/pmtiles/source-info.js.map +1 -0
  368. package/dist/pmtiles/unbundled.d.ts +3 -0
  369. package/dist/pmtiles/unbundled.d.ts.map +1 -0
  370. package/dist/pmtiles/unbundled.js +5 -0
  371. package/dist/pmtiles/unbundled.js.map +1 -0
  372. package/dist/raster-set.d.ts +1 -1
  373. package/dist/raster-set.d.ts.map +1 -1
  374. package/dist/raster-set.js +1 -1
  375. package/dist/raster-set.js.map +1 -1
  376. package/dist/tile-matrix.cjs +81 -0
  377. package/dist/tile-matrix.cjs.map +6 -0
  378. package/dist/tile-matrix.d.ts +52 -0
  379. package/dist/tile-matrix.d.ts.map +1 -0
  380. package/dist/tile-matrix.js +75 -0
  381. package/dist/tile-matrix.js.map +1 -0
  382. package/dist/tileset-2d/tile-2d-header.d.ts +2 -2
  383. package/dist/tileset-2d/tile-2d-header.d.ts.map +1 -1
  384. package/dist/tileset-2d/tile-2d-header.js +11 -11
  385. package/dist/tileset-2d/tile-2d-header.js.map +1 -1
  386. package/dist/tileset-2d/tileset-2d.d.ts +19 -10
  387. package/dist/tileset-2d/tileset-2d.d.ts.map +1 -1
  388. package/dist/tileset-2d/tileset-2d.js +69 -15
  389. package/dist/tileset-2d/tileset-2d.js.map +1 -1
  390. package/dist/tileset-2d.d.ts +2 -1
  391. package/dist/tileset-2d.d.ts.map +1 -1
  392. package/dist/tileset-2d.js +1 -1
  393. package/dist/tileset-2d.js.map +1 -1
  394. package/package.json +104 -16
  395. package/src/image-set.ts +1 -1
  396. package/src/index.ts +9 -123
  397. package/src/mlt/bundled.ts +9 -0
  398. package/src/mlt/index.ts +18 -0
  399. package/src/mlt/lib/encode-mlt-geometry.ts +162 -0
  400. package/src/mlt/lib/encode-mlt-streams.ts +66 -0
  401. package/src/mlt/lib/encode-mlt.ts +215 -0
  402. package/src/mlt/lib/parse-mlt.ts +906 -0
  403. package/src/mlt/libs/mlt-decoder.cjs +4552 -0
  404. package/src/mlt/mlt-format.ts +19 -0
  405. package/src/mlt/mlt-loader-with-parser.ts +57 -0
  406. package/src/mlt/mlt-loader.ts +64 -0
  407. package/src/mlt/mlt-source-loader.ts +266 -0
  408. package/src/mlt/mlt-writer.ts +47 -0
  409. package/src/mlt/unbundled.ts +6 -0
  410. package/src/mvt/arrow-table-tile-source-loader-types.ts +55 -0
  411. package/src/mvt/arrow-table-tile-source-loader.ts +307 -0
  412. package/src/mvt/arrow-table-tile-source-types.ts +32 -0
  413. package/src/mvt/bundled.ts +14 -0
  414. package/src/mvt/index.ts +67 -0
  415. package/src/mvt/lib/encode-mvt-arrow.ts +273 -0
  416. package/src/mvt/lib/encode-mvt.ts +46 -0
  417. package/src/mvt/lib/get-schemas-from-tilejson.ts +64 -0
  418. package/src/mvt/lib/is-longitude-latitude-crs.ts +15 -0
  419. package/src/mvt/lib/mapbox-vt-pbf/geojson-to-vt.ts.disabled +76 -0
  420. package/src/mvt/lib/mapbox-vt-pbf/geojson-wrapper.ts +89 -0
  421. package/src/mvt/lib/mapbox-vt-pbf/to-vector-tile.ts +230 -0
  422. package/src/mvt/lib/mvt-pbf/mvt-constants.ts +135 -0
  423. package/src/mvt/lib/mvt-pbf/mvt-types.ts +22 -0
  424. package/src/mvt/lib/mvt-pbf/parse-geometry-from-pbf.ts +285 -0
  425. package/src/mvt/lib/mvt-pbf/parse-mvt-from-pbf.ts +310 -0
  426. package/src/mvt/lib/mvt-pbf/write-mvt-to-pbf.ts +162 -0
  427. package/src/mvt/lib/mvt-worker-transport.ts +74 -0
  428. package/src/mvt/lib/parse-mvt-geojson.ts +65 -0
  429. package/src/mvt/lib/parse-mvt.ts +145 -0
  430. package/src/mvt/lib/parse-tilejson.ts +397 -0
  431. package/src/mvt/lib/resolve-table-tile-parameters.ts +23 -0
  432. package/src/mvt/lib/types.ts +90 -0
  433. package/src/mvt/lib/utils/geometry-utils.ts +238 -0
  434. package/src/mvt/lib/vector-tile/LICENSE.txt +31 -0
  435. package/src/mvt/lib/vector-tile/vector-tile-feature.ts +430 -0
  436. package/src/mvt/lib/vector-tile/vector-tile-layer.ts +130 -0
  437. package/src/mvt/lib/vector-tile/vector-tile.ts +32 -0
  438. package/src/mvt/lib/vector-tiler/LICENSE +19 -0
  439. package/src/mvt/lib/vector-tiler/arrow-tile.ts +93 -0
  440. package/src/mvt/lib/vector-tiler/features/clip-features.ts +250 -0
  441. package/src/mvt/lib/vector-tiler/features/convert-feature.ts +213 -0
  442. package/src/mvt/lib/vector-tiler/features/proto-feature.ts +104 -0
  443. package/src/mvt/lib/vector-tiler/features/simplify-path.ts +84 -0
  444. package/src/mvt/lib/vector-tiler/features/wrap-features.ts +125 -0
  445. package/src/mvt/lib/vector-tiler/proto-tile.ts +217 -0
  446. package/src/mvt/lib/vector-tiler/tile-to-geojson.ts +104 -0
  447. package/src/mvt/lib/vector-tiler/transform-tile.ts +57 -0
  448. package/src/mvt/map-style-format.ts +18 -0
  449. package/src/mvt/map-style-loader-with-parser.ts +62 -0
  450. package/src/mvt/map-style-loader.ts +31 -0
  451. package/src/mvt/map-style-schema.ts +53 -0
  452. package/src/mvt/map-style.ts +218 -0
  453. package/src/mvt/mvt-format.ts +25 -0
  454. package/src/mvt/mvt-geojson-loader-types.ts +60 -0
  455. package/src/mvt/mvt-geojson-loader.ts +20 -0
  456. package/src/mvt/mvt-loader-with-parser.ts +53 -0
  457. package/src/mvt/mvt-loader.ts +73 -0
  458. package/src/mvt/mvt-source-loader.ts +410 -0
  459. package/src/mvt/mvt-writer.ts +35 -0
  460. package/src/mvt/table-tile-source-loader.ts +672 -0
  461. package/src/mvt/tilejson-format.ts +18 -0
  462. package/src/mvt/tilejson-loader-with-parser.ts +38 -0
  463. package/src/mvt/tilejson-loader.ts +42 -0
  464. package/src/mvt/tilejson-zod-schema.ts +199 -0
  465. package/src/mvt/unbundled.ts +13 -0
  466. package/src/mvt/workers/mvt-worker-node.ts +9 -0
  467. package/src/mvt/workers/mvt-worker.ts +8 -0
  468. package/src/pmtiles/bundled.ts +6 -0
  469. package/src/pmtiles/geoarrow.ts +188 -0
  470. package/src/pmtiles/index.ts +27 -0
  471. package/src/pmtiles/lib/blob-source.ts +41 -0
  472. package/src/pmtiles/lib/encode-pmtiles.ts +322 -0
  473. package/src/pmtiles/lib/parse-pmtiles.ts +180 -0
  474. package/src/pmtiles/lib/range-request-source.ts +60 -0
  475. package/src/pmtiles/lib/version.ts +8 -0
  476. package/src/pmtiles/pmtiles-format.ts +19 -0
  477. package/src/pmtiles/pmtiles-loader-with-parser.ts +60 -0
  478. package/src/pmtiles/pmtiles-loader.ts +30 -0
  479. package/src/pmtiles/pmtiles-source-loader.ts +346 -0
  480. package/src/pmtiles/pmtiles-writer-types.ts +45 -0
  481. package/src/pmtiles/pmtiles-writer.ts +26 -0
  482. package/src/pmtiles/raster.ts +289 -0
  483. package/src/pmtiles/source-info.ts +25 -0
  484. package/src/pmtiles/unbundled.ts +6 -0
  485. package/src/raster-set.ts +2 -2
  486. package/src/tile-matrix.ts +138 -0
  487. package/src/tileset-2d/tile-2d-header.ts +14 -13
  488. package/src/tileset-2d/tileset-2d.ts +81 -19
  489. package/src/tileset-2d.ts +25 -1
  490. package/dist/constants.d.ts +0 -38
  491. package/dist/constants.d.ts.map +0 -1
  492. package/dist/constants.js +0 -39
  493. package/dist/constants.js.map +0 -1
  494. package/dist/point-cloud/point-cloud-tile.d.ts +0 -47
  495. package/dist/point-cloud/point-cloud-tile.d.ts.map +0 -1
  496. package/dist/point-cloud/point-cloud-tile.js +0 -70
  497. package/dist/point-cloud/point-cloud-tile.js.map +0 -1
  498. package/dist/point-cloud/point-cloud-tileset.d.ts +0 -135
  499. package/dist/point-cloud/point-cloud-tileset.d.ts.map +0 -1
  500. package/dist/point-cloud/point-cloud-tileset.js +0 -549
  501. package/dist/point-cloud/point-cloud-tileset.js.map +0 -1
  502. package/dist/point-cloud/types.d.ts +0 -81
  503. package/dist/point-cloud/types.d.ts.map +0 -1
  504. package/dist/point-cloud/types.js.map +0 -1
  505. package/dist/spatial/format-spatial-reference.d.ts +0 -68
  506. package/dist/spatial/format-spatial-reference.d.ts.map +0 -1
  507. package/dist/spatial/format-spatial-reference.js +0 -291
  508. package/dist/spatial/format-spatial-reference.js.map +0 -1
  509. package/dist/spatial/get-spatial-coordinate-frame.d.ts +0 -20
  510. package/dist/spatial/get-spatial-coordinate-frame.d.ts.map +0 -1
  511. package/dist/spatial/get-spatial-coordinate-frame.js +0 -139
  512. package/dist/spatial/get-spatial-coordinate-frame.js.map +0 -1
  513. package/dist/spatial/i3s-elevation.d.ts +0 -20
  514. package/dist/spatial/i3s-elevation.d.ts.map +0 -1
  515. package/dist/spatial/i3s-elevation.js +0 -90
  516. package/dist/spatial/i3s-elevation.js.map +0 -1
  517. package/dist/spatial/i3s-spatial-transformer.d.ts +0 -205
  518. package/dist/spatial/i3s-spatial-transformer.d.ts.map +0 -1
  519. package/dist/spatial/i3s-spatial-transformer.js +0 -731
  520. package/dist/spatial/i3s-spatial-transformer.js.map +0 -1
  521. package/dist/spatial/normalize-crs-identifier.d.ts +0 -15
  522. package/dist/spatial/normalize-crs-identifier.d.ts.map +0 -1
  523. package/dist/spatial/normalize-crs-identifier.js +0 -22
  524. package/dist/spatial/normalize-crs-identifier.js.map +0 -1
  525. package/dist/spatial/spatial-coordinate-transformer.d.ts +0 -52
  526. package/dist/spatial/spatial-coordinate-transformer.d.ts.map +0 -1
  527. package/dist/spatial/spatial-coordinate-transformer.js +0 -295
  528. package/dist/spatial/spatial-coordinate-transformer.js.map +0 -1
  529. package/dist/spatial/spatial-resource-registry.d.ts +0 -47
  530. package/dist/spatial/spatial-resource-registry.d.ts.map +0 -1
  531. package/dist/spatial/spatial-resource-registry.js +0 -76
  532. package/dist/spatial/spatial-resource-registry.js.map +0 -1
  533. package/dist/spatial/spatial-types.d.ts +0 -190
  534. package/dist/spatial/spatial-types.d.ts.map +0 -1
  535. package/dist/spatial/spatial-types.js +0 -192
  536. package/dist/spatial/spatial-types.js.map +0 -1
  537. package/dist/spatial/tiles-3d-spatial-transformer.d.ts +0 -32
  538. package/dist/spatial/tiles-3d-spatial-transformer.d.ts.map +0 -1
  539. package/dist/spatial/tiles-3d-spatial-transformer.js +0 -163
  540. package/dist/spatial/tiles-3d-spatial-transformer.js.map +0 -1
  541. package/dist/tileset-3d/common/indexed-archive-tileset-source.d.ts +0 -60
  542. package/dist/tileset-3d/common/indexed-archive-tileset-source.d.ts.map +0 -1
  543. package/dist/tileset-3d/common/indexed-archive-tileset-source.js +0 -130
  544. package/dist/tileset-3d/common/indexed-archive-tileset-source.js.map +0 -1
  545. package/dist/tileset-3d/common/tile-3d-contracts.d.ts +0 -63
  546. package/dist/tileset-3d/common/tile-3d-contracts.d.ts.map +0 -1
  547. package/dist/tileset-3d/common/tile-3d-contracts.js +0 -51
  548. package/dist/tileset-3d/common/tile-3d-contracts.js.map +0 -1
  549. package/dist/tileset-3d/common/tile-3d.d.ts +0 -410
  550. package/dist/tileset-3d/common/tile-3d.d.ts.map +0 -1
  551. package/dist/tileset-3d/common/tile-3d.js +0 -1056
  552. package/dist/tileset-3d/common/tile-3d.js.map +0 -1
  553. package/dist/tileset-3d/common/tileset-3d.d.ts +0 -367
  554. package/dist/tileset-3d/common/tileset-3d.d.ts.map +0 -1
  555. package/dist/tileset-3d/common/tileset-3d.js +0 -879
  556. package/dist/tileset-3d/common/tileset-3d.js.map +0 -1
  557. package/dist/tileset-3d/common/tileset-cache.d.ts +0 -29
  558. package/dist/tileset-3d/common/tileset-cache.d.ts.map +0 -1
  559. package/dist/tileset-3d/common/tileset-cache.js +0 -82
  560. package/dist/tileset-3d/common/tileset-cache.js.map +0 -1
  561. package/dist/tileset-3d/common/tileset-content-traversal.d.ts +0 -37
  562. package/dist/tileset-3d/common/tileset-content-traversal.d.ts.map +0 -1
  563. package/dist/tileset-3d/common/tileset-content-traversal.js +0 -80
  564. package/dist/tileset-3d/common/tileset-content-traversal.js.map +0 -1
  565. package/dist/tileset-3d/common/tileset-observability.d.ts +0 -60
  566. package/dist/tileset-3d/common/tileset-observability.d.ts.map +0 -1
  567. package/dist/tileset-3d/common/tileset-observability.js +0 -39
  568. package/dist/tileset-3d/common/tileset-observability.js.map +0 -1
  569. package/dist/tileset-3d/common/tileset-source.d.ts +0 -228
  570. package/dist/tileset-3d/common/tileset-source.d.ts.map +0 -1
  571. package/dist/tileset-3d/common/tileset-source.js +0 -17
  572. package/dist/tileset-3d/common/tileset-source.js.map +0 -1
  573. package/dist/tileset-3d/common/tileset-traverser.d.ts +0 -88
  574. package/dist/tileset-3d/common/tileset-traverser.d.ts.map +0 -1
  575. package/dist/tileset-3d/common/tileset-traverser.js +0 -341
  576. package/dist/tileset-3d/common/tileset-traverser.js.map +0 -1
  577. package/dist/tileset-3d/format-3d-tiles/implicit-tiling.d.ts +0 -182
  578. package/dist/tileset-3d/format-3d-tiles/implicit-tiling.d.ts.map +0 -1
  579. package/dist/tileset-3d/format-3d-tiles/implicit-tiling.js +0 -681
  580. package/dist/tileset-3d/format-3d-tiles/implicit-tiling.js.map +0 -1
  581. package/dist/tileset-3d/format-3d-tiles/tiles-3d-source.d.ts +0 -221
  582. package/dist/tileset-3d/format-3d-tiles/tiles-3d-source.d.ts.map +0 -1
  583. package/dist/tileset-3d/format-3d-tiles/tiles-3d-source.js +0 -770
  584. package/dist/tileset-3d/format-3d-tiles/tiles-3d-source.js.map +0 -1
  585. package/dist/tileset-3d/format-3d-tiles/tileset-3d-traverser.d.ts +0 -111
  586. package/dist/tileset-3d/format-3d-tiles/tileset-3d-traverser.d.ts.map +0 -1
  587. package/dist/tileset-3d/format-3d-tiles/tileset-3d-traverser.js +0 -339
  588. package/dist/tileset-3d/format-3d-tiles/tileset-3d-traverser.js.map +0 -1
  589. package/dist/tileset-3d/format-i3s/i3s-pending-tiles-register.d.ts +0 -27
  590. package/dist/tileset-3d/format-i3s/i3s-pending-tiles-register.d.ts.map +0 -1
  591. package/dist/tileset-3d/format-i3s/i3s-pending-tiles-register.js +0 -45
  592. package/dist/tileset-3d/format-i3s/i3s-pending-tiles-register.js.map +0 -1
  593. package/dist/tileset-3d/format-i3s/i3s-source.d.ts +0 -116
  594. package/dist/tileset-3d/format-i3s/i3s-source.d.ts.map +0 -1
  595. package/dist/tileset-3d/format-i3s/i3s-source.js +0 -450
  596. package/dist/tileset-3d/format-i3s/i3s-source.js.map +0 -1
  597. package/dist/tileset-3d/format-i3s/i3s-tile-manager.d.ts +0 -34
  598. package/dist/tileset-3d/format-i3s/i3s-tile-manager.d.ts.map +0 -1
  599. package/dist/tileset-3d/format-i3s/i3s-tile-manager.js +0 -81
  600. package/dist/tileset-3d/format-i3s/i3s-tile-manager.js.map +0 -1
  601. package/dist/tileset-3d/format-i3s/i3s-tileset-traverser.d.ts +0 -25
  602. package/dist/tileset-3d/format-i3s/i3s-tileset-traverser.d.ts.map +0 -1
  603. package/dist/tileset-3d/format-i3s/i3s-tileset-traverser.js +0 -84
  604. package/dist/tileset-3d/format-i3s/i3s-tileset-traverser.js.map +0 -1
  605. package/dist/tileset-3d/helpers/3d-tiles-options.d.ts +0 -5
  606. package/dist/tileset-3d/helpers/3d-tiles-options.d.ts.map +0 -1
  607. package/dist/tileset-3d/helpers/3d-tiles-options.js +0 -9
  608. package/dist/tileset-3d/helpers/3d-tiles-options.js.map +0 -1
  609. package/dist/tileset-3d/helpers/bounding-volume.d.ts +0 -23
  610. package/dist/tileset-3d/helpers/bounding-volume.d.ts.map +0 -1
  611. package/dist/tileset-3d/helpers/bounding-volume.js +0 -236
  612. package/dist/tileset-3d/helpers/bounding-volume.js.map +0 -1
  613. package/dist/tileset-3d/helpers/frame-state.d.ts +0 -93
  614. package/dist/tileset-3d/helpers/frame-state.d.ts.map +0 -1
  615. package/dist/tileset-3d/helpers/frame-state.js +0 -211
  616. package/dist/tileset-3d/helpers/frame-state.js.map +0 -1
  617. package/dist/tileset-3d/helpers/i3s-lod.d.ts +0 -20
  618. package/dist/tileset-3d/helpers/i3s-lod.d.ts.map +0 -1
  619. package/dist/tileset-3d/helpers/i3s-lod.js +0 -95
  620. package/dist/tileset-3d/helpers/i3s-lod.js.map +0 -1
  621. package/dist/tileset-3d/helpers/s2-bounding-volume.d.ts +0 -17
  622. package/dist/tileset-3d/helpers/s2-bounding-volume.d.ts.map +0 -1
  623. package/dist/tileset-3d/helpers/s2-bounding-volume.js +0 -20
  624. package/dist/tileset-3d/helpers/s2-bounding-volume.js.map +0 -1
  625. package/dist/tileset-3d/helpers/tiles-3d-lod.d.ts +0 -72
  626. package/dist/tileset-3d/helpers/tiles-3d-lod.d.ts.map +0 -1
  627. package/dist/tileset-3d/helpers/tiles-3d-lod.js +0 -257
  628. package/dist/tileset-3d/helpers/tiles-3d-lod.js.map +0 -1
  629. package/dist/tileset-3d/helpers/tiles-3d-request-priority.d.ts +0 -134
  630. package/dist/tileset-3d/helpers/tiles-3d-request-priority.d.ts.map +0 -1
  631. package/dist/tileset-3d/helpers/tiles-3d-request-priority.js +0 -179
  632. package/dist/tileset-3d/helpers/tiles-3d-request-priority.js.map +0 -1
  633. package/dist/tileset-3d/helpers/transform-utils.d.ts +0 -3
  634. package/dist/tileset-3d/helpers/transform-utils.d.ts.map +0 -1
  635. package/dist/tileset-3d/helpers/transform-utils.js +0 -86
  636. package/dist/tileset-3d/helpers/transform-utils.js.map +0 -1
  637. package/dist/tileset-3d/helpers/zoom.d.ts +0 -46
  638. package/dist/tileset-3d/helpers/zoom.d.ts.map +0 -1
  639. package/dist/tileset-3d/helpers/zoom.js +0 -86
  640. package/dist/tileset-3d/helpers/zoom.js.map +0 -1
  641. package/dist/types.d.ts +0 -48
  642. package/dist/types.d.ts.map +0 -1
  643. package/dist/types.js.map +0 -1
  644. package/dist/utils/doubly-linked-list-node.d.ts +0 -11
  645. package/dist/utils/doubly-linked-list-node.d.ts.map +0 -1
  646. package/dist/utils/doubly-linked-list-node.js +0 -20
  647. package/dist/utils/doubly-linked-list-node.js.map +0 -1
  648. package/dist/utils/doubly-linked-list.d.ts +0 -30
  649. package/dist/utils/doubly-linked-list.d.ts.map +0 -1
  650. package/dist/utils/doubly-linked-list.js +0 -93
  651. package/dist/utils/doubly-linked-list.js.map +0 -1
  652. package/dist/utils/managed-array.d.ts +0 -85
  653. package/dist/utils/managed-array.d.ts.map +0 -1
  654. package/dist/utils/managed-array.js +0 -152
  655. package/dist/utils/managed-array.js.map +0 -1
  656. package/src/constants.ts +0 -59
  657. package/src/point-cloud/point-cloud-tile.ts +0 -80
  658. package/src/point-cloud/point-cloud-tileset.ts +0 -767
  659. package/src/point-cloud/types.ts +0 -99
  660. package/src/spatial/format-spatial-reference.ts +0 -385
  661. package/src/spatial/get-spatial-coordinate-frame.ts +0 -169
  662. package/src/spatial/i3s-elevation.ts +0 -96
  663. package/src/spatial/i3s-spatial-transformer.ts +0 -1021
  664. package/src/spatial/normalize-crs-identifier.ts +0 -26
  665. package/src/spatial/spatial-coordinate-transformer.ts +0 -377
  666. package/src/spatial/spatial-resource-registry.ts +0 -90
  667. package/src/spatial/spatial-types.ts +0 -422
  668. package/src/spatial/tiles-3d-spatial-transformer.ts +0 -194
  669. package/src/tileset-3d/common/indexed-archive-tileset-source.ts +0 -205
  670. package/src/tileset-3d/common/tile-3d-contracts.ts +0 -115
  671. package/src/tileset-3d/common/tile-3d.ts +0 -1310
  672. package/src/tileset-3d/common/tileset-3d.ts +0 -1208
  673. package/src/tileset-3d/common/tileset-cache.ts +0 -111
  674. package/src/tileset-3d/common/tileset-content-traversal.ts +0 -114
  675. package/src/tileset-3d/common/tileset-observability.ts +0 -100
  676. package/src/tileset-3d/common/tileset-source.ts +0 -284
  677. package/src/tileset-3d/common/tileset-traverser.ts +0 -416
  678. package/src/tileset-3d/format-3d-tiles/implicit-tiling.ts +0 -1059
  679. package/src/tileset-3d/format-3d-tiles/tiles-3d-source.ts +0 -1025
  680. package/src/tileset-3d/format-3d-tiles/tileset-3d-traverser.ts +0 -391
  681. package/src/tileset-3d/format-i3s/i3s-pending-tiles-register.ts +0 -48
  682. package/src/tileset-3d/format-i3s/i3s-source.ts +0 -557
  683. package/src/tileset-3d/format-i3s/i3s-tile-manager.ts +0 -105
  684. package/src/tileset-3d/format-i3s/i3s-tileset-traverser.ts +0 -102
  685. package/src/tileset-3d/helpers/3d-tiles-options.ts +0 -11
  686. package/src/tileset-3d/helpers/bounding-volume.ts +0 -281
  687. package/src/tileset-3d/helpers/frame-state.ts +0 -322
  688. package/src/tileset-3d/helpers/i3s-lod.ts +0 -109
  689. package/src/tileset-3d/helpers/s2-bounding-volume.ts +0 -35
  690. package/src/tileset-3d/helpers/tiles-3d-lod.ts +0 -370
  691. package/src/tileset-3d/helpers/tiles-3d-request-priority.ts +0 -301
  692. package/src/tileset-3d/helpers/transform-utils.ts +0 -109
  693. package/src/tileset-3d/helpers/zoom.ts +0 -120
  694. package/src/types.ts +0 -54
  695. package/src/utils/doubly-linked-list-node.ts +0 -22
  696. package/src/utils/doubly-linked-list.ts +0 -105
  697. package/src/utils/managed-array.ts +0 -174
  698. /package/dist/{point-cloud → mvt/lib}/types.js +0 -0
@@ -1,1056 +0,0 @@
1
- // loaders.gl
2
- // SPDX-License-Identifier: MIT
3
- // Copyright (c) vis.gl contributors
4
- // This file is derived from the Cesium code base under Apache 2 license
5
- // See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
6
- import { Vector3, Matrix4 } from '@math.gl/core';
7
- import { CullingVolume } from '@math.gl/culling';
8
- import { getTile3DFeatureIdSets } from "./tile-3d-contracts.js";
9
- import { LOD_METRIC_TYPE, TILE_REFINEMENT, TILE_CONTENT_STATE, TILESET_TYPE } from "../../constants.js";
10
- import { createBoundingVolume, getCartographicBounds } from "../helpers/bounding-volume.js";
11
- import { getTiles3DScreenSpaceError } from "../helpers/tiles-3d-lod.js";
12
- import { getProjectedRadius } from "../helpers/i3s-lod.js";
13
- import { TilesetTraverser } from "./tileset-traverser.js";
14
- import { calculateFoveatedFactor, calculateTileRequestPriority, isFoveatedRequestDelayActive, isFoveatedRequestDeferred, isProgressiveResolutionPriority } from "../helpers/tiles-3d-request-priority.js";
15
- const scratchVector = new Vector3();
16
- /**
17
- * Classifies render-content visibility across all content volumes owned by a tile.
18
- *
19
- * Content volumes form a union: one visible content entry keeps the tile renderable even when
20
- * another entry is outside the frustum or clipping planes. The traversal volume is intentionally
21
- * not used here except as a fallback when a tile has no content-specific volume. This separation
22
- * keeps clipping render-only and prevents a tight content volume from pruning descendants.
23
- *
24
- * @param contentVolumes - Transformed content volumes in source order.
25
- * @param fallbackVolume - Tile volume used when content does not declare its own volume.
26
- * @param cullingVolume - Current view frustum.
27
- * @param visibilityPlaneMask - Parent visibility mask optimization.
28
- * @param clippingPlanes - Optional world-space planes applied to render content only.
29
- * @returns Union visibility classification for the renderable content.
30
- */
31
- export function getContentVisibility(contentVolumes, fallbackVolume, cullingVolume, visibilityPlaneMask, clippingPlanes = []) {
32
- const volumes = contentVolumes.length ? contentVolumes : [fallbackVolume];
33
- let visibleVolume = false;
34
- let intersectingVolume = false;
35
- for (const contentVolume of volumes) {
36
- let visibility = 'inside';
37
- if (visibilityPlaneMask !== CullingVolume.MASK_INSIDE) {
38
- visibility = cullingVolume.computeVisibility(contentVolume);
39
- if (visibility === 'outside') {
40
- continue;
41
- }
42
- }
43
- let clipped = false;
44
- for (const clippingPlane of clippingPlanes) {
45
- if (contentVolume.intersectPlane(clippingPlane) === 'outside') {
46
- clipped = true;
47
- break;
48
- }
49
- }
50
- if (!clipped) {
51
- visibleVolume = true;
52
- intersectingVolume = intersectingVolume || visibility === 'intersecting';
53
- }
54
- }
55
- if (!visibleVolume) {
56
- return 'outside';
57
- }
58
- return intersectingVolume ? 'intersecting' : 'inside';
59
- }
60
- function isNestedTilesetPayload(payload) {
61
- if (!payload || typeof payload !== 'object') {
62
- return false;
63
- }
64
- const record = payload;
65
- return record.shape === 'tileset3d' || record.type === 'tileset3d' || Boolean(record.tileset);
66
- }
67
- function defined(x) {
68
- return x !== undefined && x !== null;
69
- }
70
- /**
71
- * A Tile3DHeader represents a tile as Tileset3D. When a tile is first created, its content is not loaded;
72
- * the content is loaded on-demand when needed based on the view.
73
- * Do not construct this directly, instead access tiles through {@link Tileset3D#tileVisible}.
74
- */
75
- export class Tile3D {
76
- tileset;
77
- header;
78
- id;
79
- url;
80
- parent;
81
- /* Specifies the type of refine that is used when traversing this tile for rendering. */
82
- refine;
83
- type;
84
- contentUrl;
85
- /** Resolved render-content URLs in source order; empty for contentless tiles. */
86
- contentUrls = [];
87
- /** Different refinement algorithms used by I3S and 3D tiles */
88
- lodMetricType = 'geometricError';
89
- /**
90
- * The world-space geometric error, in meters, introduced if this tile is rendered and its
91
- * children are not. For I3S this stores the format's unscaled screen-threshold metric instead.
92
- */
93
- lodMetricValue = 0;
94
- /**
95
- * The source LOD metric before applying the tile's computed transform. Keeping the source value
96
- * separate ensures transform updates never compound an already-scaled geometric error.
97
- */
98
- _unscaledLodMetricValue = 0;
99
- /** Whether the source format defines geometric error in transform-local units. */
100
- _scaleGeometricError = true;
101
- /** @todo math.gl is not exporting BoundingVolume base type? */
102
- boundingVolume = null;
103
- /**
104
- * The tile's content. This represents the actual tile's payload,
105
- * not the content's metadata in the tileset JSON file.
106
- */
107
- content = null;
108
- /** Loaded payloads in the same order as {@link contentUrls}; `content` remains the primary payload. */
109
- contents = [];
110
- /** Ordered renderer-neutral descriptors for each source content entry. */
111
- contentEntries = [];
112
- /** Raw metadata references inherited by this tile and its content. */
113
- metadataContext = {};
114
- /** Feature-id declarations normalized from supported content extensions. */
115
- featureIdSets = [];
116
- /** Decoded 3D Tiles vector topology for the primary loaded content, when present. */
117
- vectorContent = null;
118
- /**
119
- * Metadata entity attached to this tile in the source tileset, if present.
120
- *
121
- * This is the raw 3D Tiles metadata reference. The generic tiles runtime preserves it without
122
- * decoding schema classes or binary property tables.
123
- */
124
- metadata = null;
125
- /** Raw metadata entities attached to tile contents, in content source order. */
126
- contentMetadata = [];
127
- contentState = TILE_CONTENT_STATE.UNLOADED;
128
- gpuMemoryUsageInBytes = 0;
129
- /** The tile's children - an array of Tile3D objects. */
130
- children = [];
131
- /** Current lifecycle state for a lazy implicit subtree rooted at this tile. */
132
- childrenState = 'ready';
133
- depth = 0;
134
- viewportIds = [];
135
- transform = new Matrix4();
136
- extensions = null;
137
- /** TODO Cesium 3d tiles specific */
138
- implicitTiling = null;
139
- /** Container to store application specific data */
140
- userData = {};
141
- computedTransform;
142
- hasEmptyContent = false;
143
- hasTilesetContent = false;
144
- traverser = new TilesetTraverser({});
145
- /** Used by TilesetCache */
146
- _cacheNode = null;
147
- _frameNumber = null;
148
- // TODO Cesium 3d tiles specific
149
- _expireDate = null;
150
- _expiredContent = null;
151
- /** In-flight source request shared by repeated traversal frames. */
152
- _childrenPromise = null;
153
- _boundingBox = undefined;
154
- /** updated every frame for tree traversal and rendering optimizations: */
155
- _distanceToCamera = 0;
156
- _screenSpaceError = 0;
157
- /** SSE calculated at the reduced viewport height used to prioritize coarse coverage. */
158
- _screenSpaceErrorProgressiveResolution = 0;
159
- /** Whether this tile should be promoted into the progressive-resolution request pass. */
160
- _priorityProgressiveResolution = false;
161
- /** Angular distance from the camera view axis used to prioritize center tiles. */
162
- _foveatedFactor = 0;
163
- /** Whether this peripheral request is currently inside the camera-motion deferral window. */
164
- priorityDeferred = false;
165
- _visibilityPlaneMask;
166
- _visible = undefined;
167
- _contentBoundingVolume;
168
- _contentBoundingVolumes = [];
169
- /** Source content-volume headers retained after render content is unloaded. */
170
- _contentBoundingVolumeHeaders = [];
171
- _viewerRequestVolume;
172
- /** Bounding volume used to cull the tile's first renderable content entry. */
173
- get contentBoundingVolume() {
174
- return this._contentBoundingVolume;
175
- }
176
- /** All transformed render-content bounding volumes, including tile-volume fallbacks. */
177
- get contentBoundingVolumes() {
178
- return this._contentBoundingVolumes;
179
- }
180
- /** Bounding volume that limits when this tile may be requested, when declared. */
181
- get viewerRequestVolume() {
182
- return this._viewerRequestVolume;
183
- }
184
- /** Accumulated tile transforms from the source JSON, excluding the tileset model matrix. */
185
- _initialTransform = new Matrix4();
186
- // Used by traverser, cannot be marked private
187
- _priority = 0;
188
- _selectedFrame = 0;
189
- _requestedFrame = 0;
190
- _selectionDepth = 0;
191
- _touchedFrame = 0;
192
- _centerZDepth = 0;
193
- _shouldRefine = false;
194
- _stackLength = 0;
195
- _visitedFrame = 0;
196
- _inRequestVolume = false;
197
- _lodJudge = null; // TODO i3s specific, needs to remove
198
- /**
199
- * Indicates whether the tile has been drawn by the renderer.
200
- * Defaults to true for backwards compatibility — renderers that support
201
- * transition hold (e.g. deck.gl 9.3+) should set this to false on tile load,
202
- * then back to true after first draw to avoid flashes (see deck.gl #7914).
203
- */
204
- tileDrawn = true;
205
- /**
206
- * @constructs
207
- * Create a Tile3D instance
208
- * @param tileset - Tileset3D instance
209
- * @param header - tile header - JSON loaded from a dataset
210
- * @param parentHeader - parent Tile3D instance
211
- * @param extendedId - optional ID to separate copies of a tile for different viewports.
212
- * const extendedId = `${tile.id}-${frameState.viewport.id}`;
213
- */
214
- // eslint-disable-next-line max-statements
215
- constructor(tileset, header, parentHeader, extendedId = '') {
216
- // PUBLIC MEMBERS
217
- // original tile data
218
- this.header = header;
219
- // The tileset containing this tile.
220
- this.tileset = tileset;
221
- this.id = extendedId || header.id;
222
- this.url = header.url;
223
- // This tile's parent or `undefined` if this tile is the root.
224
- // @ts-ignore
225
- this.parent = parentHeader;
226
- this.refine = this._getRefine(header.refine);
227
- this.type = header.type;
228
- this.contentUrl = header.contentUrl;
229
- this.contentUrls = header.contentUrls || (header.contentUrl ? [header.contentUrl] : []);
230
- this._initializeMetadata(header);
231
- this.childrenState = header.implicitSubtree ? 'unloaded' : 'ready';
232
- this._initializeLodMetric(header);
233
- this._initializeTransforms(header);
234
- this._updateLodMetricScale();
235
- this._initializeBoundingVolumes(header);
236
- this._initializeContent(header);
237
- this._initializeContentEntries(header);
238
- this._initializeRenderingState(header);
239
- Object.seal(this);
240
- }
241
- destroy() {
242
- this.header = null;
243
- }
244
- isDestroyed() {
245
- return this.header === null;
246
- }
247
- get selected() {
248
- return this._selectedFrame === this.tileset._frameNumber;
249
- }
250
- get isVisible() {
251
- return this._visible;
252
- }
253
- get isVisibleAndInRequestVolume() {
254
- return this._visible && this._inRequestVolume;
255
- }
256
- /** Returns true if tile is not an empty tile and not an external tileset */
257
- get hasRenderContent() {
258
- return !this.hasEmptyContent && !this.hasTilesetContent;
259
- }
260
- /** Returns true if tile has children */
261
- get hasChildren() {
262
- return (this.children.length > 0 ||
263
- (this.header.children && this.header.children.length > 0) ||
264
- Boolean(this.header.implicitSubtree && this.childrenState !== 'ready'));
265
- }
266
- /** Returns whether traversal may request an unresolved lazy child-header group. */
267
- get hasUnloadedChildren() {
268
- return Boolean(this.header.implicitSubtree &&
269
- (this.childrenState === 'unloaded' || this.childrenState === 'failed'));
270
- }
271
- /** Returns whether a lazy child-header request is currently in flight. */
272
- get childrenLoading() {
273
- return this.childrenState === 'loading';
274
- }
275
- /**
276
- * Determines if the tile's content is ready. This is automatically `true` for
277
- * tiles with empty content.
278
- */
279
- get contentReady() {
280
- return this.contentState === TILE_CONTENT_STATE.READY || this.hasEmptyContent;
281
- }
282
- /**
283
- * Determines if the tile has available content to render. `true` if the tile's
284
- * content is ready or if it has expired content this renders while new content loads; otherwise,
285
- */
286
- get contentAvailable() {
287
- return Boolean((this.contentReady && this.hasRenderContent) || (this._expiredContent && !this.contentFailed));
288
- }
289
- /** Returns true if tile has renderable content but it's unloaded */
290
- get hasUnloadedContent() {
291
- return this.hasRenderContent && this.contentUnloaded;
292
- }
293
- /**
294
- * Determines if the tile's content has not be requested. `true` if tile's
295
- * content has not be requested; otherwise, `false`.
296
- */
297
- get contentUnloaded() {
298
- return this.contentState === TILE_CONTENT_STATE.UNLOADED;
299
- }
300
- /**
301
- * Determines if the tile's content is expired. `true` if tile's
302
- * content is expired; otherwise, `false`.
303
- */
304
- get contentExpired() {
305
- return this.contentState === TILE_CONTENT_STATE.EXPIRED;
306
- }
307
- // Determines if the tile's content failed to load. `true` if the tile's
308
- // content failed to load; otherwise, `false`.
309
- get contentFailed() {
310
- return this.contentState === TILE_CONTENT_STATE.FAILED;
311
- }
312
- /**
313
- * Distance from the tile's bounding volume center to the camera
314
- */
315
- get distanceToCamera() {
316
- return this._distanceToCamera;
317
- }
318
- /**
319
- * Screen space error for LOD selection
320
- */
321
- get screenSpaceError() {
322
- return this._screenSpaceError;
323
- }
324
- /**
325
- * Get the current world-space bounding volume in cartographic coordinates.
326
- * @returns [min, max] each in [longitude, latitude, altitude]
327
- */
328
- get boundingBox() {
329
- if (!this._boundingBox) {
330
- this._boundingBox = getCartographicBounds(this.header.boundingVolume, this.boundingVolume, !this.computedTransform.equals(this._initialTransform));
331
- }
332
- return this._boundingBox;
333
- }
334
- /**
335
- * Gets the tile's screen-space error for normal refinement or a reduced-height priority pass.
336
- *
337
- * I3S already supplies a screen-oriented LOD metric and intentionally ignores the optional 3D
338
- * Tiles progressive-resolution height fraction.
339
- *
340
- * @param frameState - Current camera and viewport measurements.
341
- * @param useParentLodMetric - Whether to substitute the parent LOD metric.
342
- * @param viewportHeightFraction - Fraction of viewport height represented by the priority pass.
343
- * @returns Screen-space LOD error for the current tileset format.
344
- */
345
- getScreenSpaceError(frameState, useParentLodMetric, viewportHeightFraction = 1) {
346
- switch (this.tileset.type) {
347
- case TILESET_TYPE.I3S:
348
- return getProjectedRadius(this, frameState);
349
- case TILESET_TYPE.TILES3D:
350
- return getTiles3DScreenSpaceError(this, frameState, useParentLodMetric, viewportHeightFraction);
351
- default:
352
- // eslint-disable-next-line
353
- throw new Error('Unsupported tileset type');
354
- }
355
- }
356
- /**
357
- * Make tile unselected than means it won't be shown
358
- * but it can be still loaded in memory
359
- */
360
- unselect() {
361
- this._selectedFrame = 0;
362
- }
363
- /**
364
- * Memory usage of tile on GPU
365
- */
366
- _getGpuMemoryUsageInBytes() {
367
- const contents = this.contents.length ? this.contents : [this.content];
368
- return contents.reduce((total, content) => total + (content?.gpuMemoryUsageInBytes || content?.byteLength || 0), 0);
369
- }
370
- /**
371
- * Returns scheduler priority for render-content requests.
372
- *
373
- * @returns Numeric priority, or a negative value when the queued request should be cancelled.
374
- */
375
- _getPriority() {
376
- return this._calculateRequestPriority(false);
377
- }
378
- /**
379
- * Returns scheduler priority for lazy child-header requests.
380
- *
381
- * Contentless implicit placeholders intentionally retain `UNLOADED` content state, so metadata
382
- * scheduling skips only that render-content cancellation check and preserves every visibility,
383
- * recency, progressive, foveated, and motion-deferral rule.
384
- *
385
- * @returns Numeric priority, or a negative value when the queued request should be cancelled.
386
- */
387
- _getChildrenPriority() {
388
- return this._calculateRequestPriority(true);
389
- }
390
- /**
391
- * Calculates the common scheduler priority for content or hierarchy metadata.
392
- *
393
- * @param allowUnloadedContent - Whether an empty placeholder may request child metadata.
394
- * @returns Numeric priority, or a negative value when the queued request should be cancelled.
395
- */
396
- // eslint-disable-next-line complexity
397
- _calculateRequestPriority(allowUnloadedContent) {
398
- const traverser = this.tileset._traverser;
399
- const skipLevelOfDetail = traverser.options.skipLevelOfDetail && !traverser.disableSkipLevelOfDetail;
400
- /*
401
- * Tiles that are outside of the camera's frustum could be skipped if we are in 'ADD' mode
402
- * or if we are using 'Skip Traversal' in 'REPLACE' mode.
403
- * Otherewise, all 'touched' child tiles have to be loaded and displayed,
404
- * this may include tiles that are outide of the camera frustum (so that we can hide the parent tile).
405
- */
406
- const maySkipTile = this.refine === TILE_REFINEMENT.ADD || skipLevelOfDetail;
407
- // Check if any reason to abort
408
- if (maySkipTile && !this.isVisible && this._visible !== undefined) {
409
- return -1;
410
- }
411
- // Condition used in `cancelOutOfViewRequests` function in CesiumJS/Cesium3DTileset.js
412
- if (this.tileset._frameNumber - this._touchedFrame >= 1) {
413
- return -1;
414
- }
415
- // RequestScheduler re-evaluates this callback before a queued request receives a slot. A
416
- // negative priority cancels work that became deferred after it was queued; the scheduled
417
- // follow-up traversal submits it again after the motion delay expires.
418
- if (this.priorityDeferred) {
419
- return -1;
420
- }
421
- if (!allowUnloadedContent && this.contentState === TILE_CONTENT_STATE.UNLOADED) {
422
- return -1;
423
- }
424
- // Based on the priority function `getPriorityReverseScreenSpaceError` in CesiumJS. Scheduling priority is based on the parent's screen space error when possible.
425
- const parent = this.parent;
426
- const useParentScreenSpaceError = parent && (!maySkipTile || this._screenSpaceError === 0.0 || parent.hasTilesetContent);
427
- const screenSpaceError = useParentScreenSpaceError
428
- ? parent._screenSpaceError
429
- : this._screenSpaceError;
430
- const rootScreenSpaceError = traverser.root ? traverser.root._screenSpaceError : 0.0;
431
- // Map higher SSE to lower values (e.g. root tile is highest priority), then combine the
432
- // existing order with independent progressive and foveated priority bands.
433
- const reverseScreenSpaceError = Math.max(rootScreenSpaceError - screenSpaceError, 0);
434
- return calculateTileRequestPriority({
435
- priorityProgressiveResolution: this._priorityProgressiveResolution,
436
- foveatedFactor: this._foveatedFactor,
437
- reverseScreenSpaceError,
438
- rootScreenSpaceError
439
- });
440
- }
441
- /**
442
- * Requests the tile's content.
443
- * The request may not be made if the Request Scheduler can't prioritize it.
444
- */
445
- // eslint-disable-next-line max-statements, complexity
446
- async loadContent() {
447
- if (this.hasEmptyContent) {
448
- return { loaded: false };
449
- }
450
- if (this.content) {
451
- return { loaded: true };
452
- }
453
- const expired = this.contentExpired;
454
- if (expired) {
455
- this._expireDate = null;
456
- }
457
- this.contentState = TILE_CONTENT_STATE.LOADING;
458
- const requestToken = await this.tileset._requestScheduler.scheduleRequest(this.id, this._getPriority.bind(this));
459
- if (!requestToken) {
460
- // cancelled
461
- this.contentState = TILE_CONTENT_STATE.UNLOADED;
462
- return { loaded: false };
463
- }
464
- try {
465
- return await this._loadContentFromSource();
466
- }
467
- catch (error) {
468
- // Tile is unloaded before the content finishes loading
469
- this.contentState = TILE_CONTENT_STATE.FAILED;
470
- throw error;
471
- }
472
- finally {
473
- requestToken.done();
474
- }
475
- }
476
- /** Loads content for complete dataset operations without viewport-based request priority. */
477
- async loadContentForTraversal() {
478
- if (this.hasEmptyContent) {
479
- return { loaded: false };
480
- }
481
- if (this.content) {
482
- return { loaded: true, contents: this.contents };
483
- }
484
- this.contentState = TILE_CONTENT_STATE.LOADING;
485
- try {
486
- return await this._loadContentFromSource();
487
- }
488
- catch (error) {
489
- this.contentState = TILE_CONTENT_STATE.FAILED;
490
- throw error;
491
- }
492
- }
493
- /** Loads source content and updates the tile's renderer-neutral payload state. */
494
- async _loadContentFromSource() {
495
- const loadResult = await this.tileset.source.loadTileContent(this);
496
- if (loadResult.contents) {
497
- this.contents = loadResult.contents;
498
- this.content = this.contents[0] || null;
499
- }
500
- this.vectorContent =
501
- this.contents.find(content => Boolean(content?.vectorContent))?.vectorContent || null;
502
- if (this.tileset.options.contentLoader) {
503
- await this.tileset.options.contentLoader(this);
504
- }
505
- this.contentState = TILE_CONTENT_STATE.READY;
506
- this._onContentLoaded();
507
- this._updateContentEntriesAfterLoad(loadResult);
508
- return loadResult;
509
- }
510
- /**
511
- * Requests and installs this tile's lazy child-header group through its source.
512
- *
513
- * The same request scheduler and SSE/foveated priority value used for render content are reused
514
- * for subtree metadata. Repeated traversal frames share one promise, and scheduler cancellation
515
- * restores the unloaded state so a later frame can retry.
516
- *
517
- * @param frameState - View state that made the subtree eligible for refinement.
518
- * @returns Source load result, or an unloaded result if scheduling was cancelled.
519
- */
520
- async loadChildren(frameState) {
521
- if (!this.header.implicitSubtree || this.childrenState === 'ready') {
522
- return { loaded: false, tileCount: 0, childSubtreeCount: 0 };
523
- }
524
- if (this._childrenPromise) {
525
- return await this._childrenPromise;
526
- }
527
- if (!this.tileset.source.loadTileChildren) {
528
- throw new Error('Tileset source does not support lazy tile children');
529
- }
530
- this.childrenState = 'loading';
531
- this._childrenPromise = this._loadChildrenWithScheduler(frameState);
532
- try {
533
- return await this._childrenPromise;
534
- }
535
- finally {
536
- this._childrenPromise = null;
537
- }
538
- }
539
- /**
540
- * Runs one lazy child-header load after obtaining a scheduler token.
541
- *
542
- * @param frameState - View state forwarded to the source implementation.
543
- * @returns Source load result.
544
- */
545
- async _loadChildrenWithScheduler(frameState) {
546
- const requestToken = await this.tileset._requestScheduler.scheduleRequest(`${this.id}:implicit-subtree`, this._getChildrenPriority.bind(this));
547
- if (!requestToken) {
548
- this.childrenState = 'unloaded';
549
- return { loaded: false, tileCount: 0, childSubtreeCount: 0 };
550
- }
551
- try {
552
- const loadResult = await this.tileset.source.loadTileChildren(this, frameState);
553
- this.childrenState = loadResult.loaded ? 'ready' : 'unloaded';
554
- return loadResult;
555
- }
556
- catch (error) {
557
- this.childrenState = 'failed';
558
- throw error;
559
- }
560
- finally {
561
- requestToken.done();
562
- }
563
- }
564
- /**
565
- * Replaces a contentless implicit placeholder with its materialized subtree-root header.
566
- *
567
- * The placeholder transform is preserved when the subtree omits a root transform. An explicit
568
- * subtree-root transform replaces it and is recomposed against the runtime parent. Content,
569
- * metadata, bounds, and raw geometric error are reinitialized from the available header.
570
- *
571
- * @param materializedHeader - Available root header produced from one subtree resource.
572
- */
573
- applyImplicitSubtreeHeader(materializedHeader) {
574
- const existingTransform = this.header.transform;
575
- const existingTransformMatrix = this.header.transformMatrix;
576
- const hasMaterializedTransform = materializedHeader.transform !== undefined;
577
- this.header = {
578
- ...this.header,
579
- ...materializedHeader,
580
- transform: hasMaterializedTransform ? materializedHeader.transform : existingTransform,
581
- transformMatrix: hasMaterializedTransform
582
- ? materializedHeader.transformMatrix
583
- : existingTransformMatrix,
584
- implicitSubtree: undefined
585
- };
586
- if (hasMaterializedTransform) {
587
- this._initializeTransforms(this.header);
588
- }
589
- this.refine = this._getRefine(materializedHeader.refine);
590
- this.type = materializedHeader.type;
591
- this.contentUrl = materializedHeader.contentUrl;
592
- this.contentUrls =
593
- materializedHeader.contentUrls ||
594
- (materializedHeader.contentUrl ? [materializedHeader.contentUrl] : []);
595
- this._initializeMetadata(this.header);
596
- this._initializeLodMetric(materializedHeader);
597
- this._updateLodMetricScale();
598
- this._initializeBoundingVolumes(this.header);
599
- this._boundingBox = undefined;
600
- // Use the merged header so inherited viewer-request-volume metadata remains available when a
601
- // materialized implicit tile has no render content of its own.
602
- this._initializeContent(this.header);
603
- this._initializeContentEntries(this.header);
604
- }
605
- /** Refreshes tile and content metadata from a source or materialized tile header. */
606
- _initializeMetadata(header) {
607
- this.metadata = header.metadata || null;
608
- const contentHeaders = Array.isArray(header.content) ? header.content : [header.content];
609
- this.contentMetadata = contentHeaders
610
- .filter(Boolean)
611
- .map(contentHeader => contentHeader.metadata || null);
612
- const firstContentHeader = contentHeaders.find(Boolean) || {};
613
- const groupReference = firstContentHeader.group;
614
- const group = typeof groupReference === 'number'
615
- ? this.tileset.groups?.[groupReference] || null
616
- : groupReference || null;
617
- const metadataContext = {
618
- tileset: this.tileset.metadata || null,
619
- group,
620
- tile: this.metadata,
621
- content: this.contentMetadata[0] || null,
622
- subtree: header.implicitMetadata || null
623
- };
624
- if (this.tileset.groups) {
625
- metadataContext.groups = this.tileset.groups;
626
- }
627
- this.metadataContext = metadataContext;
628
- }
629
- /** Updates payload and renderability while retaining immutable metadata descriptors. */
630
- _updateContentEntriesAfterLoad(loadResult) {
631
- if (loadResult.contentEntries) {
632
- this.contentEntries = loadResult.contentEntries.map((entry, index) => ({
633
- ...entry,
634
- index,
635
- boundingVolume: entry.boundingVolume || this._contentBoundingVolumes[index] || this.boundingVolume,
636
- payload: entry.payload ?? this.contents[index] ?? null,
637
- featureIds: entry.featureIds?.length
638
- ? entry.featureIds
639
- : getTile3DFeatureIdSets(entry.payload ?? this.contents[index]),
640
- renderable: Boolean(entry.renderable !== false &&
641
- (entry.payload ?? this.contents[index]) &&
642
- !isNestedTilesetPayload(entry.payload ?? this.contents[index]))
643
- }));
644
- this.featureIdSets = this.contentEntries.flatMap(entry => entry.featureIds);
645
- return;
646
- }
647
- this.contentEntries = this.contentEntries.map((entry, index) => ({
648
- ...entry,
649
- payload: this.contents[index] ?? null,
650
- featureIds: getTile3DFeatureIdSets(this.contents[index]),
651
- renderable: Boolean(this.contents[index]) && !isNestedTilesetPayload(this.contents[index])
652
- }));
653
- this.featureIdSets = this.contentEntries.flatMap(entry => entry.featureIds);
654
- }
655
- /** Returns one ordered content descriptor, or null when the index is out of range. */
656
- getContentEntry(index) {
657
- return this.contentEntries[index] || null;
658
- }
659
- /** Returns whether an ordered content entry currently has renderable payload. */
660
- isContentRenderable(index) {
661
- return Boolean(this.contentEntries[index]?.renderable);
662
- }
663
- /** Initializes additive renderer-neutral descriptors from a normalized tile header. */
664
- _initializeContentEntries(tileHeader) {
665
- const headers = Array.isArray(tileHeader.content)
666
- ? tileHeader.content
667
- : tileHeader.content
668
- ? [tileHeader.content]
669
- : [];
670
- this.contentEntries = headers.map((contentHeader, index) => {
671
- const normalizedContentHeader = contentHeader || {};
672
- return {
673
- index,
674
- uri: this.contentUrls[index] || normalizedContentHeader.uri || normalizedContentHeader.url,
675
- group: normalizedContentHeader.group,
676
- type: normalizedContentHeader.type,
677
- payload: null,
678
- metadata: normalizedContentHeader.metadata || null,
679
- boundingVolume: this._contentBoundingVolumes[index] || this.boundingVolume,
680
- featureIds: this._getFeatureIdSets(normalizedContentHeader),
681
- renderable: false
682
- };
683
- });
684
- }
685
- /** Extracts renderer-neutral feature-id declarations without decoding property values. */
686
- _getFeatureIdSets(contentHeader) {
687
- return getTile3DFeatureIdSets(contentHeader);
688
- }
689
- // Unloads the tile's content.
690
- unloadContent() {
691
- for (const content of this.contents.length ? this.contents : [this.content]) {
692
- if (content && content.destroy) {
693
- content.destroy();
694
- }
695
- }
696
- this.contents = [];
697
- this.content = null;
698
- this.vectorContent = null;
699
- this.contentEntries = this.contentEntries.map(entry => ({
700
- ...entry,
701
- payload: null,
702
- renderable: false
703
- }));
704
- this.featureIdSets = this.contentEntries.flatMap(entry => entry.featureIds);
705
- if (this.header.content && this.header.content.destroy) {
706
- this.header.content.destroy();
707
- }
708
- this.header.content = null;
709
- this.contentState = TILE_CONTENT_STATE.UNLOADED;
710
- this.tileDrawn = true;
711
- return true;
712
- }
713
- /**
714
- * Update the tile's visibility
715
- * @param {Object} frameState - frame state for tile culling
716
- * @param {string[]} viewportIds - a list of viewport ids that show this tile
717
- * @return {void}
718
- */
719
- updateVisibility(frameState, viewportIds) {
720
- if (this._frameNumber === frameState.frameNumber) {
721
- // Return early if visibility has already been checked during the traversal.
722
- // The visibility may have already been checked if the cullWithChildrenBounds optimization is used.
723
- return;
724
- }
725
- const parent = this.parent;
726
- const parentVisibilityPlaneMask = parent
727
- ? parent._visibilityPlaneMask
728
- : CullingVolume.MASK_INDETERMINATE;
729
- if (this.tileset._traverser.options.updateTransforms) {
730
- const parentTransform = parent ? parent.computedTransform : this.tileset.modelMatrix;
731
- this._updateTransform(parentTransform);
732
- }
733
- this._distanceToCamera = this.distanceToTile(frameState);
734
- this._screenSpaceError = this.getScreenSpaceError(frameState, false);
735
- this._updateRequestPriorityMetrics(frameState);
736
- this._visibilityPlaneMask = this.visibility(frameState, parentVisibilityPlaneMask); // Use parent's plane mask to speed up visibility test
737
- this._visible = this._visibilityPlaneMask !== CullingVolume.MASK_OUTSIDE;
738
- this._inRequestVolume = this.insideViewerRequestVolume(frameState);
739
- this._frameNumber = frameState.frameNumber;
740
- this.viewportIds = viewportIds;
741
- }
742
- /**
743
- * Updates progressive-resolution and foveated request metrics for a 3D Tiles traversal frame.
744
- *
745
- * I3S retains its format-specific screen-threshold ordering and is explicitly isolated from
746
- * geometric-error scheduling. Orthographic viewports still receive progressive coverage, but
747
- * angular foveation is disabled because an orthographic frustum has no perspective field of view.
748
- *
749
- * @param frameState - Current camera and viewport measurements.
750
- */
751
- _updateRequestPriorityMetrics(frameState) {
752
- if (this.tileset.type !== TILESET_TYPE.TILES3D) {
753
- this._screenSpaceErrorProgressiveResolution = this._screenSpaceError;
754
- this._priorityProgressiveResolution = false;
755
- this._foveatedFactor = 0;
756
- this.priorityDeferred = false;
757
- return;
758
- }
759
- const options = this.tileset.options;
760
- const progressiveResolutionHeightFraction = options.progressiveResolutionHeightFraction;
761
- this._screenSpaceErrorProgressiveResolution = this.getScreenSpaceError(frameState, false, progressiveResolutionHeightFraction);
762
- this._priorityProgressiveResolution = isProgressiveResolutionPriority(this._screenSpaceErrorProgressiveResolution, this.parent?._screenSpaceErrorProgressiveResolution, this.tileset.memoryAdjustedScreenSpaceError, progressiveResolutionHeightFraction);
763
- if (!options.foveatedScreenSpaceError ||
764
- frameState.viewport?.orthographic ||
765
- !frameState.camera?.position ||
766
- !frameState.camera?.direction) {
767
- this._foveatedFactor = 0;
768
- this.priorityDeferred = false;
769
- return;
770
- }
771
- this._foveatedFactor = calculateFoveatedFactor(this.boundingVolume, frameState.camera);
772
- const traverser = this.tileset._traverser;
773
- const skipLevelOfDetail = traverser.options.skipLevelOfDetail && !traverser.disableSkipLevelOfDetail;
774
- const deferralEligible = isFoveatedRequestDeferred({
775
- refinement: this.refine,
776
- skipLevelOfDetail,
777
- foveatedScreenSpaceError: options.foveatedScreenSpaceError,
778
- foveatedConeSize: options.foveatedConeSize,
779
- minimumScreenSpaceErrorRelaxation: options.foveatedMinimumScreenSpaceErrorRelaxation,
780
- interpolationCallback: options.foveatedInterpolationCallback,
781
- foveatedFactor: this._foveatedFactor,
782
- verticalFieldOfView: frameState.camera.verticalFieldOfView,
783
- screenSpaceError: this._screenSpaceError,
784
- parentScreenSpaceError: this.parent?._screenSpaceError,
785
- maximumScreenSpaceError: this.tileset.memoryAdjustedScreenSpaceError,
786
- priorityProgressiveResolution: this._priorityProgressiveResolution
787
- });
788
- this.priorityDeferred = isFoveatedRequestDelayActive(deferralEligible, frameState.camera.timeSinceMovement, options.foveatedTimeDelay);
789
- }
790
- // Determines whether the tile's bounding volume intersects the culling volume.
791
- // @param {FrameState} frameState The frame state.
792
- // @param {Number} parentVisibilityPlaneMask The parent's plane mask to speed up the visibility check.
793
- // @returns {Number} A plane mask as described above in {@link CullingVolume#computeVisibilityWithPlaneMask}.
794
- visibility(frameState, parentVisibilityPlaneMask) {
795
- const { cullingVolume } = frameState;
796
- const { boundingVolume } = this;
797
- // TODO Cesium specific - restore clippingPlanes
798
- // const {clippingPlanes, clippingPlanesOriginMatrix} = tileset;
799
- // if (clippingPlanes && clippingPlanes.enabled) {
800
- // const intersection = clippingPlanes.computeIntersectionWithBoundingVolume(
801
- // boundingVolume,
802
- // clippingPlanesOriginMatrix
803
- // );
804
- // this._isClipped = intersection !== Intersect.INSIDE;
805
- // if (intersection === Intersect.OUTSIDE) {
806
- // return CullingVolume.MASK_OUTSIDE;
807
- // }
808
- // }
809
- // return cullingVolume.computeVisibilityWithPlaneMask(boundingVolume, parentVisibilityPlaneMask);
810
- return cullingVolume.computeVisibilityWithPlaneMask(boundingVolume, parentVisibilityPlaneMask);
811
- }
812
- /**
813
- * Determines whether renderable content intersects the view and configured clipping planes.
814
- *
815
- * Clipping planes are render-only constraints; traversal continues to use the tile volume.
816
- *
817
- * @param frameState Current camera, culling, and optional clipping-plane state.
818
- * @returns The content visibility classification.
819
- */
820
- contentVisibility(frameState, contentIndex) {
821
- const contentVolumes = contentIndex === undefined
822
- ? this._contentBoundingVolumes
823
- : this._contentBoundingVolumes[contentIndex]
824
- ? [this._contentBoundingVolumes[contentIndex]]
825
- : [];
826
- return getContentVisibility(contentVolumes, this.boundingVolume, frameState.cullingVolume, this._visibilityPlaneMask, frameState.clippingPlanes);
827
- }
828
- /**
829
- * Computes the (potentially approximate) distance from the closest point of the tile's bounding volume to the camera.
830
- * @param frameState The frame state.
831
- * @returns {Number} The distance, in meters, or zero if the camera is inside the bounding volume.
832
- */
833
- distanceToTile(frameState) {
834
- const boundingVolume = this.boundingVolume;
835
- return Math.sqrt(Math.max(boundingVolume.distanceSquaredTo(frameState.camera.position), 0));
836
- }
837
- /**
838
- * Computes the tile's camera-space z-depth.
839
- * @param frameState The frame state.
840
- * @returns The distance, in meters.
841
- */
842
- cameraSpaceZDepth({ camera }) {
843
- const boundingVolume = this.boundingVolume; // Gets the underlying OrientedBoundingBox or BoundingSphere
844
- scratchVector.subVectors(boundingVolume.center, camera.position);
845
- return camera.direction.dot(scratchVector);
846
- }
847
- /**
848
- * Checks if the camera is inside the viewer request volume.
849
- * @param {FrameState} frameState The frame state.
850
- * @returns {Boolean} Whether the camera is inside the volume.
851
- */
852
- insideViewerRequestVolume(frameState) {
853
- const viewerRequestVolume = this._viewerRequestVolume;
854
- return (!viewerRequestVolume || viewerRequestVolume.distanceSquaredTo(frameState.camera.position) <= 0);
855
- }
856
- // TODO Cesium specific
857
- // Update whether the tile has expired.
858
- updateExpiration() {
859
- if (defined(this._expireDate) && this.contentReady && !this.hasEmptyContent) {
860
- const now = Date.now();
861
- // @ts-ignore Date.lessThan - replace with ms compare?
862
- if (Date.lessThan(this._expireDate, now)) {
863
- this.contentState = TILE_CONTENT_STATE.EXPIRED;
864
- this._expiredContent = this.content;
865
- }
866
- }
867
- }
868
- get extras() {
869
- return this.header.extras;
870
- }
871
- // INTERNAL METHODS
872
- /** Initializes the tile's LOD metric from its header or its nearest available ancestor. */
873
- _initializeLodMetric(header) {
874
- this._scaleGeometricError =
875
- typeof header._scaleGeometricError === 'boolean'
876
- ? header._scaleGeometricError
877
- : (this.parent?._scaleGeometricError ?? true);
878
- if ('lodMetricType' in header) {
879
- this.lodMetricType = header.lodMetricType;
880
- }
881
- else {
882
- this.lodMetricType = (this.parent && this.parent.lodMetricType) || this.tileset.lodMetricType;
883
- // eslint-disable-next-line
884
- console.warn(`3D Tile: Required prop lodMetricType is undefined. Using parent lodMetricType`);
885
- }
886
- // This is used to compute screen space error, i.e., the error measured in pixels.
887
- if ('lodMetricValue' in header) {
888
- this._unscaledLodMetricValue = header.lodMetricValue;
889
- }
890
- else {
891
- // Inherit the source value, not the parent's world-space value. The child's complete
892
- // transform will be applied after transform initialization below.
893
- this._unscaledLodMetricValue = this.parent
894
- ? this.parent._unscaledLodMetricValue
895
- : this.tileset.lodMetricValue;
896
- // eslint-disable-next-line
897
- console.warn('3D Tile: Required prop lodMetricValue is undefined. Using parent lodMetricValue');
898
- }
899
- this.lodMetricValue = this._unscaledLodMetricValue;
900
- }
901
- _initializeTransforms(tileHeader) {
902
- // The local transform of this tile.
903
- this.transform = tileHeader.transform ? new Matrix4(tileHeader.transform) : new Matrix4();
904
- const parent = this.parent;
905
- const tileset = this.tileset;
906
- const parentTransform = parent && parent.computedTransform
907
- ? parent.computedTransform.clone()
908
- : tileset.modelMatrix.clone();
909
- this.computedTransform = new Matrix4(parentTransform).multiplyRight(this.transform);
910
- const parentInitialTransform = parent && parent._initialTransform ? parent._initialTransform.clone() : new Matrix4();
911
- this._initialTransform = new Matrix4(parentInitialTransform).multiplyRight(this.transform);
912
- }
913
- /**
914
- * Updates the world-space LOD metric from the source metric and the complete tile transform.
915
- *
916
- * 3D Tiles geometric error is a distance in the tile's local meters. Screen-space error (SSE)
917
- * compares that distance with a world-space camera distance, so both quantities must use the
918
- * same scale. For non-uniform transforms the largest axis scale is deliberately used: this is
919
- * conservative and prevents refinement from stopping while any transformed dimension can still
920
- * exceed the requested visual error. Rotation and translation do not affect the scale.
921
- *
922
- * I3S `maxScreenThreshold` is already a screen-space metric and must not be transform-scaled.
923
- */
924
- _updateLodMetricScale() {
925
- if (this.lodMetricType !== LOD_METRIC_TYPE.GEOMETRIC_ERROR || !this._scaleGeometricError) {
926
- this.lodMetricValue = this._unscaledLodMetricValue;
927
- return;
928
- }
929
- const transformScale = this.computedTransform.getScale(scratchVector);
930
- const maximumScale = Math.max(transformScale[0], transformScale[1], transformScale[2]);
931
- this.lodMetricValue = this._unscaledLodMetricValue * maximumScale;
932
- }
933
- _initializeBoundingVolumes(tileHeader) {
934
- this._contentBoundingVolume = null;
935
- this._contentBoundingVolumeHeaders = [];
936
- this._viewerRequestVolume = null;
937
- this._updateBoundingVolume(tileHeader);
938
- }
939
- _initializeContent(tileHeader) {
940
- // Empty tile by default
941
- this.content = { _tileset: this.tileset, _tile: this };
942
- this.contents = [];
943
- this.hasEmptyContent = true;
944
- this.contentState = TILE_CONTENT_STATE.UNLOADED;
945
- // When `true`, the tile's content points to an external tileset.
946
- // This is `false` until the tile's content is loaded.
947
- this.hasTilesetContent = false;
948
- if (tileHeader.contentUrl || tileHeader.contentUrls?.length) {
949
- this.content = null;
950
- this.hasEmptyContent = false;
951
- }
952
- }
953
- // TODO - remove anything not related to basic visibility detection
954
- _initializeRenderingState(header) {
955
- this.depth = header.level || (this.parent ? this.parent.depth + 1 : 0);
956
- this._shouldRefine = false;
957
- // Members this are updated every frame for tree traversal and rendering optimizations:
958
- this._distanceToCamera = 0;
959
- this._centerZDepth = 0;
960
- this._screenSpaceError = 0;
961
- this._screenSpaceErrorProgressiveResolution = 0;
962
- this._priorityProgressiveResolution = false;
963
- this._foveatedFactor = 0;
964
- this.priorityDeferred = false;
965
- this._visibilityPlaneMask = CullingVolume.MASK_INDETERMINATE;
966
- this._visible = undefined;
967
- this._inRequestVolume = false;
968
- this._stackLength = 0;
969
- this._selectionDepth = 0;
970
- this._frameNumber = 0;
971
- this._touchedFrame = 0;
972
- this._visitedFrame = 0;
973
- this._selectedFrame = 0;
974
- this._requestedFrame = 0;
975
- this._priority = 0.0;
976
- }
977
- _getRefine(refine) {
978
- // Inherit from parent tile if omitted.
979
- return refine || (this.parent && this.parent.refine) || TILE_REFINEMENT.REPLACE;
980
- }
981
- /**
982
- * Returns whether loaded content is an external tileset.
983
- *
984
- * Parsed shape is authoritative because valid external resources may be extensionless, signed,
985
- * or use a misleading filename. This method is called only after source loading has populated
986
- * `content`.
987
- */
988
- _isTileset() {
989
- return (this.contents.length ? this.contents : [this.content]).some(content => content?.shape === 'tileset3d');
990
- }
991
- _onContentLoaded() {
992
- // Vector and Geometry tile rendering do not support the skip LOD optimization.
993
- const contents = this.contents.length ? this.contents : [this.content];
994
- for (const content of contents) {
995
- switch (content && content.type) {
996
- case 'vctr':
997
- case 'geom':
998
- // @ts-ignore
999
- this.tileset._traverser.disableSkipLevelOfDetail = true;
1000
- break;
1001
- default:
1002
- }
1003
- }
1004
- // The content may be tileset json
1005
- if (this._isTileset()) {
1006
- this.hasTilesetContent = true;
1007
- }
1008
- else {
1009
- this.gpuMemoryUsageInBytes = this._getGpuMemoryUsageInBytes();
1010
- }
1011
- }
1012
- _updateBoundingVolume(header) {
1013
- this._boundingBox = undefined;
1014
- // Update the bounding volumes
1015
- this.boundingVolume = createBoundingVolume(header.boundingVolume, this.computedTransform, this.boundingVolume, this._initialTransform);
1016
- // Viewer request volumes constrain traversal, not just render content. A contentless implicit
1017
- // connector can still own an inherited request volume, so initialize it before the
1018
- // content-specific early return below.
1019
- if (header.viewerRequestVolume) {
1020
- this._viewerRequestVolume = createBoundingVolume(header.viewerRequestVolume, this.computedTransform, this._viewerRequestVolume, this._initialTransform);
1021
- }
1022
- const content = header.content;
1023
- if (content) {
1024
- this._contentBoundingVolumeHeaders = Array.isArray(content) ? content : [content];
1025
- }
1026
- const contentHeaders = content
1027
- ? Array.isArray(content)
1028
- ? content
1029
- : [content]
1030
- : this._contentBoundingVolumeHeaders;
1031
- // Preserve source order: an unbounded content entry uses the tile volume at its
1032
- // corresponding index rather than being appended after bounded sibling entries.
1033
- this._contentBoundingVolumes = contentHeaders.length
1034
- ? contentHeaders.map(headerEntry => headerEntry?.boundingVolume
1035
- ? createBoundingVolume(headerEntry.boundingVolume, this.computedTransform, undefined, this._initialTransform)
1036
- : this.boundingVolume)
1037
- : [this.boundingVolume];
1038
- this._contentBoundingVolume = this._contentBoundingVolumes[0] || null;
1039
- }
1040
- /**
1041
- * Updates the tile's computed transform, world-space geometric error, and bounding volumes.
1042
- * @param parentTransform - Current computed transform of the parent tile or tileset.
1043
- */
1044
- _updateTransform(parentTransform = new Matrix4()) {
1045
- const computedTransform = parentTransform.clone().multiplyRight(this.transform);
1046
- const didTransformChange = !computedTransform.equals(this.computedTransform);
1047
- if (!didTransformChange) {
1048
- return;
1049
- }
1050
- this.computedTransform = computedTransform;
1051
- // Recalculate from the unscaled source metric so repeated model-matrix changes never compound.
1052
- this._updateLodMetricScale();
1053
- this._updateBoundingVolume(this.header);
1054
- }
1055
- }
1056
- //# sourceMappingURL=tile-3d.js.map