@loaders.gl/3d-tiles 4.0.0-alpha.24 → 4.0.0-alpha.25
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/dist/dist.min.js +282 -177
- package/dist/es5/3d-tiles-archive-loader.js +1 -1
- package/dist/es5/lib/utils/version.js +1 -1
- package/dist/es5/types.js.map +1 -1
- package/dist/esm/3d-tiles-archive-loader.js +1 -1
- package/dist/esm/lib/utils/version.js +1 -1
- package/dist/esm/types.js.map +1 -1
- package/dist/types.d.ts +2 -5
- package/dist/types.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/types.ts +3 -5
package/dist/dist.min.js
CHANGED
|
@@ -69,16 +69,45 @@
|
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
+
// ../loader-utils/src/lib/option-utils/merge-loader-options.ts
|
|
73
|
+
function mergeLoaderOptions(baseOptions, newOptions) {
|
|
74
|
+
return mergeOptionsRecursively(baseOptions || {}, newOptions);
|
|
75
|
+
}
|
|
76
|
+
function mergeOptionsRecursively(baseOptions, newOptions) {
|
|
77
|
+
const options = { ...baseOptions };
|
|
78
|
+
for (const [key, newValue] of Object.entries(newOptions)) {
|
|
79
|
+
if (newValue && typeof newValue === "object" && !Array.isArray(newValue)) {
|
|
80
|
+
options[key] = mergeOptionsRecursively(options[key] || {}, newOptions[key]);
|
|
81
|
+
} else {
|
|
82
|
+
options[key] = newOptions[key];
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return options;
|
|
86
|
+
}
|
|
87
|
+
var init_merge_loader_options = __esm({
|
|
88
|
+
"../loader-utils/src/lib/option-utils/merge-loader-options.ts"() {
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
|
|
72
92
|
// ../worker-utils/src/lib/env-utils/version.ts
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
DEFAULT_VERSION = "beta";
|
|
77
|
-
VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : DEFAULT_VERSION;
|
|
93
|
+
function getVersion() {
|
|
94
|
+
if (!globalThis._loadersgl_?.version) {
|
|
95
|
+
globalThis._loadersgl_ = globalThis._loadersgl_ || {};
|
|
78
96
|
if (typeof __VERSION__ === "undefined") {
|
|
79
97
|
console.error("loaders.gl: The __VERSION__ variable is not injected using babel plugin. Latest unstable workers would be fetched from the CDN.");
|
|
98
|
+
globalThis._loadersgl_.version = NPM_TAG;
|
|
99
|
+
} else {
|
|
100
|
+
globalThis._loadersgl_.version = __VERSION__;
|
|
80
101
|
}
|
|
81
102
|
}
|
|
103
|
+
return globalThis._loadersgl_.version;
|
|
104
|
+
}
|
|
105
|
+
var NPM_TAG, VERSION;
|
|
106
|
+
var init_version = __esm({
|
|
107
|
+
"../worker-utils/src/lib/env-utils/version.ts"() {
|
|
108
|
+
NPM_TAG = "beta";
|
|
109
|
+
VERSION = getVersion();
|
|
110
|
+
}
|
|
82
111
|
});
|
|
83
112
|
|
|
84
113
|
// ../worker-utils/src/lib/env-utils/assert.ts
|
|
@@ -543,12 +572,11 @@
|
|
|
543
572
|
assert3(url);
|
|
544
573
|
return url;
|
|
545
574
|
}
|
|
546
|
-
var NPM_TAG;
|
|
547
575
|
var init_get_worker_url = __esm({
|
|
548
576
|
"../worker-utils/src/lib/worker-api/get-worker-url.ts"() {
|
|
549
577
|
init_assert2();
|
|
550
578
|
init_globals2();
|
|
551
|
-
|
|
579
|
+
init_version();
|
|
552
580
|
}
|
|
553
581
|
});
|
|
554
582
|
|
|
@@ -596,7 +624,7 @@
|
|
|
596
624
|
}
|
|
597
625
|
if (options.CDN) {
|
|
598
626
|
assert3(options.CDN.startsWith("http"));
|
|
599
|
-
return `${options.CDN}/${moduleName}@${
|
|
627
|
+
return `${options.CDN}/${moduleName}@${VERSION}/dist/libs/${libraryName}`;
|
|
600
628
|
}
|
|
601
629
|
if (isWorker) {
|
|
602
630
|
return `../src/libs/${libraryName}`;
|
|
@@ -652,15 +680,13 @@
|
|
|
652
680
|
}
|
|
653
681
|
return await node.readFileAsText(url);
|
|
654
682
|
}
|
|
655
|
-
var node,
|
|
683
|
+
var node, loadLibraryPromises;
|
|
656
684
|
var init_library_utils = __esm({
|
|
657
685
|
"../worker-utils/src/lib/library-utils/library-utils.ts"() {
|
|
658
686
|
init_globals2();
|
|
659
687
|
node = __toModule(require_require_utils());
|
|
660
688
|
init_assert2();
|
|
661
689
|
init_version();
|
|
662
|
-
LATEST = "beta";
|
|
663
|
-
VERSION2 = typeof VERSION !== "undefined" ? VERSION : LATEST;
|
|
664
690
|
loadLibraryPromises = {};
|
|
665
691
|
}
|
|
666
692
|
});
|
|
@@ -1190,6 +1216,12 @@
|
|
|
1190
1216
|
}
|
|
1191
1217
|
});
|
|
1192
1218
|
|
|
1219
|
+
// ../loader-utils/src/lib/node/fs.browser.ts
|
|
1220
|
+
var init_fs_browser = __esm({
|
|
1221
|
+
"../loader-utils/src/lib/node/fs.browser.ts"() {
|
|
1222
|
+
}
|
|
1223
|
+
});
|
|
1224
|
+
|
|
1193
1225
|
// ../loader-utils/src/lib/file-provider/file-provider.ts
|
|
1194
1226
|
var isFileProvider;
|
|
1195
1227
|
var init_file_provider = __esm({
|
|
@@ -1200,22 +1232,16 @@
|
|
|
1200
1232
|
}
|
|
1201
1233
|
});
|
|
1202
1234
|
|
|
1203
|
-
// (disabled):fs
|
|
1204
|
-
var init_fs = __esm({
|
|
1205
|
-
"(disabled):fs"() {
|
|
1206
|
-
}
|
|
1207
|
-
});
|
|
1208
|
-
|
|
1209
1235
|
// ../loader-utils/src/lib/file-provider/file-handle.ts
|
|
1210
1236
|
var FileHandle;
|
|
1211
1237
|
var init_file_handle = __esm({
|
|
1212
1238
|
"../loader-utils/src/lib/file-provider/file-handle.ts"() {
|
|
1213
|
-
|
|
1239
|
+
init_fs_browser();
|
|
1214
1240
|
FileHandle = class {
|
|
1215
1241
|
constructor(fileDescriptor, stats) {
|
|
1216
1242
|
this.read = (buffer, offset, length4, position) => {
|
|
1217
1243
|
return new Promise((s2) => {
|
|
1218
|
-
(0
|
|
1244
|
+
(void 0)(this.fileDescriptor, buffer, offset, length4, position, (_err, bytesRead, buffer2) => s2({ bytesRead, buffer: buffer2 }));
|
|
1219
1245
|
});
|
|
1220
1246
|
};
|
|
1221
1247
|
this.fileDescriptor = fileDescriptor;
|
|
@@ -1224,18 +1250,14 @@
|
|
|
1224
1250
|
static async open(path) {
|
|
1225
1251
|
const [fd, stats] = await Promise.all([
|
|
1226
1252
|
new Promise((resolve2, reject) => {
|
|
1227
|
-
(0
|
|
1253
|
+
(void 0)(path, void 0, void 0, (_err, fd2) => _err ? reject(_err) : resolve2(fd2));
|
|
1228
1254
|
}),
|
|
1229
|
-
|
|
1230
|
-
(0, import_fs.stat)(path, { bigint: true }, (_err, stats2) => _err ? reject(_err) : resolve2(stats2));
|
|
1231
|
-
})
|
|
1255
|
+
(void 0)(path, { bigint: true })
|
|
1232
1256
|
]);
|
|
1233
1257
|
return new FileHandle(fd, stats);
|
|
1234
1258
|
}
|
|
1235
1259
|
async close() {
|
|
1236
|
-
return
|
|
1237
|
-
(0, import_fs.close)(this.fileDescriptor, (_err) => resolve2());
|
|
1238
|
-
});
|
|
1260
|
+
return (void 0)(this.fileDescriptor);
|
|
1239
1261
|
}
|
|
1240
1262
|
get stat() {
|
|
1241
1263
|
return this.stats;
|
|
@@ -1350,6 +1372,7 @@
|
|
|
1350
1372
|
init_loader_types();
|
|
1351
1373
|
init_assert();
|
|
1352
1374
|
init_globals();
|
|
1375
|
+
init_merge_loader_options();
|
|
1353
1376
|
init_parse_with_worker();
|
|
1354
1377
|
init_parse_json();
|
|
1355
1378
|
init_array_buffer_utils();
|
|
@@ -5767,11 +5790,11 @@
|
|
|
5767
5790
|
});
|
|
5768
5791
|
|
|
5769
5792
|
// ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/utils/globals.js
|
|
5770
|
-
var
|
|
5793
|
+
var VERSION2, isBrowser4;
|
|
5771
5794
|
var init_globals4 = __esm({
|
|
5772
5795
|
"../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/utils/globals.js"() {
|
|
5773
5796
|
init_is_browser();
|
|
5774
|
-
|
|
5797
|
+
VERSION2 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
|
|
5775
5798
|
isBrowser4 = isBrowser3();
|
|
5776
5799
|
}
|
|
5777
5800
|
});
|
|
@@ -6108,7 +6131,7 @@
|
|
|
6108
6131
|
id: ""
|
|
6109
6132
|
};
|
|
6110
6133
|
_defineProperty(this, "id", void 0);
|
|
6111
|
-
_defineProperty(this, "VERSION",
|
|
6134
|
+
_defineProperty(this, "VERSION", VERSION2);
|
|
6112
6135
|
_defineProperty(this, "_startTs", getHiResTimestamp());
|
|
6113
6136
|
_defineProperty(this, "_deltaTs", getHiResTimestamp());
|
|
6114
6137
|
_defineProperty(this, "_storage", void 0);
|
|
@@ -6311,7 +6334,7 @@
|
|
|
6311
6334
|
return noop;
|
|
6312
6335
|
}
|
|
6313
6336
|
};
|
|
6314
|
-
_defineProperty(Log, "VERSION",
|
|
6337
|
+
_defineProperty(Log, "VERSION", VERSION2);
|
|
6315
6338
|
}
|
|
6316
6339
|
});
|
|
6317
6340
|
|
|
@@ -7049,6 +7072,7 @@
|
|
|
7049
7072
|
}
|
|
7050
7073
|
async function parseWithLoader(loader, data, options, context) {
|
|
7051
7074
|
validateWorkerVersion(loader);
|
|
7075
|
+
options = mergeLoaderOptions(loader.options, options);
|
|
7052
7076
|
if (isResponse(data)) {
|
|
7053
7077
|
const response = data;
|
|
7054
7078
|
const { ok, redirected, status, statusText, type, url } = response;
|
|
@@ -7079,6 +7103,7 @@
|
|
|
7079
7103
|
init_normalize_loader();
|
|
7080
7104
|
init_is_type();
|
|
7081
7105
|
init_option_utils();
|
|
7106
|
+
init_src2();
|
|
7082
7107
|
init_get_data();
|
|
7083
7108
|
init_loader_context();
|
|
7084
7109
|
init_resource_utils();
|
|
@@ -7158,10 +7183,10 @@
|
|
|
7158
7183
|
});
|
|
7159
7184
|
|
|
7160
7185
|
// src/lib/utils/version.ts
|
|
7161
|
-
var
|
|
7186
|
+
var VERSION3;
|
|
7162
7187
|
var init_version2 = __esm({
|
|
7163
7188
|
"src/lib/utils/version.ts"() {
|
|
7164
|
-
|
|
7189
|
+
VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
7165
7190
|
}
|
|
7166
7191
|
});
|
|
7167
7192
|
|
|
@@ -7207,10 +7232,10 @@
|
|
|
7207
7232
|
});
|
|
7208
7233
|
|
|
7209
7234
|
// ../draco/src/lib/utils/version.ts
|
|
7210
|
-
var
|
|
7235
|
+
var VERSION4;
|
|
7211
7236
|
var init_version3 = __esm({
|
|
7212
7237
|
"../draco/src/lib/utils/version.ts"() {
|
|
7213
|
-
|
|
7238
|
+
VERSION4 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
7214
7239
|
}
|
|
7215
7240
|
});
|
|
7216
7241
|
|
|
@@ -7231,7 +7256,7 @@
|
|
|
7231
7256
|
name: "Draco",
|
|
7232
7257
|
id: "draco",
|
|
7233
7258
|
module: "draco",
|
|
7234
|
-
version:
|
|
7259
|
+
version: VERSION4,
|
|
7235
7260
|
worker: true,
|
|
7236
7261
|
extensions: ["drc"],
|
|
7237
7262
|
mimeTypes: ["application/octet-stream"],
|
|
@@ -9060,10 +9085,10 @@
|
|
|
9060
9085
|
});
|
|
9061
9086
|
|
|
9062
9087
|
// ../images/src/lib/utils/version.ts
|
|
9063
|
-
var
|
|
9088
|
+
var VERSION5;
|
|
9064
9089
|
var init_version4 = __esm({
|
|
9065
9090
|
"../images/src/lib/utils/version.ts"() {
|
|
9066
|
-
|
|
9091
|
+
VERSION5 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
9067
9092
|
}
|
|
9068
9093
|
});
|
|
9069
9094
|
|
|
@@ -9512,7 +9537,7 @@
|
|
|
9512
9537
|
id: "image",
|
|
9513
9538
|
module: "images",
|
|
9514
9539
|
name: "Images",
|
|
9515
|
-
version:
|
|
9540
|
+
version: VERSION5,
|
|
9516
9541
|
mimeTypes: MIME_TYPES,
|
|
9517
9542
|
extensions: EXTENSIONS,
|
|
9518
9543
|
parse: parseImage,
|
|
@@ -9582,6 +9607,30 @@
|
|
|
9582
9607
|
}
|
|
9583
9608
|
});
|
|
9584
9609
|
|
|
9610
|
+
// ../gltf/src/lib/gltf-utils/gltf-constants.ts
|
|
9611
|
+
var COMPONENTS, BYTES;
|
|
9612
|
+
var init_gltf_constants = __esm({
|
|
9613
|
+
"../gltf/src/lib/gltf-utils/gltf-constants.ts"() {
|
|
9614
|
+
COMPONENTS = {
|
|
9615
|
+
SCALAR: 1,
|
|
9616
|
+
VEC2: 2,
|
|
9617
|
+
VEC3: 3,
|
|
9618
|
+
VEC4: 4,
|
|
9619
|
+
MAT2: 4,
|
|
9620
|
+
MAT3: 9,
|
|
9621
|
+
MAT4: 16
|
|
9622
|
+
};
|
|
9623
|
+
BYTES = {
|
|
9624
|
+
5120: 1,
|
|
9625
|
+
5121: 1,
|
|
9626
|
+
5122: 2,
|
|
9627
|
+
5123: 2,
|
|
9628
|
+
5125: 4,
|
|
9629
|
+
5126: 4
|
|
9630
|
+
};
|
|
9631
|
+
}
|
|
9632
|
+
});
|
|
9633
|
+
|
|
9585
9634
|
// ../gltf/src/lib/gltf-utils/gltf-utils.ts
|
|
9586
9635
|
function getAccessorTypeFromSize(size) {
|
|
9587
9636
|
const type = TYPES[size - 1];
|
|
@@ -9603,6 +9652,27 @@
|
|
|
9603
9652
|
assert7(byteLength >= 0 && byteLength <= bufferView.byteLength);
|
|
9604
9653
|
return { ArrayType, length: length4, byteLength };
|
|
9605
9654
|
}
|
|
9655
|
+
function getFloat32ArrayForAccessor(gltfData, texCoordAccessor) {
|
|
9656
|
+
const accessor = gltfData.json.accessors?.[texCoordAccessor];
|
|
9657
|
+
if (accessor && typeof accessor.bufferView !== "undefined") {
|
|
9658
|
+
const bufferView = gltfData.json.bufferViews?.[accessor.bufferView];
|
|
9659
|
+
if (bufferView) {
|
|
9660
|
+
const { arrayBuffer, byteOffset: bufferByteOffset } = gltfData.buffers[bufferView.buffer];
|
|
9661
|
+
const byteOffset = (bufferByteOffset || 0) + (accessor.byteOffset || 0) + (bufferView.byteOffset || 0);
|
|
9662
|
+
const { ArrayType, length: length4 } = getAccessorArrayTypeAndLength(accessor, bufferView);
|
|
9663
|
+
const bytes = BYTES[accessor.componentType];
|
|
9664
|
+
const components = COMPONENTS[accessor.type];
|
|
9665
|
+
const elementAddressScale = bufferView.byteStride || bytes * components;
|
|
9666
|
+
const result = new Float32Array(length4);
|
|
9667
|
+
for (let i2 = 0; i2 < accessor.count; i2++) {
|
|
9668
|
+
const uv = new ArrayType(arrayBuffer, byteOffset + i2 * elementAddressScale, 2);
|
|
9669
|
+
result.set(uv, i2 * components);
|
|
9670
|
+
}
|
|
9671
|
+
return result;
|
|
9672
|
+
}
|
|
9673
|
+
}
|
|
9674
|
+
return null;
|
|
9675
|
+
}
|
|
9606
9676
|
function getMemoryUsageGLTF(gltf) {
|
|
9607
9677
|
let { images, bufferViews } = gltf;
|
|
9608
9678
|
images = images || [];
|
|
@@ -9620,6 +9690,7 @@
|
|
|
9620
9690
|
var init_gltf_utils = __esm({
|
|
9621
9691
|
"../gltf/src/lib/gltf-utils/gltf-utils.ts"() {
|
|
9622
9692
|
init_assert6();
|
|
9693
|
+
init_gltf_constants();
|
|
9623
9694
|
MIPMAP_FACTOR = 1.33;
|
|
9624
9695
|
TYPES = ["SCALAR", "VEC2", "VEC3", "VEC4"];
|
|
9625
9696
|
ARRAY_CONSTRUCTOR_TO_WEBGL_CONSTANT = [
|
|
@@ -10116,9 +10187,10 @@
|
|
|
10116
10187
|
const json = scenegraph.gltf.json;
|
|
10117
10188
|
const texCoordAccessorKey = `TEXCOORD_${textureInfo.texCoord || 0}`;
|
|
10118
10189
|
const texCoordAccessorIndex = primitive.attributes[texCoordAccessorKey];
|
|
10119
|
-
const
|
|
10120
|
-
|
|
10121
|
-
|
|
10190
|
+
const textureCoordinates = getFloat32ArrayForAccessor(scenegraph.gltf, texCoordAccessorIndex);
|
|
10191
|
+
if (!textureCoordinates) {
|
|
10192
|
+
return null;
|
|
10193
|
+
}
|
|
10122
10194
|
const textureIndex = textureInfo.index;
|
|
10123
10195
|
const imageIndex = json.textures?.[textureIndex]?.source;
|
|
10124
10196
|
if (typeof imageIndex !== "undefined") {
|
|
@@ -10136,8 +10208,9 @@
|
|
|
10136
10208
|
return null;
|
|
10137
10209
|
}
|
|
10138
10210
|
function primitivePropertyDataToAttributes(scenegraph, attributeName, propertyData, featureTable, primitive) {
|
|
10139
|
-
if (propertyData
|
|
10211
|
+
if (!propertyData?.length) {
|
|
10140
10212
|
return;
|
|
10213
|
+
}
|
|
10141
10214
|
const featureIndices = [];
|
|
10142
10215
|
for (const texelData of propertyData) {
|
|
10143
10216
|
let index = featureTable.findIndex((item) => item === texelData);
|
|
@@ -10161,12 +10234,12 @@
|
|
|
10161
10234
|
primitive.attributes[attributeName] = accessorIndex;
|
|
10162
10235
|
}
|
|
10163
10236
|
function getImageValueByCoordinates(parsedImage, mimeType, textureCoordinates, index, channels = [0]) {
|
|
10164
|
-
const CHANNELS_MAP =
|
|
10165
|
-
{ offset: 0, shift: 0 },
|
|
10166
|
-
{ offset: 1, shift: 8 },
|
|
10167
|
-
{ offset: 2, shift: 16 },
|
|
10168
|
-
{ offset: 3, shift: 24 }
|
|
10169
|
-
|
|
10237
|
+
const CHANNELS_MAP = {
|
|
10238
|
+
r: { offset: 0, shift: 0 },
|
|
10239
|
+
g: { offset: 1, shift: 8 },
|
|
10240
|
+
b: { offset: 2, shift: 16 },
|
|
10241
|
+
a: { offset: 3, shift: 24 }
|
|
10242
|
+
};
|
|
10170
10243
|
const u = textureCoordinates[index];
|
|
10171
10244
|
const v = textureCoordinates[index + 1];
|
|
10172
10245
|
let components = 1;
|
|
@@ -10175,7 +10248,7 @@
|
|
|
10175
10248
|
const offset = coordinatesToOffset(u, v, parsedImage, components);
|
|
10176
10249
|
let value = 0;
|
|
10177
10250
|
for (const c of channels) {
|
|
10178
|
-
const map2 = CHANNELS_MAP[c];
|
|
10251
|
+
const map2 = typeof c === "number" ? Object.values(CHANNELS_MAP)[c] : CHANNELS_MAP[c];
|
|
10179
10252
|
const imageOffset = offset + map2.offset;
|
|
10180
10253
|
const imageData = getImageData(parsedImage);
|
|
10181
10254
|
if (imageData.data.length <= imageOffset) {
|
|
@@ -10242,17 +10315,91 @@
|
|
|
10242
10315
|
}
|
|
10243
10316
|
});
|
|
10244
10317
|
|
|
10318
|
+
// ../gltf/src/lib/extensions/EXT_mesh_features.ts
|
|
10319
|
+
var EXT_mesh_features_exports = {};
|
|
10320
|
+
__export(EXT_mesh_features_exports, {
|
|
10321
|
+
decode: () => decode,
|
|
10322
|
+
name: () => name
|
|
10323
|
+
});
|
|
10324
|
+
async function decode(gltfData, options) {
|
|
10325
|
+
const scenegraph = new GLTFScenegraph(gltfData);
|
|
10326
|
+
decodeExtMeshFeatures(scenegraph, options);
|
|
10327
|
+
}
|
|
10328
|
+
function decodeExtMeshFeatures(scenegraph, options) {
|
|
10329
|
+
const json = scenegraph.gltf.json;
|
|
10330
|
+
if (!json.meshes) {
|
|
10331
|
+
return;
|
|
10332
|
+
}
|
|
10333
|
+
for (const mesh of json.meshes) {
|
|
10334
|
+
for (const primitive of mesh.primitives) {
|
|
10335
|
+
processMeshPrimitiveFeatures(scenegraph, primitive, options);
|
|
10336
|
+
}
|
|
10337
|
+
}
|
|
10338
|
+
}
|
|
10339
|
+
function processMeshPrimitiveFeatures(scenegraph, primitive, options) {
|
|
10340
|
+
if (!options?.gltf?.loadBuffers) {
|
|
10341
|
+
return;
|
|
10342
|
+
}
|
|
10343
|
+
const extension = primitive.extensions?.[EXT_MESH_FEATURES_NAME];
|
|
10344
|
+
const featureIds = extension?.featureIds;
|
|
10345
|
+
if (!featureIds) {
|
|
10346
|
+
return;
|
|
10347
|
+
}
|
|
10348
|
+
for (const featureId of featureIds) {
|
|
10349
|
+
let featureIdData = null;
|
|
10350
|
+
if (typeof featureId.attribute !== "undefined") {
|
|
10351
|
+
const accessorKey = `_FEATURE_ID_${featureId.attribute}`;
|
|
10352
|
+
const accessorIndex = primitive.attributes[accessorKey];
|
|
10353
|
+
featureIdData = scenegraph.getTypedArrayForAccessor(accessorIndex);
|
|
10354
|
+
} else if (typeof featureId.texture !== "undefined" && options?.gltf?.loadImages) {
|
|
10355
|
+
featureIdData = getPrimitiveTextureData(scenegraph, featureId.texture, primitive);
|
|
10356
|
+
} else {
|
|
10357
|
+
}
|
|
10358
|
+
featureId.data = featureIdData;
|
|
10359
|
+
}
|
|
10360
|
+
}
|
|
10361
|
+
var EXT_MESH_FEATURES_NAME, name;
|
|
10362
|
+
var init_EXT_mesh_features = __esm({
|
|
10363
|
+
"../gltf/src/lib/extensions/EXT_mesh_features.ts"() {
|
|
10364
|
+
init_gltf_scenegraph();
|
|
10365
|
+
init_d_tiles_utils();
|
|
10366
|
+
EXT_MESH_FEATURES_NAME = "EXT_mesh_features";
|
|
10367
|
+
name = EXT_MESH_FEATURES_NAME;
|
|
10368
|
+
}
|
|
10369
|
+
});
|
|
10370
|
+
|
|
10245
10371
|
// ../gltf/src/lib/extensions/EXT_structural_metadata.ts
|
|
10246
10372
|
var EXT_structural_metadata_exports = {};
|
|
10247
10373
|
__export(EXT_structural_metadata_exports, {
|
|
10248
|
-
decode: () =>
|
|
10374
|
+
decode: () => decode2,
|
|
10375
|
+
getPropertyTableFromExtStructuralMetadata: () => getPropertyTableFromExtStructuralMetadata,
|
|
10249
10376
|
getPropertyTablePopulated: () => getPropertyTablePopulated,
|
|
10250
|
-
name: () =>
|
|
10377
|
+
name: () => name2
|
|
10251
10378
|
});
|
|
10252
|
-
async function
|
|
10379
|
+
async function decode2(gltfData, options) {
|
|
10253
10380
|
const scenegraph = new GLTFScenegraph(gltfData);
|
|
10254
10381
|
decodeExtStructuralMetadata(scenegraph, options);
|
|
10255
10382
|
}
|
|
10383
|
+
function getPropertyTableFromExtStructuralMetadata(extension, metadataClass) {
|
|
10384
|
+
if (extension.propertyTables) {
|
|
10385
|
+
const firstPropertyTable = extension?.propertyTables[0];
|
|
10386
|
+
const propertyTableWithData = {};
|
|
10387
|
+
for (const propertyName in firstPropertyTable.properties) {
|
|
10388
|
+
propertyTableWithData[propertyName] = firstPropertyTable.properties[propertyName].data;
|
|
10389
|
+
}
|
|
10390
|
+
return propertyTableWithData;
|
|
10391
|
+
}
|
|
10392
|
+
if (extension.propertyTextures) {
|
|
10393
|
+
const firstPropertyTexture = extension?.propertyTextures[0];
|
|
10394
|
+
const propertyTableWithData = {};
|
|
10395
|
+
for (const propertyName in firstPropertyTexture.properties) {
|
|
10396
|
+
propertyTableWithData[propertyName] = firstPropertyTexture.properties[propertyName].data;
|
|
10397
|
+
}
|
|
10398
|
+
return propertyTableWithData;
|
|
10399
|
+
}
|
|
10400
|
+
console.warn("Cannot get property table from EXT_structural_metadata extension. There is neither propertyTables, nor propertyTextures in the extension.");
|
|
10401
|
+
return null;
|
|
10402
|
+
}
|
|
10256
10403
|
function getPropertyTablePopulated(scenegraph, propertyTableIndex) {
|
|
10257
10404
|
const extension = scenegraph.getExtension(EXT_STRUCTURAL_METADATA_NAME);
|
|
10258
10405
|
const propertyTable = extension?.propertyTables?.[propertyTableIndex];
|
|
@@ -10263,33 +10410,47 @@
|
|
|
10263
10410
|
throw new Error(`Incorrect data in the EXT_structural_metadata extension: no property table with index ${propertyTableIndex}`);
|
|
10264
10411
|
}
|
|
10265
10412
|
function decodeExtStructuralMetadata(scenegraph, options) {
|
|
10413
|
+
if (!options.gltf?.loadBuffers) {
|
|
10414
|
+
return;
|
|
10415
|
+
}
|
|
10266
10416
|
const extension = scenegraph.getExtension(EXT_STRUCTURAL_METADATA_NAME);
|
|
10267
|
-
if (!extension
|
|
10417
|
+
if (!extension) {
|
|
10268
10418
|
return;
|
|
10269
10419
|
}
|
|
10420
|
+
if (options.gltf?.loadImages) {
|
|
10421
|
+
decodePropertyTextures(scenegraph, extension);
|
|
10422
|
+
}
|
|
10423
|
+
decodePropertyTables(scenegraph, extension);
|
|
10424
|
+
}
|
|
10425
|
+
function decodePropertyTextures(scenegraph, extension) {
|
|
10270
10426
|
const propertyTextures = extension.propertyTextures;
|
|
10271
10427
|
const json = scenegraph.gltf.json;
|
|
10272
|
-
if (propertyTextures && json.meshes
|
|
10428
|
+
if (propertyTextures && json.meshes) {
|
|
10273
10429
|
for (const mesh of json.meshes) {
|
|
10274
10430
|
for (const primitive of mesh.primitives) {
|
|
10275
10431
|
processPrimitivePropertyTextures(scenegraph, propertyTextures, primitive, extension);
|
|
10276
10432
|
}
|
|
10277
10433
|
}
|
|
10278
10434
|
}
|
|
10279
|
-
|
|
10435
|
+
}
|
|
10436
|
+
function decodePropertyTables(scenegraph, extension) {
|
|
10437
|
+
const schema = extension.schema;
|
|
10438
|
+
if (!schema) {
|
|
10439
|
+
return;
|
|
10440
|
+
}
|
|
10441
|
+
const schemaClasses = schema.classes;
|
|
10280
10442
|
const propertyTables = extension.propertyTables;
|
|
10281
10443
|
if (schemaClasses && propertyTables) {
|
|
10282
10444
|
for (const schemaName in schemaClasses) {
|
|
10283
10445
|
const propertyTable = findPropertyTableByClass(propertyTables, schemaName);
|
|
10284
10446
|
if (propertyTable) {
|
|
10285
|
-
processPropertyTable(scenegraph,
|
|
10447
|
+
processPropertyTable(scenegraph, schema, propertyTable);
|
|
10286
10448
|
}
|
|
10287
10449
|
}
|
|
10288
10450
|
}
|
|
10289
10451
|
}
|
|
10290
10452
|
function findPropertyTableByClass(propertyTables, schemaClassName) {
|
|
10291
|
-
for (
|
|
10292
|
-
const propertyTable = propertyTables[i2];
|
|
10453
|
+
for (const propertyTable of propertyTables) {
|
|
10293
10454
|
if (propertyTable.class === schemaClassName) {
|
|
10294
10455
|
return propertyTable;
|
|
10295
10456
|
}
|
|
@@ -10318,9 +10479,9 @@
|
|
|
10318
10479
|
extension.dataAttributeNames = [];
|
|
10319
10480
|
}
|
|
10320
10481
|
const className = propertyTexture.class;
|
|
10321
|
-
for (const
|
|
10322
|
-
const attributeName = `${className}_${
|
|
10323
|
-
const textureInfoTopLevel = propertyTexture.properties?.[
|
|
10482
|
+
for (const propertyName in propertyTexture.properties) {
|
|
10483
|
+
const attributeName = `${className}_${propertyName}`;
|
|
10484
|
+
const textureInfoTopLevel = propertyTexture.properties?.[propertyName];
|
|
10324
10485
|
if (!textureInfoTopLevel) {
|
|
10325
10486
|
continue;
|
|
10326
10487
|
}
|
|
@@ -10386,14 +10547,14 @@
|
|
|
10386
10547
|
return data;
|
|
10387
10548
|
}
|
|
10388
10549
|
function getArrayOffsetsForProperty(scenegraph, classProperty, propertyTableProperty, numberOfElements) {
|
|
10389
|
-
if (classProperty.array && typeof classProperty.count === "undefined" && typeof propertyTableProperty.arrayOffsets !== "undefined"
|
|
10390
|
-
return getOffsetsForProperty(scenegraph, propertyTableProperty.arrayOffsets, propertyTableProperty.arrayOffsetType, numberOfElements);
|
|
10550
|
+
if (classProperty.array && typeof classProperty.count === "undefined" && typeof propertyTableProperty.arrayOffsets !== "undefined") {
|
|
10551
|
+
return getOffsetsForProperty(scenegraph, propertyTableProperty.arrayOffsets, propertyTableProperty.arrayOffsetType || "UINT32", numberOfElements);
|
|
10391
10552
|
}
|
|
10392
10553
|
return null;
|
|
10393
10554
|
}
|
|
10394
10555
|
function getStringOffsetsForProperty(scenegraph, propertyTableProperty, numberOfElements) {
|
|
10395
|
-
if (typeof propertyTableProperty.stringOffsets !== "undefined"
|
|
10396
|
-
return getOffsetsForProperty(scenegraph, propertyTableProperty.stringOffsets, propertyTableProperty.stringOffsetType, numberOfElements);
|
|
10556
|
+
if (typeof propertyTableProperty.stringOffsets !== "undefined") {
|
|
10557
|
+
return getOffsetsForProperty(scenegraph, propertyTableProperty.stringOffsets, propertyTableProperty.stringOffsetType || "UINT32", numberOfElements);
|
|
10397
10558
|
}
|
|
10398
10559
|
return null;
|
|
10399
10560
|
}
|
|
@@ -10557,79 +10718,13 @@
|
|
|
10557
10718
|
}
|
|
10558
10719
|
return null;
|
|
10559
10720
|
}
|
|
10560
|
-
var EXT_STRUCTURAL_METADATA_NAME,
|
|
10721
|
+
var EXT_STRUCTURAL_METADATA_NAME, name2;
|
|
10561
10722
|
var init_EXT_structural_metadata = __esm({
|
|
10562
10723
|
"../gltf/src/lib/extensions/EXT_structural_metadata.ts"() {
|
|
10563
10724
|
init_gltf_scenegraph();
|
|
10564
10725
|
init_d_tiles_utils();
|
|
10565
10726
|
EXT_STRUCTURAL_METADATA_NAME = "EXT_structural_metadata";
|
|
10566
|
-
|
|
10567
|
-
}
|
|
10568
|
-
});
|
|
10569
|
-
|
|
10570
|
-
// ../gltf/src/lib/extensions/EXT_mesh_features.ts
|
|
10571
|
-
var EXT_mesh_features_exports = {};
|
|
10572
|
-
__export(EXT_mesh_features_exports, {
|
|
10573
|
-
decode: () => decode2,
|
|
10574
|
-
name: () => name2
|
|
10575
|
-
});
|
|
10576
|
-
async function decode2(gltfData, options) {
|
|
10577
|
-
const scenegraph = new GLTFScenegraph(gltfData);
|
|
10578
|
-
decodeExtMeshFeatures(scenegraph, options);
|
|
10579
|
-
}
|
|
10580
|
-
function decodeExtMeshFeatures(scenegraph, options) {
|
|
10581
|
-
const json = scenegraph.gltf.json;
|
|
10582
|
-
if (!json.meshes) {
|
|
10583
|
-
return;
|
|
10584
|
-
}
|
|
10585
|
-
for (const mesh of json.meshes) {
|
|
10586
|
-
for (const primitive of mesh.primitives) {
|
|
10587
|
-
processMeshPrimitiveFeatures(scenegraph, primitive, options);
|
|
10588
|
-
}
|
|
10589
|
-
}
|
|
10590
|
-
}
|
|
10591
|
-
function processMeshPrimitiveFeatures(scenegraph, primitive, options) {
|
|
10592
|
-
const extension = primitive.extensions?.[EXT_MESH_FEATURES_NAME];
|
|
10593
|
-
const featureIds = extension?.featureIds;
|
|
10594
|
-
if (!featureIds)
|
|
10595
|
-
return;
|
|
10596
|
-
if (!extension.dataAttributeNames) {
|
|
10597
|
-
extension.dataAttributeNames = [];
|
|
10598
|
-
}
|
|
10599
|
-
let featureIdCount = 0;
|
|
10600
|
-
for (const featureId of featureIds) {
|
|
10601
|
-
let propertyTable = null;
|
|
10602
|
-
if (typeof featureId.propertyTable === "number") {
|
|
10603
|
-
propertyTable = getPropertyTablePopulated(scenegraph, featureId.propertyTable);
|
|
10604
|
-
}
|
|
10605
|
-
let propertyData = null;
|
|
10606
|
-
if (typeof featureId.attribute !== "undefined") {
|
|
10607
|
-
const accessorKey = `_FEATURE_ID_${featureId.attribute}`;
|
|
10608
|
-
const accessorIndex = primitive.attributes[accessorKey];
|
|
10609
|
-
const propertyDataTypedArray = scenegraph.getTypedArrayForAccessor(accessorIndex);
|
|
10610
|
-
propertyData = Array.prototype.slice.call(propertyDataTypedArray);
|
|
10611
|
-
} else if (typeof featureId.texture !== "undefined" && options?.gltf?.loadImages) {
|
|
10612
|
-
propertyData = getPrimitiveTextureData(scenegraph, featureId.texture, primitive);
|
|
10613
|
-
} else {
|
|
10614
|
-
}
|
|
10615
|
-
const attributeName = featureId.label || propertyTable?.name || `featureAttribute${featureIdCount}`;
|
|
10616
|
-
const featureTable = [];
|
|
10617
|
-
if (propertyData) {
|
|
10618
|
-
primitivePropertyDataToAttributes(scenegraph, attributeName, propertyData, featureTable, primitive);
|
|
10619
|
-
}
|
|
10620
|
-
extension.dataAttributeNames.push(attributeName);
|
|
10621
|
-
featureId.data = featureTable;
|
|
10622
|
-
featureIdCount++;
|
|
10623
|
-
}
|
|
10624
|
-
}
|
|
10625
|
-
var EXT_MESH_FEATURES_NAME, name2;
|
|
10626
|
-
var init_EXT_mesh_features = __esm({
|
|
10627
|
-
"../gltf/src/lib/extensions/EXT_mesh_features.ts"() {
|
|
10628
|
-
init_gltf_scenegraph();
|
|
10629
|
-
init_d_tiles_utils();
|
|
10630
|
-
init_EXT_structural_metadata();
|
|
10631
|
-
EXT_MESH_FEATURES_NAME = "EXT_mesh_features";
|
|
10632
|
-
name2 = EXT_MESH_FEATURES_NAME;
|
|
10727
|
+
name2 = EXT_STRUCTURAL_METADATA_NAME;
|
|
10633
10728
|
}
|
|
10634
10729
|
});
|
|
10635
10730
|
|
|
@@ -10637,12 +10732,45 @@
|
|
|
10637
10732
|
var EXT_feature_metadata_exports = {};
|
|
10638
10733
|
__export(EXT_feature_metadata_exports, {
|
|
10639
10734
|
decode: () => decode3,
|
|
10735
|
+
getPropertyTableFromExtFeatureMetadata: () => getPropertyTableFromExtFeatureMetadata,
|
|
10640
10736
|
name: () => name3
|
|
10641
10737
|
});
|
|
10642
10738
|
async function decode3(gltfData, options) {
|
|
10643
10739
|
const scenegraph = new GLTFScenegraph(gltfData);
|
|
10644
10740
|
decodeExtFeatureMetadata(scenegraph, options);
|
|
10645
10741
|
}
|
|
10742
|
+
function getPropertyTableFromExtFeatureMetadata(extension, metadataClass) {
|
|
10743
|
+
if (extension.featureTables) {
|
|
10744
|
+
const firstFeatureTableName = Object.keys(extension.featureTables)?.[0];
|
|
10745
|
+
if (firstFeatureTableName) {
|
|
10746
|
+
const featureTable = extension.featureTables[firstFeatureTableName];
|
|
10747
|
+
const propertyTable = {};
|
|
10748
|
+
for (const propertyName in featureTable.properties) {
|
|
10749
|
+
propertyTable[propertyName] = featureTable.properties[propertyName].data;
|
|
10750
|
+
}
|
|
10751
|
+
return propertyTable;
|
|
10752
|
+
}
|
|
10753
|
+
}
|
|
10754
|
+
if (extension.featureTextures) {
|
|
10755
|
+
let featureTexture;
|
|
10756
|
+
for (const textureKey in extension.featureTextures) {
|
|
10757
|
+
const texture = extension.featureTextures[textureKey];
|
|
10758
|
+
if (texture.class === metadataClass) {
|
|
10759
|
+
featureTexture = textureKey;
|
|
10760
|
+
}
|
|
10761
|
+
}
|
|
10762
|
+
if (typeof featureTexture === "string") {
|
|
10763
|
+
const featureTable = extension.featureTextures[featureTexture];
|
|
10764
|
+
const propertyTable = {};
|
|
10765
|
+
for (const propertyName in featureTable.properties) {
|
|
10766
|
+
propertyTable[propertyName] = featureTable.properties[propertyName].data;
|
|
10767
|
+
}
|
|
10768
|
+
return propertyTable;
|
|
10769
|
+
}
|
|
10770
|
+
}
|
|
10771
|
+
console.warn("Cannot get property table from EXT_feature_metadata extension. There is neither featureTables, nor featureTextures in the extension.");
|
|
10772
|
+
return null;
|
|
10773
|
+
}
|
|
10646
10774
|
function decodeExtFeatureMetadata(scenegraph, options) {
|
|
10647
10775
|
const extension = scenegraph.getExtension(EXT_FEATURE_METADATA_NAME);
|
|
10648
10776
|
if (!extension)
|
|
@@ -10748,9 +10876,10 @@
|
|
|
10748
10876
|
const textureData = [];
|
|
10749
10877
|
const texCoordAccessorKey = `TEXCOORD_${featureTextureProperty.texture.texCoord}`;
|
|
10750
10878
|
const texCoordAccessorIndex = primitive.attributes[texCoordAccessorKey];
|
|
10751
|
-
const
|
|
10752
|
-
|
|
10753
|
-
|
|
10879
|
+
const textureCoordinates = getFloat32ArrayForAccessor(scenegraph.gltf, texCoordAccessorIndex);
|
|
10880
|
+
if (!textureCoordinates) {
|
|
10881
|
+
return;
|
|
10882
|
+
}
|
|
10754
10883
|
const textureIndex = featureTextureProperty.texture.index;
|
|
10755
10884
|
const texture = json.textures?.[textureIndex];
|
|
10756
10885
|
const imageIndex = texture?.source;
|
|
@@ -10868,18 +10997,18 @@
|
|
|
10868
10997
|
});
|
|
10869
10998
|
|
|
10870
10999
|
// ../gltf/src/lib/utils/version.ts
|
|
10871
|
-
var
|
|
11000
|
+
var VERSION6;
|
|
10872
11001
|
var init_version5 = __esm({
|
|
10873
11002
|
"../gltf/src/lib/utils/version.ts"() {
|
|
10874
|
-
|
|
11003
|
+
VERSION6 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
10875
11004
|
}
|
|
10876
11005
|
});
|
|
10877
11006
|
|
|
10878
11007
|
// ../textures/src/lib/utils/version.ts
|
|
10879
|
-
var
|
|
11008
|
+
var VERSION7;
|
|
10880
11009
|
var init_version6 = __esm({
|
|
10881
11010
|
"../textures/src/lib/utils/version.ts"() {
|
|
10882
|
-
|
|
11011
|
+
VERSION7 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
|
|
10883
11012
|
}
|
|
10884
11013
|
});
|
|
10885
11014
|
|
|
@@ -11318,7 +11447,7 @@
|
|
|
11318
11447
|
name: "Basis",
|
|
11319
11448
|
id: "basis",
|
|
11320
11449
|
module: "textures",
|
|
11321
|
-
version:
|
|
11450
|
+
version: VERSION7,
|
|
11322
11451
|
worker: true,
|
|
11323
11452
|
extensions: ["basis", "ktx2"],
|
|
11324
11453
|
mimeTypes: ["application/octet-stream", "image/ktx2"],
|
|
@@ -11963,30 +12092,6 @@
|
|
|
11963
12092
|
}
|
|
11964
12093
|
});
|
|
11965
12094
|
|
|
11966
|
-
// ../gltf/src/lib/gltf-utils/gltf-constants.ts
|
|
11967
|
-
var COMPONENTS, BYTES;
|
|
11968
|
-
var init_gltf_constants = __esm({
|
|
11969
|
-
"../gltf/src/lib/gltf-utils/gltf-constants.ts"() {
|
|
11970
|
-
COMPONENTS = {
|
|
11971
|
-
SCALAR: 1,
|
|
11972
|
-
VEC2: 2,
|
|
11973
|
-
VEC3: 3,
|
|
11974
|
-
VEC4: 4,
|
|
11975
|
-
MAT2: 4,
|
|
11976
|
-
MAT3: 9,
|
|
11977
|
-
MAT4: 16
|
|
11978
|
-
};
|
|
11979
|
-
BYTES = {
|
|
11980
|
-
5120: 1,
|
|
11981
|
-
5121: 1,
|
|
11982
|
-
5122: 2,
|
|
11983
|
-
5123: 2,
|
|
11984
|
-
5125: 4,
|
|
11985
|
-
5126: 4
|
|
11986
|
-
};
|
|
11987
|
-
}
|
|
11988
|
-
});
|
|
11989
|
-
|
|
11990
12095
|
// ../gltf/src/lib/extensions/KHR_texture_transform.ts
|
|
11991
12096
|
var KHR_texture_transform_exports = {};
|
|
11992
12097
|
__export(KHR_texture_transform_exports, {
|
|
@@ -12342,8 +12447,8 @@
|
|
|
12342
12447
|
init_KHR_techniques_webgl();
|
|
12343
12448
|
init_EXT_feature_metadata();
|
|
12344
12449
|
EXTENSIONS2 = [
|
|
12345
|
-
EXT_mesh_features_exports,
|
|
12346
12450
|
EXT_structural_metadata_exports,
|
|
12451
|
+
EXT_mesh_features_exports,
|
|
12347
12452
|
EXT_meshopt_compression_exports,
|
|
12348
12453
|
EXT_texture_webp_exports,
|
|
12349
12454
|
KHR_texture_basisu_exports,
|
|
@@ -12735,7 +12840,7 @@
|
|
|
12735
12840
|
name: "glTF",
|
|
12736
12841
|
id: "gltf",
|
|
12737
12842
|
module: "gltf",
|
|
12738
|
-
version:
|
|
12843
|
+
version: VERSION6,
|
|
12739
12844
|
extensions: ["gltf", "glb"],
|
|
12740
12845
|
mimeTypes: ["model/gltf+json", "model/gltf-binary"],
|
|
12741
12846
|
text: true,
|
|
@@ -13541,7 +13646,7 @@
|
|
|
13541
13646
|
id: "3d-tiles-subtree",
|
|
13542
13647
|
name: "3D Tiles Subtree",
|
|
13543
13648
|
module: "3d-tiles",
|
|
13544
|
-
version:
|
|
13649
|
+
version: VERSION3,
|
|
13545
13650
|
extensions: ["subtree"],
|
|
13546
13651
|
mimeTypes: ["application/octet-stream"],
|
|
13547
13652
|
tests: ["subtree"],
|
|
@@ -13596,11 +13701,11 @@
|
|
|
13596
13701
|
});
|
|
13597
13702
|
|
|
13598
13703
|
// node_modules/@probe.gl/env/dist/utils/globals.js
|
|
13599
|
-
var
|
|
13704
|
+
var VERSION8, isBrowser6;
|
|
13600
13705
|
var init_globals6 = __esm({
|
|
13601
13706
|
"node_modules/@probe.gl/env/dist/utils/globals.js"() {
|
|
13602
13707
|
init_is_browser2();
|
|
13603
|
-
|
|
13708
|
+
VERSION8 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
|
|
13604
13709
|
isBrowser6 = isBrowser5();
|
|
13605
13710
|
}
|
|
13606
13711
|
});
|
|
@@ -13935,7 +14040,7 @@
|
|
|
13935
14040
|
id: ""
|
|
13936
14041
|
};
|
|
13937
14042
|
this.id = void 0;
|
|
13938
|
-
this.VERSION =
|
|
14043
|
+
this.VERSION = VERSION8;
|
|
13939
14044
|
this._startTs = getHiResTimestamp2();
|
|
13940
14045
|
this._deltaTs = getHiResTimestamp2();
|
|
13941
14046
|
this._storage = void 0;
|
|
@@ -14138,7 +14243,7 @@
|
|
|
14138
14243
|
return noop2;
|
|
14139
14244
|
}
|
|
14140
14245
|
};
|
|
14141
|
-
Log2.VERSION =
|
|
14246
|
+
Log2.VERSION = VERSION8;
|
|
14142
14247
|
}
|
|
14143
14248
|
});
|
|
14144
14249
|
|
|
@@ -15846,7 +15951,7 @@
|
|
|
15846
15951
|
id: "3d-tiles",
|
|
15847
15952
|
name: "3D Tiles",
|
|
15848
15953
|
module: "3d-tiles",
|
|
15849
|
-
version:
|
|
15954
|
+
version: VERSION3,
|
|
15850
15955
|
extensions: ["cmpt", "pnts", "b3dm", "i3dm"],
|
|
15851
15956
|
mimeTypes: ["application/octet-stream"],
|
|
15852
15957
|
tests: ["cmpt", "pnts", "b3dm", "i3dm"],
|
|
@@ -20916,17 +21021,17 @@
|
|
|
20916
21021
|
const archive = await parse3DTilesArchive(new DataViewFile(new DataView(data)));
|
|
20917
21022
|
return archive.getFile(options["3d-tiles-archive"]?.path ?? "");
|
|
20918
21023
|
}
|
|
20919
|
-
var
|
|
21024
|
+
var VERSION9, Tiles3DArchiveFileLoader;
|
|
20920
21025
|
var init_d_tiles_archive_loader = __esm({
|
|
20921
21026
|
"src/3d-tiles-archive-loader.ts"() {
|
|
20922
21027
|
init_src2();
|
|
20923
21028
|
init_d_tiles_archive_parser();
|
|
20924
|
-
|
|
21029
|
+
VERSION9 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
20925
21030
|
Tiles3DArchiveFileLoader = {
|
|
20926
21031
|
name: "3tz",
|
|
20927
21032
|
id: "3tz",
|
|
20928
21033
|
module: "3d-tiles",
|
|
20929
|
-
version:
|
|
21034
|
+
version: VERSION9,
|
|
20930
21035
|
mimeTypes: ["application/octet-stream", "application/vnd.maxar.archive.3tz+zip"],
|
|
20931
21036
|
parse: parse3DTilesArchive2,
|
|
20932
21037
|
extensions: ["3tz"],
|
|
@@ -21195,7 +21300,7 @@
|
|
|
21195
21300
|
name: "3D Tile",
|
|
21196
21301
|
id: "3d-tiles",
|
|
21197
21302
|
module: "3d-tiles",
|
|
21198
|
-
version:
|
|
21303
|
+
version: VERSION3,
|
|
21199
21304
|
extensions: ["cmpt", "pnts", "b3dm", "i3dm"],
|
|
21200
21305
|
mimeTypes: ["application/octet-stream"],
|
|
21201
21306
|
encodeSync,
|
|
@@ -9,7 +9,7 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
|
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _loaderUtils = require("@loaders.gl/loader-utils");
|
|
11
11
|
var _dTilesArchiveParser = require("./3d-tiles-archive/3d-tiles-archive-parser");
|
|
12
|
-
var VERSION = typeof "4.0.0-alpha.
|
|
12
|
+
var VERSION = typeof "4.0.0-alpha.25" !== 'undefined' ? "4.0.0-alpha.25" : 'latest';
|
|
13
13
|
var Tiles3DArchiveFileLoader = {
|
|
14
14
|
name: '3tz',
|
|
15
15
|
id: '3tz',
|
|
@@ -4,6 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.VERSION = void 0;
|
|
7
|
-
var VERSION = typeof "4.0.0-alpha.
|
|
7
|
+
var VERSION = typeof "4.0.0-alpha.25" !== 'undefined' ? "4.0.0-alpha.25" : 'latest';
|
|
8
8
|
exports.VERSION = VERSION;
|
|
9
9
|
//# sourceMappingURL=version.js.map
|
package/dist/es5/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../src/types.ts"],"sourcesContent":["import type {GLTFPostprocessed} from '@loaders.gl/gltf';\nimport {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {Matrix4, Vector3} from '@math.gl/core';\nimport {TILESET_TYPE, LOD_METRIC_TYPE, TILE_TYPE, TILE_REFINEMENT} from '@loaders.gl/tiles';\n\nexport type FeatureTableJson = {\n [key: string]: any[];\n};\n\nexport type B3DMContent = {\n batchTableJson?: FeatureTableJson;\n byteLength: number;\n byteOffset: number;\n cartesianModelMatrix: Matrix4;\n cartesianOrigin: Vector3;\n cartographicModelMatrix: Matrix4;\n cartographicOrigin: Vector3;\n featureIds?: number[] | null;\n featureTableBinary?: Uint8Array;\n featureTableJson?: FeatureTableJson;\n gltf?: GLTFPostprocessed;\n gltfUpAxis: string;\n header: GLTFHeader;\n magic: number;\n modelMatrix: Matrix4;\n rotateYtoZ: boolean;\n rtcCenter: [number, number, number];\n type: string;\n version: number;\n};\n\nexport type GLTFHeader = {\n batchLength?: number;\n batchTableBinaryByteLength: number;\n batchTableJsonByteLength: number;\n featureTableBinaryByteLength: number;\n featureTableJsonByteLength: number;\n};\n\n/**\n * A 3D Tiles tileset JSON\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#property-reference\n */\nexport type Tiles3DTilesetJSON = {\n shape: 'tileset3d';\n /** Metadata about the entire tileset.\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#asset\n */\n asset: {\n /** The 3D Tiles version. The version defines the JSON schema for the tileset JSON and the base set of tile formats. */\n version: string;\n /** Application-specific version of this tileset, e.g., for when an existing tileset is updated. */\n tilesetVersion?: string;\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n /** Not mentioned in 1.0 spec but some tilesets contain this option */\n gltfUpAxis?: string;\n };\n /** A dictionary object of metadata about per-feature properties. */\n properties?: Record<string, TilesetProperty>;\n /** The error, in meters, introduced if this tileset is not rendered. At runtime, the geometric error is used to compute screen space error (SSE), i.e., the error measured in pixels. */\n geometricError: number;\n /** A tile in a 3D Tiles tileset. */\n root: Tiles3DTileJSON;\n /** Names of 3D Tiles extensions used somewhere in this tileset. */\n extensionsUsed?: string[];\n /** Names of 3D Tiles extensions required to properly load this tileset. */\n extensionsRequired?: string[];\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n};\n\n/** TilesetJSON postprocessed by Tiles3DLoader */\nexport type Tiles3DTilesetJSONPostprocessed = Omit<Tiles3DTilesetJSON, 'root'> & {\n /**\n * Loader used\n * @deprecated\n */\n loader: LoaderWithParser;\n /** URL used to load a tileset resource */\n url: string;\n /** HTTP request query string */\n queryString: string;\n /** base path that non-absolute paths in tileset are relative to. */\n basePath: string;\n /** tileset type */\n type: TILESET_TYPE.TILES3D;\n /** LOD metric type */\n lodMetricType: LOD_METRIC_TYPE.GEOMETRIC_ERROR;\n /** LOD metric value */\n lodMetricValue: number;\n /** Postprocessed root */\n root: Tiles3DTileJSONPostprocessed;\n};\n\n/**\n * A tile in a 3D Tiles tileset.\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#tile\n */\nexport type Tiles3DTileJSON = {\n /** A bounding volume that encloses a tile or its content. */\n boundingVolume: Tile3DBoundingVolume;\n /** A bounding volume that encloses a tile or its content. */\n viewerRequestVolume?: object;\n /** The error, in meters, introduced if this tile is rendered and its children are not. At runtime, the geometric error is used to compute screen space error (SSE), i.e., the error measured in pixels. */\n geometricError: number;\n /**\n * Specifies if additive or replacement refinement is used when traversing the tileset for rendering. This property is required for the root tile of a tileset; it is optional for all other tiles.\n * The default is to inherit from the parent tile.\n */\n refine?: string;\n /** A floating-point 4x4 affine transformation matrix, stored in column-major order, that transforms the tile's content */\n transform?: number[];\n /** Metadata about the tile's content and a link to the content. */\n content?: Tiles3DTileContentJSON;\n /** An array of objects that define child tiles. */\n children: Tiles3DTileJSON[];\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n\n /** 3DTiles v1.1 properties\n * https://github.com/CesiumGS/3d-tiles/blob/draft-1.1/specification/schema/tile.schema.json\n */\n /** This object allows a tile to be implicitly subdivided. Tile and content availability and metadata is stored in subtrees which are referenced externally. */\n implicitTiling?: ImplicitTilingData;\n};\n\nexport type Tiles3DTileJSONPostprocessed = Omit<Tiles3DTileJSON, 'refine' | 'children'> & {\n /** Unique ID */\n id?: string;\n /** Content full URL */\n contentUrl?: string;\n /** LOD metric type */\n lodMetricType?: LOD_METRIC_TYPE.GEOMETRIC_ERROR;\n /** LOD metric value */\n lodMetricValue?: number;\n /** Duplicate of transform */\n transformMatrix?: number[];\n /** Type of tile */\n type?: TILE_TYPE | string;\n /**\n * Specifies if additive or replacement refinement is used when traversing the tileset for rendering. This property is required for the root tile of a tileset; it is optional for all other tiles.\n * The default is to inherit from the parent tile.\n */\n refine?: TILE_REFINEMENT | string;\n /** An array of objects that define child tiles. */\n children: Tiles3DTileJSONPostprocessed[];\n};\n\n/** Metadata about the tile's content and a link to the content. */\nexport type Tiles3DTileContentJSON = {\n /** A uri that points to the tile's content. When the uri is relative, it is relative to the referring tileset JSON file. */\n uri: string;\n /** url doesn't allign the spec but we support it same way as uri */\n url?: string;\n /** A bounding volume that encloses a tile or its content. At least one bounding volume property is required. Bounding volumes include box, region, or sphere. */\n boundingVolume?: Tile3DBoundingVolume;\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n};\n\n/** A bounding volume that encloses a tile or its content.\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#bounding-volume\n */\nexport type Tile3DBoundingVolume = {\n /** An array of 12 numbers that define an oriented bounding box. The first three elements define the x, y, and z values for the center of the box.\n * The next three elements (with indices 3, 4, and 5) define the x axis direction and half-length. The next three elements (indices 6, 7, and 8) define\n * the y axis direction and half-length. The last three elements (indices 9, 10, and 11) define the z axis direction and half-length. */\n box?: number[];\n /** An array of four numbers that define a bounding sphere. The first three elements define the x, y, and z values for the center of the sphere.\n * The last element (with index 3) defines the radius in meters. */\n sphere?: number[];\n /** An array of six numbers that define a bounding geographic region in EPSG:4979 coordinates with the order [west, south, east, north, minimum height, maximum height].\n * Longitudes and latitudes are in radians, and heights are in meters above (or below) the WGS84 ellipsoid. */\n region?: number[];\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n};\n\n/**\n * A dictionary object of metadata about per-feature properties.\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#properties\n */\nexport type TilesetProperty = {\n /** The maximum value of this property of all the features in the tileset. */\n maximum: number;\n /** The minimum value of this property of all the features in the tileset. */\n minimum: number;\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n};\n\nexport type Tiles3DTileContent = {\n shape: 'tile3d';\n\n /** Common properties */\n byteOffset?: number;\n type?: string;\n featureIds?: null;\n\n /** 3DTile header */\n magic?: number;\n version?: number;\n byteLength?: number;\n\n /** 3DTile tables header */\n header?: {\n featureTableJsonByteLength?: number;\n featureTableBinaryByteLength?: number;\n batchTableJsonByteLength?: number;\n batchTableBinaryByteLength?: number;\n batchLength?: number;\n };\n\n /** 3DTile tables */\n featureTableJson?:\n | {\n BATCH_LENGTH?: number;\n }\n | Record<string, any>;\n featureTableBinary?: Uint8Array;\n batchTableJson?: Record<string, (string | number)[]>;\n batchTableBinary?: Uint8Array;\n rtcCenter?: number[];\n\n /** 3DTile glTF */\n gltfArrayBuffer?: ArrayBuffer;\n gltfByteOffset?: number;\n gltfByteLength?: number;\n rotateYtoZ?: boolean;\n gltfUpAxis?: 'x' | 'X' | 'y' | 'Y' | 'z' | 'Z';\n gltfUrl?: string;\n gpuMemoryUsageInBytes?: number;\n gltf?: GLTFPostprocessed;\n\n /** For Composite tiles */\n tilesLength?: number;\n tiles?: Tiles3DTileContent[];\n\n /** For Instances model and Pointcloud tiles */\n featuresLength?: number;\n\n /** For Instanced model tiles */\n gltfFormat?: number;\n eastNorthUp?: boolean;\n normalUp?: number[];\n normalRight?: number[];\n hasCustomOrientation?: boolean;\n octNormalUp?: number[];\n octNormalRight?: number[];\n instances?: {\n modelMatrix: Matrix4;\n batchId: number;\n }[];\n\n /** For Pointcloud tiles */\n attributes?: {\n positions: null | number[];\n colors:\n | null\n | number[]\n | {type: number; value: Uint8ClampedArray; size: number; normalized: boolean};\n normals: null | number[] | {type: number; size: number; value: Float32Array};\n batchIds: null | number[];\n };\n constantRGBA?: number[];\n isQuantized?: boolean;\n isTranslucent?: boolean;\n isRGB565?: boolean;\n isOctEncoded16P?: boolean;\n pointsLength?: number;\n pointCount?: number;\n batchIds?: number[];\n hasPositions?: boolean;\n hasColors?: boolean;\n hasNormals?: boolean;\n hasBatchIds?: boolean;\n quantizedVolumeScale?: Vector3;\n quantizedVolumeOffset?: Vector3;\n quantizedRange?: number;\n isQuantizedDraco?: boolean;\n octEncodedRange?: number;\n isOctEncodedDraco?: boolean;\n};\n\n/**\n * 3DTILES_implicit_tiling types\n * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling\n * JSON Schema v1.1 https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/specification/schema/Subtree/subtree.schema.json\n * JSON Schema vNext https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/extensions/3DTILES_implicit_tiling/schema/subtree/subtree.schema.json\n */\nexport type Subtree = {\n /** An array of buffers. */\n buffers: Buffer[];\n /** An array of buffer views. */\n bufferViews: BufferView[];\n /** The availability of tiles in the subtree. The availability bitstream is a 1D boolean array where tiles are ordered by their level in the subtree and Morton index\n * within that level. A tile's availability is determined by a single bit, 1 meaning a tile exists at that spatial index, and 0 meaning it does not.\n * The number of elements in the array is `(N^subtreeLevels - 1)/(N - 1)` where N is 4 for subdivision scheme `QUADTREE` and 8 for `OCTREE`.\n * Availability may be stored in a buffer view or as a constant value that applies to all tiles. If a non-root tile's availability is 1 its parent\n * tile's availability shall also be 1. `tileAvailability.constant: 0` is disallowed, as subtrees shall have at least one tile.\n */\n tileAvailability: Availability;\n /** It is array by spec but there are tiles that has a single object\n * An array of content availability objects. If the tile has a single content this array will have one element; if the tile has multiple contents -\n * as supported by 3DTILES_multiple_contents and 3D Tiles 1.1 - this array will have multiple elements.\n */\n contentAvailability: Availability | Availability[];\n /** The availability of children subtrees. The availability bitstream is a 1D boolean array where subtrees are ordered by their Morton index in the level of the tree\n * immediately below the bottom row of the subtree. A child subtree's availability is determined by a single bit, 1 meaning a subtree exists at that spatial index,\n * and 0 meaning it does not. The number of elements in the array is `N^subtreeLevels` where N is 4 for subdivision scheme `QUADTREE` and 8 for `OCTREE`.\n * Availability may be stored in a buffer view or as a constant value that applies to all child subtrees. If availability is 0 for all child subtrees,\n * then the tileset does not subdivide further.\n */\n childSubtreeAvailability: Availability;\n // TODO: These are unused properties. Improve types when they are required\n propertyTables: unknown;\n tileMetadata: unknown;\n contentMetadata: unknown;\n subtreeMetadata: unknown;\n};\n\nexport type Availability = {\n /** Integer indicating whether all of the elements are available (1) or all are unavailable (0). */\n constant?: 0 | 1;\n /** Index of a buffer view that indicates whether each element is available. The bitstream conforms to the boolean array encoding described\n * in the 3D Metadata specification. If an element is available, its bit is 1, and if it is unavailable, its bit is 0. */\n bitstream?: number;\n /**\n * v1.1 https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/specification/schema/Subtree/availability.schema.json\n * vNext https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/extensions/3DTILES_implicit_tiling/schema/subtree/availability.schema.json\n * The schemas of vNext and 1.1 are same but there are tiles with `bufferView` property instead of `bitstream`\n */\n bufferView?: number;\n /**\n * Postprocessing property\n * contain availability bits loaded from the bufferView\n */\n explicitBitstream?: ExplicitBitstream;\n};\n\nexport type ExplicitBitstream = Uint8Array;\n\n/**\n * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling#subdivision-scheme\n */\nexport type SubdivisionScheme = 'QUADTREE' | 'OCTREE';\n\ntype Buffer = {\n name: string;\n uri?: string;\n byteLength: number;\n};\n\n/** Subtree buffer view */\nexport type BufferView = {\n buffer: number;\n byteOffset: number;\n byteLength: number;\n};\n\n/**\n * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling\n */\nexport type ImplicitTilingExensionData = ImplicitTilingData & {\n /** This property is not part of the schema\n * https://github.com/CesiumGS/3d-tiles/blob/main/extensions/3DTILES_implicit_tiling/schema/tile.3DTILES_implicit_tiling.schema.json\n * But it can be seen in some test datasets. It is handled as substitute of `availableLevels`\n */\n maximumLevel?: number;\n};\n\n/** 3DTiles v1.1 types */\n\n/**\n * This object allows a tile to be implicitly subdivided. Tile and content availability and metadata is stored in subtrees which are referenced externally.\n * https://github.com/CesiumGS/3d-tiles/blob/draft-1.1/specification/schema/tile.implicitTiling.schema.json\n * */\ntype ImplicitTilingData = {\n /** A string describing the subdivision scheme used within the tileset. */\n subdivisionScheme: 'QUADTREE' | 'OCTREE' | string;\n /** The number of distinct levels in each subtree. For example, a quadtree with `subtreeLevels = 2` will have subtrees with 5 nodes (one root and 4 children). */\n subtreeLevels: number;\n /** The numbers of the levels in the tree with available tiles. */\n availableLevels: number;\n /** An object describing the location of subtree files. */\n subtrees: {\n /** A template URI pointing to subtree files. A subtree is a fixed-depth (defined by `subtreeLevels`) portion of the tree to keep memory use bounded.\n * The URI of each file is substituted with the subtree root's global level, x, and y. For subdivision scheme `OCTREE`, z shall also be given. Relative paths are relative to the tileset JSON. */\n uri: string;\n };\n};\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../src/types.ts"],"sourcesContent":["import type {GLTFPostprocessed, FeatureTableJson} from '@loaders.gl/gltf';\nexport type {FeatureTableJson};\n\nimport {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {Matrix4, Vector3} from '@math.gl/core';\nimport {TILESET_TYPE, LOD_METRIC_TYPE, TILE_TYPE, TILE_REFINEMENT} from '@loaders.gl/tiles';\n\nexport type B3DMContent = {\n batchTableJson?: FeatureTableJson;\n byteLength: number;\n byteOffset: number;\n cartesianModelMatrix: Matrix4;\n cartesianOrigin: Vector3;\n cartographicModelMatrix: Matrix4;\n cartographicOrigin: Vector3;\n featureIds?: number[] | null;\n featureTableBinary?: Uint8Array;\n featureTableJson?: FeatureTableJson;\n gltf?: GLTFPostprocessed;\n gltfUpAxis: string;\n header: GLTFHeader;\n magic: number;\n modelMatrix: Matrix4;\n rotateYtoZ: boolean;\n rtcCenter: [number, number, number];\n type: string;\n version: number;\n};\n\nexport type GLTFHeader = {\n batchLength?: number;\n batchTableBinaryByteLength: number;\n batchTableJsonByteLength: number;\n featureTableBinaryByteLength: number;\n featureTableJsonByteLength: number;\n};\n\n/**\n * A 3D Tiles tileset JSON\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#property-reference\n */\nexport type Tiles3DTilesetJSON = {\n shape: 'tileset3d';\n /** Metadata about the entire tileset.\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#asset\n */\n asset: {\n /** The 3D Tiles version. The version defines the JSON schema for the tileset JSON and the base set of tile formats. */\n version: string;\n /** Application-specific version of this tileset, e.g., for when an existing tileset is updated. */\n tilesetVersion?: string;\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n /** Not mentioned in 1.0 spec but some tilesets contain this option */\n gltfUpAxis?: string;\n };\n /** A dictionary object of metadata about per-feature properties. */\n properties?: Record<string, TilesetProperty>;\n /** The error, in meters, introduced if this tileset is not rendered. At runtime, the geometric error is used to compute screen space error (SSE), i.e., the error measured in pixels. */\n geometricError: number;\n /** A tile in a 3D Tiles tileset. */\n root: Tiles3DTileJSON;\n /** Names of 3D Tiles extensions used somewhere in this tileset. */\n extensionsUsed?: string[];\n /** Names of 3D Tiles extensions required to properly load this tileset. */\n extensionsRequired?: string[];\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n};\n\n/** TilesetJSON postprocessed by Tiles3DLoader */\nexport type Tiles3DTilesetJSONPostprocessed = Omit<Tiles3DTilesetJSON, 'root'> & {\n /**\n * Loader used\n * @deprecated\n */\n loader: LoaderWithParser;\n /** URL used to load a tileset resource */\n url: string;\n /** HTTP request query string */\n queryString: string;\n /** base path that non-absolute paths in tileset are relative to. */\n basePath: string;\n /** tileset type */\n type: TILESET_TYPE.TILES3D;\n /** LOD metric type */\n lodMetricType: LOD_METRIC_TYPE.GEOMETRIC_ERROR;\n /** LOD metric value */\n lodMetricValue: number;\n /** Postprocessed root */\n root: Tiles3DTileJSONPostprocessed;\n};\n\n/**\n * A tile in a 3D Tiles tileset.\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#tile\n */\nexport type Tiles3DTileJSON = {\n /** A bounding volume that encloses a tile or its content. */\n boundingVolume: Tile3DBoundingVolume;\n /** A bounding volume that encloses a tile or its content. */\n viewerRequestVolume?: object;\n /** The error, in meters, introduced if this tile is rendered and its children are not. At runtime, the geometric error is used to compute screen space error (SSE), i.e., the error measured in pixels. */\n geometricError: number;\n /**\n * Specifies if additive or replacement refinement is used when traversing the tileset for rendering. This property is required for the root tile of a tileset; it is optional for all other tiles.\n * The default is to inherit from the parent tile.\n */\n refine?: string;\n /** A floating-point 4x4 affine transformation matrix, stored in column-major order, that transforms the tile's content */\n transform?: number[];\n /** Metadata about the tile's content and a link to the content. */\n content?: Tiles3DTileContentJSON;\n /** An array of objects that define child tiles. */\n children: Tiles3DTileJSON[];\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n\n /** 3DTiles v1.1 properties\n * https://github.com/CesiumGS/3d-tiles/blob/draft-1.1/specification/schema/tile.schema.json\n */\n /** This object allows a tile to be implicitly subdivided. Tile and content availability and metadata is stored in subtrees which are referenced externally. */\n implicitTiling?: ImplicitTilingData;\n};\n\nexport type Tiles3DTileJSONPostprocessed = Omit<Tiles3DTileJSON, 'refine' | 'children'> & {\n /** Unique ID */\n id?: string;\n /** Content full URL */\n contentUrl?: string;\n /** LOD metric type */\n lodMetricType?: LOD_METRIC_TYPE.GEOMETRIC_ERROR;\n /** LOD metric value */\n lodMetricValue?: number;\n /** Duplicate of transform */\n transformMatrix?: number[];\n /** Type of tile */\n type?: TILE_TYPE | string;\n /**\n * Specifies if additive or replacement refinement is used when traversing the tileset for rendering. This property is required for the root tile of a tileset; it is optional for all other tiles.\n * The default is to inherit from the parent tile.\n */\n refine?: TILE_REFINEMENT | string;\n /** An array of objects that define child tiles. */\n children: Tiles3DTileJSONPostprocessed[];\n};\n\n/** Metadata about the tile's content and a link to the content. */\nexport type Tiles3DTileContentJSON = {\n /** A uri that points to the tile's content. When the uri is relative, it is relative to the referring tileset JSON file. */\n uri: string;\n /** url doesn't allign the spec but we support it same way as uri */\n url?: string;\n /** A bounding volume that encloses a tile or its content. At least one bounding volume property is required. Bounding volumes include box, region, or sphere. */\n boundingVolume?: Tile3DBoundingVolume;\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n};\n\n/** A bounding volume that encloses a tile or its content.\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#bounding-volume\n */\nexport type Tile3DBoundingVolume = {\n /** An array of 12 numbers that define an oriented bounding box. The first three elements define the x, y, and z values for the center of the box.\n * The next three elements (with indices 3, 4, and 5) define the x axis direction and half-length. The next three elements (indices 6, 7, and 8) define\n * the y axis direction and half-length. The last three elements (indices 9, 10, and 11) define the z axis direction and half-length. */\n box?: number[];\n /** An array of four numbers that define a bounding sphere. The first three elements define the x, y, and z values for the center of the sphere.\n * The last element (with index 3) defines the radius in meters. */\n sphere?: number[];\n /** An array of six numbers that define a bounding geographic region in EPSG:4979 coordinates with the order [west, south, east, north, minimum height, maximum height].\n * Longitudes and latitudes are in radians, and heights are in meters above (or below) the WGS84 ellipsoid. */\n region?: number[];\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n};\n\n/**\n * A dictionary object of metadata about per-feature properties.\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#properties\n */\nexport type TilesetProperty = {\n /** The maximum value of this property of all the features in the tileset. */\n maximum: number;\n /** The minimum value of this property of all the features in the tileset. */\n minimum: number;\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n};\n\nexport type Tiles3DTileContent = {\n shape: 'tile3d';\n\n /** Common properties */\n byteOffset?: number;\n type?: string;\n featureIds?: null;\n\n /** 3DTile header */\n magic?: number;\n version?: number;\n byteLength?: number;\n\n /** 3DTile tables header */\n header?: {\n featureTableJsonByteLength?: number;\n featureTableBinaryByteLength?: number;\n batchTableJsonByteLength?: number;\n batchTableBinaryByteLength?: number;\n batchLength?: number;\n };\n\n /** 3DTile tables */\n featureTableJson?:\n | {\n BATCH_LENGTH?: number;\n }\n | Record<string, any>;\n featureTableBinary?: Uint8Array;\n batchTableJson?: Record<string, (string | number)[]>;\n batchTableBinary?: Uint8Array;\n rtcCenter?: number[];\n\n /** 3DTile glTF */\n gltfArrayBuffer?: ArrayBuffer;\n gltfByteOffset?: number;\n gltfByteLength?: number;\n rotateYtoZ?: boolean;\n gltfUpAxis?: 'x' | 'X' | 'y' | 'Y' | 'z' | 'Z';\n gltfUrl?: string;\n gpuMemoryUsageInBytes?: number;\n gltf?: GLTFPostprocessed;\n\n /** For Composite tiles */\n tilesLength?: number;\n tiles?: Tiles3DTileContent[];\n\n /** For Instances model and Pointcloud tiles */\n featuresLength?: number;\n\n /** For Instanced model tiles */\n gltfFormat?: number;\n eastNorthUp?: boolean;\n normalUp?: number[];\n normalRight?: number[];\n hasCustomOrientation?: boolean;\n octNormalUp?: number[];\n octNormalRight?: number[];\n instances?: {\n modelMatrix: Matrix4;\n batchId: number;\n }[];\n\n /** For Pointcloud tiles */\n attributes?: {\n positions: null | number[];\n colors:\n | null\n | number[]\n | {type: number; value: Uint8ClampedArray; size: number; normalized: boolean};\n normals: null | number[] | {type: number; size: number; value: Float32Array};\n batchIds: null | number[];\n };\n constantRGBA?: number[];\n isQuantized?: boolean;\n isTranslucent?: boolean;\n isRGB565?: boolean;\n isOctEncoded16P?: boolean;\n pointsLength?: number;\n pointCount?: number;\n batchIds?: number[];\n hasPositions?: boolean;\n hasColors?: boolean;\n hasNormals?: boolean;\n hasBatchIds?: boolean;\n quantizedVolumeScale?: Vector3;\n quantizedVolumeOffset?: Vector3;\n quantizedRange?: number;\n isQuantizedDraco?: boolean;\n octEncodedRange?: number;\n isOctEncodedDraco?: boolean;\n};\n\n/**\n * 3DTILES_implicit_tiling types\n * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling\n * JSON Schema v1.1 https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/specification/schema/Subtree/subtree.schema.json\n * JSON Schema vNext https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/extensions/3DTILES_implicit_tiling/schema/subtree/subtree.schema.json\n */\nexport type Subtree = {\n /** An array of buffers. */\n buffers: Buffer[];\n /** An array of buffer views. */\n bufferViews: BufferView[];\n /** The availability of tiles in the subtree. The availability bitstream is a 1D boolean array where tiles are ordered by their level in the subtree and Morton index\n * within that level. A tile's availability is determined by a single bit, 1 meaning a tile exists at that spatial index, and 0 meaning it does not.\n * The number of elements in the array is `(N^subtreeLevels - 1)/(N - 1)` where N is 4 for subdivision scheme `QUADTREE` and 8 for `OCTREE`.\n * Availability may be stored in a buffer view or as a constant value that applies to all tiles. If a non-root tile's availability is 1 its parent\n * tile's availability shall also be 1. `tileAvailability.constant: 0` is disallowed, as subtrees shall have at least one tile.\n */\n tileAvailability: Availability;\n /** It is array by spec but there are tiles that has a single object\n * An array of content availability objects. If the tile has a single content this array will have one element; if the tile has multiple contents -\n * as supported by 3DTILES_multiple_contents and 3D Tiles 1.1 - this array will have multiple elements.\n */\n contentAvailability: Availability | Availability[];\n /** The availability of children subtrees. The availability bitstream is a 1D boolean array where subtrees are ordered by their Morton index in the level of the tree\n * immediately below the bottom row of the subtree. A child subtree's availability is determined by a single bit, 1 meaning a subtree exists at that spatial index,\n * and 0 meaning it does not. The number of elements in the array is `N^subtreeLevels` where N is 4 for subdivision scheme `QUADTREE` and 8 for `OCTREE`.\n * Availability may be stored in a buffer view or as a constant value that applies to all child subtrees. If availability is 0 for all child subtrees,\n * then the tileset does not subdivide further.\n */\n childSubtreeAvailability: Availability;\n // TODO: These are unused properties. Improve types when they are required\n propertyTables: unknown;\n tileMetadata: unknown;\n contentMetadata: unknown;\n subtreeMetadata: unknown;\n};\n\nexport type Availability = {\n /** Integer indicating whether all of the elements are available (1) or all are unavailable (0). */\n constant?: 0 | 1;\n /** Index of a buffer view that indicates whether each element is available. The bitstream conforms to the boolean array encoding described\n * in the 3D Metadata specification. If an element is available, its bit is 1, and if it is unavailable, its bit is 0. */\n bitstream?: number;\n /**\n * v1.1 https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/specification/schema/Subtree/availability.schema.json\n * vNext https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/extensions/3DTILES_implicit_tiling/schema/subtree/availability.schema.json\n * The schemas of vNext and 1.1 are same but there are tiles with `bufferView` property instead of `bitstream`\n */\n bufferView?: number;\n /**\n * Postprocessing property\n * contain availability bits loaded from the bufferView\n */\n explicitBitstream?: ExplicitBitstream;\n};\n\nexport type ExplicitBitstream = Uint8Array;\n\n/**\n * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling#subdivision-scheme\n */\nexport type SubdivisionScheme = 'QUADTREE' | 'OCTREE';\n\ntype Buffer = {\n name: string;\n uri?: string;\n byteLength: number;\n};\n\n/** Subtree buffer view */\nexport type BufferView = {\n buffer: number;\n byteOffset: number;\n byteLength: number;\n};\n\n/**\n * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling\n */\nexport type ImplicitTilingExensionData = ImplicitTilingData & {\n /** This property is not part of the schema\n * https://github.com/CesiumGS/3d-tiles/blob/main/extensions/3DTILES_implicit_tiling/schema/tile.3DTILES_implicit_tiling.schema.json\n * But it can be seen in some test datasets. It is handled as substitute of `availableLevels`\n */\n maximumLevel?: number;\n};\n\n/** 3DTiles v1.1 types */\n\n/**\n * This object allows a tile to be implicitly subdivided. Tile and content availability and metadata is stored in subtrees which are referenced externally.\n * https://github.com/CesiumGS/3d-tiles/blob/draft-1.1/specification/schema/tile.implicitTiling.schema.json\n * */\ntype ImplicitTilingData = {\n /** A string describing the subdivision scheme used within the tileset. */\n subdivisionScheme: 'QUADTREE' | 'OCTREE' | string;\n /** The number of distinct levels in each subtree. For example, a quadtree with `subtreeLevels = 2` will have subtrees with 5 nodes (one root and 4 children). */\n subtreeLevels: number;\n /** The numbers of the levels in the tree with available tiles. */\n availableLevels: number;\n /** An object describing the location of subtree files. */\n subtrees: {\n /** A template URI pointing to subtree files. A subtree is a fixed-depth (defined by `subtreeLevels`) portion of the tree to keep memory use bounded.\n * The URI of each file is substituted with the subtree root's global level, x, and y. For subdivision scheme `OCTREE`, z shall also be given. Relative paths are relative to the tileset JSON. */\n uri: string;\n };\n};\n"],"mappings":""}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DataViewFile } from '@loaders.gl/loader-utils';
|
|
2
2
|
import { parse3DTilesArchive as parse3DTilesArchiveFromProvider } from './3d-tiles-archive/3d-tiles-archive-parser';
|
|
3
|
-
const VERSION = typeof "4.0.0-alpha.
|
|
3
|
+
const VERSION = typeof "4.0.0-alpha.25" !== 'undefined' ? "4.0.0-alpha.25" : 'latest';
|
|
4
4
|
export const Tiles3DArchiveFileLoader = {
|
|
5
5
|
name: '3tz',
|
|
6
6
|
id: '3tz',
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = typeof "4.0.0-alpha.
|
|
1
|
+
export const VERSION = typeof "4.0.0-alpha.25" !== 'undefined' ? "4.0.0-alpha.25" : 'latest';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/dist/esm/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../src/types.ts"],"sourcesContent":["import type {GLTFPostprocessed} from '@loaders.gl/gltf';\nimport {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {Matrix4, Vector3} from '@math.gl/core';\nimport {TILESET_TYPE, LOD_METRIC_TYPE, TILE_TYPE, TILE_REFINEMENT} from '@loaders.gl/tiles';\n\nexport type FeatureTableJson = {\n [key: string]: any[];\n};\n\nexport type B3DMContent = {\n batchTableJson?: FeatureTableJson;\n byteLength: number;\n byteOffset: number;\n cartesianModelMatrix: Matrix4;\n cartesianOrigin: Vector3;\n cartographicModelMatrix: Matrix4;\n cartographicOrigin: Vector3;\n featureIds?: number[] | null;\n featureTableBinary?: Uint8Array;\n featureTableJson?: FeatureTableJson;\n gltf?: GLTFPostprocessed;\n gltfUpAxis: string;\n header: GLTFHeader;\n magic: number;\n modelMatrix: Matrix4;\n rotateYtoZ: boolean;\n rtcCenter: [number, number, number];\n type: string;\n version: number;\n};\n\nexport type GLTFHeader = {\n batchLength?: number;\n batchTableBinaryByteLength: number;\n batchTableJsonByteLength: number;\n featureTableBinaryByteLength: number;\n featureTableJsonByteLength: number;\n};\n\n/**\n * A 3D Tiles tileset JSON\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#property-reference\n */\nexport type Tiles3DTilesetJSON = {\n shape: 'tileset3d';\n /** Metadata about the entire tileset.\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#asset\n */\n asset: {\n /** The 3D Tiles version. The version defines the JSON schema for the tileset JSON and the base set of tile formats. */\n version: string;\n /** Application-specific version of this tileset, e.g., for when an existing tileset is updated. */\n tilesetVersion?: string;\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n /** Not mentioned in 1.0 spec but some tilesets contain this option */\n gltfUpAxis?: string;\n };\n /** A dictionary object of metadata about per-feature properties. */\n properties?: Record<string, TilesetProperty>;\n /** The error, in meters, introduced if this tileset is not rendered. At runtime, the geometric error is used to compute screen space error (SSE), i.e., the error measured in pixels. */\n geometricError: number;\n /** A tile in a 3D Tiles tileset. */\n root: Tiles3DTileJSON;\n /** Names of 3D Tiles extensions used somewhere in this tileset. */\n extensionsUsed?: string[];\n /** Names of 3D Tiles extensions required to properly load this tileset. */\n extensionsRequired?: string[];\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n};\n\n/** TilesetJSON postprocessed by Tiles3DLoader */\nexport type Tiles3DTilesetJSONPostprocessed = Omit<Tiles3DTilesetJSON, 'root'> & {\n /**\n * Loader used\n * @deprecated\n */\n loader: LoaderWithParser;\n /** URL used to load a tileset resource */\n url: string;\n /** HTTP request query string */\n queryString: string;\n /** base path that non-absolute paths in tileset are relative to. */\n basePath: string;\n /** tileset type */\n type: TILESET_TYPE.TILES3D;\n /** LOD metric type */\n lodMetricType: LOD_METRIC_TYPE.GEOMETRIC_ERROR;\n /** LOD metric value */\n lodMetricValue: number;\n /** Postprocessed root */\n root: Tiles3DTileJSONPostprocessed;\n};\n\n/**\n * A tile in a 3D Tiles tileset.\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#tile\n */\nexport type Tiles3DTileJSON = {\n /** A bounding volume that encloses a tile or its content. */\n boundingVolume: Tile3DBoundingVolume;\n /** A bounding volume that encloses a tile or its content. */\n viewerRequestVolume?: object;\n /** The error, in meters, introduced if this tile is rendered and its children are not. At runtime, the geometric error is used to compute screen space error (SSE), i.e., the error measured in pixels. */\n geometricError: number;\n /**\n * Specifies if additive or replacement refinement is used when traversing the tileset for rendering. This property is required for the root tile of a tileset; it is optional for all other tiles.\n * The default is to inherit from the parent tile.\n */\n refine?: string;\n /** A floating-point 4x4 affine transformation matrix, stored in column-major order, that transforms the tile's content */\n transform?: number[];\n /** Metadata about the tile's content and a link to the content. */\n content?: Tiles3DTileContentJSON;\n /** An array of objects that define child tiles. */\n children: Tiles3DTileJSON[];\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n\n /** 3DTiles v1.1 properties\n * https://github.com/CesiumGS/3d-tiles/blob/draft-1.1/specification/schema/tile.schema.json\n */\n /** This object allows a tile to be implicitly subdivided. Tile and content availability and metadata is stored in subtrees which are referenced externally. */\n implicitTiling?: ImplicitTilingData;\n};\n\nexport type Tiles3DTileJSONPostprocessed = Omit<Tiles3DTileJSON, 'refine' | 'children'> & {\n /** Unique ID */\n id?: string;\n /** Content full URL */\n contentUrl?: string;\n /** LOD metric type */\n lodMetricType?: LOD_METRIC_TYPE.GEOMETRIC_ERROR;\n /** LOD metric value */\n lodMetricValue?: number;\n /** Duplicate of transform */\n transformMatrix?: number[];\n /** Type of tile */\n type?: TILE_TYPE | string;\n /**\n * Specifies if additive or replacement refinement is used when traversing the tileset for rendering. This property is required for the root tile of a tileset; it is optional for all other tiles.\n * The default is to inherit from the parent tile.\n */\n refine?: TILE_REFINEMENT | string;\n /** An array of objects that define child tiles. */\n children: Tiles3DTileJSONPostprocessed[];\n};\n\n/** Metadata about the tile's content and a link to the content. */\nexport type Tiles3DTileContentJSON = {\n /** A uri that points to the tile's content. When the uri is relative, it is relative to the referring tileset JSON file. */\n uri: string;\n /** url doesn't allign the spec but we support it same way as uri */\n url?: string;\n /** A bounding volume that encloses a tile or its content. At least one bounding volume property is required. Bounding volumes include box, region, or sphere. */\n boundingVolume?: Tile3DBoundingVolume;\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n};\n\n/** A bounding volume that encloses a tile or its content.\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#bounding-volume\n */\nexport type Tile3DBoundingVolume = {\n /** An array of 12 numbers that define an oriented bounding box. The first three elements define the x, y, and z values for the center of the box.\n * The next three elements (with indices 3, 4, and 5) define the x axis direction and half-length. The next three elements (indices 6, 7, and 8) define\n * the y axis direction and half-length. The last three elements (indices 9, 10, and 11) define the z axis direction and half-length. */\n box?: number[];\n /** An array of four numbers that define a bounding sphere. The first three elements define the x, y, and z values for the center of the sphere.\n * The last element (with index 3) defines the radius in meters. */\n sphere?: number[];\n /** An array of six numbers that define a bounding geographic region in EPSG:4979 coordinates with the order [west, south, east, north, minimum height, maximum height].\n * Longitudes and latitudes are in radians, and heights are in meters above (or below) the WGS84 ellipsoid. */\n region?: number[];\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n};\n\n/**\n * A dictionary object of metadata about per-feature properties.\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#properties\n */\nexport type TilesetProperty = {\n /** The maximum value of this property of all the features in the tileset. */\n maximum: number;\n /** The minimum value of this property of all the features in the tileset. */\n minimum: number;\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n};\n\nexport type Tiles3DTileContent = {\n shape: 'tile3d';\n\n /** Common properties */\n byteOffset?: number;\n type?: string;\n featureIds?: null;\n\n /** 3DTile header */\n magic?: number;\n version?: number;\n byteLength?: number;\n\n /** 3DTile tables header */\n header?: {\n featureTableJsonByteLength?: number;\n featureTableBinaryByteLength?: number;\n batchTableJsonByteLength?: number;\n batchTableBinaryByteLength?: number;\n batchLength?: number;\n };\n\n /** 3DTile tables */\n featureTableJson?:\n | {\n BATCH_LENGTH?: number;\n }\n | Record<string, any>;\n featureTableBinary?: Uint8Array;\n batchTableJson?: Record<string, (string | number)[]>;\n batchTableBinary?: Uint8Array;\n rtcCenter?: number[];\n\n /** 3DTile glTF */\n gltfArrayBuffer?: ArrayBuffer;\n gltfByteOffset?: number;\n gltfByteLength?: number;\n rotateYtoZ?: boolean;\n gltfUpAxis?: 'x' | 'X' | 'y' | 'Y' | 'z' | 'Z';\n gltfUrl?: string;\n gpuMemoryUsageInBytes?: number;\n gltf?: GLTFPostprocessed;\n\n /** For Composite tiles */\n tilesLength?: number;\n tiles?: Tiles3DTileContent[];\n\n /** For Instances model and Pointcloud tiles */\n featuresLength?: number;\n\n /** For Instanced model tiles */\n gltfFormat?: number;\n eastNorthUp?: boolean;\n normalUp?: number[];\n normalRight?: number[];\n hasCustomOrientation?: boolean;\n octNormalUp?: number[];\n octNormalRight?: number[];\n instances?: {\n modelMatrix: Matrix4;\n batchId: number;\n }[];\n\n /** For Pointcloud tiles */\n attributes?: {\n positions: null | number[];\n colors:\n | null\n | number[]\n | {type: number; value: Uint8ClampedArray; size: number; normalized: boolean};\n normals: null | number[] | {type: number; size: number; value: Float32Array};\n batchIds: null | number[];\n };\n constantRGBA?: number[];\n isQuantized?: boolean;\n isTranslucent?: boolean;\n isRGB565?: boolean;\n isOctEncoded16P?: boolean;\n pointsLength?: number;\n pointCount?: number;\n batchIds?: number[];\n hasPositions?: boolean;\n hasColors?: boolean;\n hasNormals?: boolean;\n hasBatchIds?: boolean;\n quantizedVolumeScale?: Vector3;\n quantizedVolumeOffset?: Vector3;\n quantizedRange?: number;\n isQuantizedDraco?: boolean;\n octEncodedRange?: number;\n isOctEncodedDraco?: boolean;\n};\n\n/**\n * 3DTILES_implicit_tiling types\n * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling\n * JSON Schema v1.1 https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/specification/schema/Subtree/subtree.schema.json\n * JSON Schema vNext https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/extensions/3DTILES_implicit_tiling/schema/subtree/subtree.schema.json\n */\nexport type Subtree = {\n /** An array of buffers. */\n buffers: Buffer[];\n /** An array of buffer views. */\n bufferViews: BufferView[];\n /** The availability of tiles in the subtree. The availability bitstream is a 1D boolean array where tiles are ordered by their level in the subtree and Morton index\n * within that level. A tile's availability is determined by a single bit, 1 meaning a tile exists at that spatial index, and 0 meaning it does not.\n * The number of elements in the array is `(N^subtreeLevels - 1)/(N - 1)` where N is 4 for subdivision scheme `QUADTREE` and 8 for `OCTREE`.\n * Availability may be stored in a buffer view or as a constant value that applies to all tiles. If a non-root tile's availability is 1 its parent\n * tile's availability shall also be 1. `tileAvailability.constant: 0` is disallowed, as subtrees shall have at least one tile.\n */\n tileAvailability: Availability;\n /** It is array by spec but there are tiles that has a single object\n * An array of content availability objects. If the tile has a single content this array will have one element; if the tile has multiple contents -\n * as supported by 3DTILES_multiple_contents and 3D Tiles 1.1 - this array will have multiple elements.\n */\n contentAvailability: Availability | Availability[];\n /** The availability of children subtrees. The availability bitstream is a 1D boolean array where subtrees are ordered by their Morton index in the level of the tree\n * immediately below the bottom row of the subtree. A child subtree's availability is determined by a single bit, 1 meaning a subtree exists at that spatial index,\n * and 0 meaning it does not. The number of elements in the array is `N^subtreeLevels` where N is 4 for subdivision scheme `QUADTREE` and 8 for `OCTREE`.\n * Availability may be stored in a buffer view or as a constant value that applies to all child subtrees. If availability is 0 for all child subtrees,\n * then the tileset does not subdivide further.\n */\n childSubtreeAvailability: Availability;\n // TODO: These are unused properties. Improve types when they are required\n propertyTables: unknown;\n tileMetadata: unknown;\n contentMetadata: unknown;\n subtreeMetadata: unknown;\n};\n\nexport type Availability = {\n /** Integer indicating whether all of the elements are available (1) or all are unavailable (0). */\n constant?: 0 | 1;\n /** Index of a buffer view that indicates whether each element is available. The bitstream conforms to the boolean array encoding described\n * in the 3D Metadata specification. If an element is available, its bit is 1, and if it is unavailable, its bit is 0. */\n bitstream?: number;\n /**\n * v1.1 https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/specification/schema/Subtree/availability.schema.json\n * vNext https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/extensions/3DTILES_implicit_tiling/schema/subtree/availability.schema.json\n * The schemas of vNext and 1.1 are same but there are tiles with `bufferView` property instead of `bitstream`\n */\n bufferView?: number;\n /**\n * Postprocessing property\n * contain availability bits loaded from the bufferView\n */\n explicitBitstream?: ExplicitBitstream;\n};\n\nexport type ExplicitBitstream = Uint8Array;\n\n/**\n * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling#subdivision-scheme\n */\nexport type SubdivisionScheme = 'QUADTREE' | 'OCTREE';\n\ntype Buffer = {\n name: string;\n uri?: string;\n byteLength: number;\n};\n\n/** Subtree buffer view */\nexport type BufferView = {\n buffer: number;\n byteOffset: number;\n byteLength: number;\n};\n\n/**\n * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling\n */\nexport type ImplicitTilingExensionData = ImplicitTilingData & {\n /** This property is not part of the schema\n * https://github.com/CesiumGS/3d-tiles/blob/main/extensions/3DTILES_implicit_tiling/schema/tile.3DTILES_implicit_tiling.schema.json\n * But it can be seen in some test datasets. It is handled as substitute of `availableLevels`\n */\n maximumLevel?: number;\n};\n\n/** 3DTiles v1.1 types */\n\n/**\n * This object allows a tile to be implicitly subdivided. Tile and content availability and metadata is stored in subtrees which are referenced externally.\n * https://github.com/CesiumGS/3d-tiles/blob/draft-1.1/specification/schema/tile.implicitTiling.schema.json\n * */\ntype ImplicitTilingData = {\n /** A string describing the subdivision scheme used within the tileset. */\n subdivisionScheme: 'QUADTREE' | 'OCTREE' | string;\n /** The number of distinct levels in each subtree. For example, a quadtree with `subtreeLevels = 2` will have subtrees with 5 nodes (one root and 4 children). */\n subtreeLevels: number;\n /** The numbers of the levels in the tree with available tiles. */\n availableLevels: number;\n /** An object describing the location of subtree files. */\n subtrees: {\n /** A template URI pointing to subtree files. A subtree is a fixed-depth (defined by `subtreeLevels`) portion of the tree to keep memory use bounded.\n * The URI of each file is substituted with the subtree root's global level, x, and y. For subdivision scheme `OCTREE`, z shall also be given. Relative paths are relative to the tileset JSON. */\n uri: string;\n };\n};\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../src/types.ts"],"sourcesContent":["import type {GLTFPostprocessed, FeatureTableJson} from '@loaders.gl/gltf';\nexport type {FeatureTableJson};\n\nimport {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {Matrix4, Vector3} from '@math.gl/core';\nimport {TILESET_TYPE, LOD_METRIC_TYPE, TILE_TYPE, TILE_REFINEMENT} from '@loaders.gl/tiles';\n\nexport type B3DMContent = {\n batchTableJson?: FeatureTableJson;\n byteLength: number;\n byteOffset: number;\n cartesianModelMatrix: Matrix4;\n cartesianOrigin: Vector3;\n cartographicModelMatrix: Matrix4;\n cartographicOrigin: Vector3;\n featureIds?: number[] | null;\n featureTableBinary?: Uint8Array;\n featureTableJson?: FeatureTableJson;\n gltf?: GLTFPostprocessed;\n gltfUpAxis: string;\n header: GLTFHeader;\n magic: number;\n modelMatrix: Matrix4;\n rotateYtoZ: boolean;\n rtcCenter: [number, number, number];\n type: string;\n version: number;\n};\n\nexport type GLTFHeader = {\n batchLength?: number;\n batchTableBinaryByteLength: number;\n batchTableJsonByteLength: number;\n featureTableBinaryByteLength: number;\n featureTableJsonByteLength: number;\n};\n\n/**\n * A 3D Tiles tileset JSON\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#property-reference\n */\nexport type Tiles3DTilesetJSON = {\n shape: 'tileset3d';\n /** Metadata about the entire tileset.\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#asset\n */\n asset: {\n /** The 3D Tiles version. The version defines the JSON schema for the tileset JSON and the base set of tile formats. */\n version: string;\n /** Application-specific version of this tileset, e.g., for when an existing tileset is updated. */\n tilesetVersion?: string;\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n /** Not mentioned in 1.0 spec but some tilesets contain this option */\n gltfUpAxis?: string;\n };\n /** A dictionary object of metadata about per-feature properties. */\n properties?: Record<string, TilesetProperty>;\n /** The error, in meters, introduced if this tileset is not rendered. At runtime, the geometric error is used to compute screen space error (SSE), i.e., the error measured in pixels. */\n geometricError: number;\n /** A tile in a 3D Tiles tileset. */\n root: Tiles3DTileJSON;\n /** Names of 3D Tiles extensions used somewhere in this tileset. */\n extensionsUsed?: string[];\n /** Names of 3D Tiles extensions required to properly load this tileset. */\n extensionsRequired?: string[];\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n};\n\n/** TilesetJSON postprocessed by Tiles3DLoader */\nexport type Tiles3DTilesetJSONPostprocessed = Omit<Tiles3DTilesetJSON, 'root'> & {\n /**\n * Loader used\n * @deprecated\n */\n loader: LoaderWithParser;\n /** URL used to load a tileset resource */\n url: string;\n /** HTTP request query string */\n queryString: string;\n /** base path that non-absolute paths in tileset are relative to. */\n basePath: string;\n /** tileset type */\n type: TILESET_TYPE.TILES3D;\n /** LOD metric type */\n lodMetricType: LOD_METRIC_TYPE.GEOMETRIC_ERROR;\n /** LOD metric value */\n lodMetricValue: number;\n /** Postprocessed root */\n root: Tiles3DTileJSONPostprocessed;\n};\n\n/**\n * A tile in a 3D Tiles tileset.\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#tile\n */\nexport type Tiles3DTileJSON = {\n /** A bounding volume that encloses a tile or its content. */\n boundingVolume: Tile3DBoundingVolume;\n /** A bounding volume that encloses a tile or its content. */\n viewerRequestVolume?: object;\n /** The error, in meters, introduced if this tile is rendered and its children are not. At runtime, the geometric error is used to compute screen space error (SSE), i.e., the error measured in pixels. */\n geometricError: number;\n /**\n * Specifies if additive or replacement refinement is used when traversing the tileset for rendering. This property is required for the root tile of a tileset; it is optional for all other tiles.\n * The default is to inherit from the parent tile.\n */\n refine?: string;\n /** A floating-point 4x4 affine transformation matrix, stored in column-major order, that transforms the tile's content */\n transform?: number[];\n /** Metadata about the tile's content and a link to the content. */\n content?: Tiles3DTileContentJSON;\n /** An array of objects that define child tiles. */\n children: Tiles3DTileJSON[];\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n\n /** 3DTiles v1.1 properties\n * https://github.com/CesiumGS/3d-tiles/blob/draft-1.1/specification/schema/tile.schema.json\n */\n /** This object allows a tile to be implicitly subdivided. Tile and content availability and metadata is stored in subtrees which are referenced externally. */\n implicitTiling?: ImplicitTilingData;\n};\n\nexport type Tiles3DTileJSONPostprocessed = Omit<Tiles3DTileJSON, 'refine' | 'children'> & {\n /** Unique ID */\n id?: string;\n /** Content full URL */\n contentUrl?: string;\n /** LOD metric type */\n lodMetricType?: LOD_METRIC_TYPE.GEOMETRIC_ERROR;\n /** LOD metric value */\n lodMetricValue?: number;\n /** Duplicate of transform */\n transformMatrix?: number[];\n /** Type of tile */\n type?: TILE_TYPE | string;\n /**\n * Specifies if additive or replacement refinement is used when traversing the tileset for rendering. This property is required for the root tile of a tileset; it is optional for all other tiles.\n * The default is to inherit from the parent tile.\n */\n refine?: TILE_REFINEMENT | string;\n /** An array of objects that define child tiles. */\n children: Tiles3DTileJSONPostprocessed[];\n};\n\n/** Metadata about the tile's content and a link to the content. */\nexport type Tiles3DTileContentJSON = {\n /** A uri that points to the tile's content. When the uri is relative, it is relative to the referring tileset JSON file. */\n uri: string;\n /** url doesn't allign the spec but we support it same way as uri */\n url?: string;\n /** A bounding volume that encloses a tile or its content. At least one bounding volume property is required. Bounding volumes include box, region, or sphere. */\n boundingVolume?: Tile3DBoundingVolume;\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n};\n\n/** A bounding volume that encloses a tile or its content.\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#bounding-volume\n */\nexport type Tile3DBoundingVolume = {\n /** An array of 12 numbers that define an oriented bounding box. The first three elements define the x, y, and z values for the center of the box.\n * The next three elements (with indices 3, 4, and 5) define the x axis direction and half-length. The next three elements (indices 6, 7, and 8) define\n * the y axis direction and half-length. The last three elements (indices 9, 10, and 11) define the z axis direction and half-length. */\n box?: number[];\n /** An array of four numbers that define a bounding sphere. The first three elements define the x, y, and z values for the center of the sphere.\n * The last element (with index 3) defines the radius in meters. */\n sphere?: number[];\n /** An array of six numbers that define a bounding geographic region in EPSG:4979 coordinates with the order [west, south, east, north, minimum height, maximum height].\n * Longitudes and latitudes are in radians, and heights are in meters above (or below) the WGS84 ellipsoid. */\n region?: number[];\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n};\n\n/**\n * A dictionary object of metadata about per-feature properties.\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#properties\n */\nexport type TilesetProperty = {\n /** The maximum value of this property of all the features in the tileset. */\n maximum: number;\n /** The minimum value of this property of all the features in the tileset. */\n minimum: number;\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n};\n\nexport type Tiles3DTileContent = {\n shape: 'tile3d';\n\n /** Common properties */\n byteOffset?: number;\n type?: string;\n featureIds?: null;\n\n /** 3DTile header */\n magic?: number;\n version?: number;\n byteLength?: number;\n\n /** 3DTile tables header */\n header?: {\n featureTableJsonByteLength?: number;\n featureTableBinaryByteLength?: number;\n batchTableJsonByteLength?: number;\n batchTableBinaryByteLength?: number;\n batchLength?: number;\n };\n\n /** 3DTile tables */\n featureTableJson?:\n | {\n BATCH_LENGTH?: number;\n }\n | Record<string, any>;\n featureTableBinary?: Uint8Array;\n batchTableJson?: Record<string, (string | number)[]>;\n batchTableBinary?: Uint8Array;\n rtcCenter?: number[];\n\n /** 3DTile glTF */\n gltfArrayBuffer?: ArrayBuffer;\n gltfByteOffset?: number;\n gltfByteLength?: number;\n rotateYtoZ?: boolean;\n gltfUpAxis?: 'x' | 'X' | 'y' | 'Y' | 'z' | 'Z';\n gltfUrl?: string;\n gpuMemoryUsageInBytes?: number;\n gltf?: GLTFPostprocessed;\n\n /** For Composite tiles */\n tilesLength?: number;\n tiles?: Tiles3DTileContent[];\n\n /** For Instances model and Pointcloud tiles */\n featuresLength?: number;\n\n /** For Instanced model tiles */\n gltfFormat?: number;\n eastNorthUp?: boolean;\n normalUp?: number[];\n normalRight?: number[];\n hasCustomOrientation?: boolean;\n octNormalUp?: number[];\n octNormalRight?: number[];\n instances?: {\n modelMatrix: Matrix4;\n batchId: number;\n }[];\n\n /** For Pointcloud tiles */\n attributes?: {\n positions: null | number[];\n colors:\n | null\n | number[]\n | {type: number; value: Uint8ClampedArray; size: number; normalized: boolean};\n normals: null | number[] | {type: number; size: number; value: Float32Array};\n batchIds: null | number[];\n };\n constantRGBA?: number[];\n isQuantized?: boolean;\n isTranslucent?: boolean;\n isRGB565?: boolean;\n isOctEncoded16P?: boolean;\n pointsLength?: number;\n pointCount?: number;\n batchIds?: number[];\n hasPositions?: boolean;\n hasColors?: boolean;\n hasNormals?: boolean;\n hasBatchIds?: boolean;\n quantizedVolumeScale?: Vector3;\n quantizedVolumeOffset?: Vector3;\n quantizedRange?: number;\n isQuantizedDraco?: boolean;\n octEncodedRange?: number;\n isOctEncodedDraco?: boolean;\n};\n\n/**\n * 3DTILES_implicit_tiling types\n * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling\n * JSON Schema v1.1 https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/specification/schema/Subtree/subtree.schema.json\n * JSON Schema vNext https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/extensions/3DTILES_implicit_tiling/schema/subtree/subtree.schema.json\n */\nexport type Subtree = {\n /** An array of buffers. */\n buffers: Buffer[];\n /** An array of buffer views. */\n bufferViews: BufferView[];\n /** The availability of tiles in the subtree. The availability bitstream is a 1D boolean array where tiles are ordered by their level in the subtree and Morton index\n * within that level. A tile's availability is determined by a single bit, 1 meaning a tile exists at that spatial index, and 0 meaning it does not.\n * The number of elements in the array is `(N^subtreeLevels - 1)/(N - 1)` where N is 4 for subdivision scheme `QUADTREE` and 8 for `OCTREE`.\n * Availability may be stored in a buffer view or as a constant value that applies to all tiles. If a non-root tile's availability is 1 its parent\n * tile's availability shall also be 1. `tileAvailability.constant: 0` is disallowed, as subtrees shall have at least one tile.\n */\n tileAvailability: Availability;\n /** It is array by spec but there are tiles that has a single object\n * An array of content availability objects. If the tile has a single content this array will have one element; if the tile has multiple contents -\n * as supported by 3DTILES_multiple_contents and 3D Tiles 1.1 - this array will have multiple elements.\n */\n contentAvailability: Availability | Availability[];\n /** The availability of children subtrees. The availability bitstream is a 1D boolean array where subtrees are ordered by their Morton index in the level of the tree\n * immediately below the bottom row of the subtree. A child subtree's availability is determined by a single bit, 1 meaning a subtree exists at that spatial index,\n * and 0 meaning it does not. The number of elements in the array is `N^subtreeLevels` where N is 4 for subdivision scheme `QUADTREE` and 8 for `OCTREE`.\n * Availability may be stored in a buffer view or as a constant value that applies to all child subtrees. If availability is 0 for all child subtrees,\n * then the tileset does not subdivide further.\n */\n childSubtreeAvailability: Availability;\n // TODO: These are unused properties. Improve types when they are required\n propertyTables: unknown;\n tileMetadata: unknown;\n contentMetadata: unknown;\n subtreeMetadata: unknown;\n};\n\nexport type Availability = {\n /** Integer indicating whether all of the elements are available (1) or all are unavailable (0). */\n constant?: 0 | 1;\n /** Index of a buffer view that indicates whether each element is available. The bitstream conforms to the boolean array encoding described\n * in the 3D Metadata specification. If an element is available, its bit is 1, and if it is unavailable, its bit is 0. */\n bitstream?: number;\n /**\n * v1.1 https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/specification/schema/Subtree/availability.schema.json\n * vNext https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/extensions/3DTILES_implicit_tiling/schema/subtree/availability.schema.json\n * The schemas of vNext and 1.1 are same but there are tiles with `bufferView` property instead of `bitstream`\n */\n bufferView?: number;\n /**\n * Postprocessing property\n * contain availability bits loaded from the bufferView\n */\n explicitBitstream?: ExplicitBitstream;\n};\n\nexport type ExplicitBitstream = Uint8Array;\n\n/**\n * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling#subdivision-scheme\n */\nexport type SubdivisionScheme = 'QUADTREE' | 'OCTREE';\n\ntype Buffer = {\n name: string;\n uri?: string;\n byteLength: number;\n};\n\n/** Subtree buffer view */\nexport type BufferView = {\n buffer: number;\n byteOffset: number;\n byteLength: number;\n};\n\n/**\n * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling\n */\nexport type ImplicitTilingExensionData = ImplicitTilingData & {\n /** This property is not part of the schema\n * https://github.com/CesiumGS/3d-tiles/blob/main/extensions/3DTILES_implicit_tiling/schema/tile.3DTILES_implicit_tiling.schema.json\n * But it can be seen in some test datasets. It is handled as substitute of `availableLevels`\n */\n maximumLevel?: number;\n};\n\n/** 3DTiles v1.1 types */\n\n/**\n * This object allows a tile to be implicitly subdivided. Tile and content availability and metadata is stored in subtrees which are referenced externally.\n * https://github.com/CesiumGS/3d-tiles/blob/draft-1.1/specification/schema/tile.implicitTiling.schema.json\n * */\ntype ImplicitTilingData = {\n /** A string describing the subdivision scheme used within the tileset. */\n subdivisionScheme: 'QUADTREE' | 'OCTREE' | string;\n /** The number of distinct levels in each subtree. For example, a quadtree with `subtreeLevels = 2` will have subtrees with 5 nodes (one root and 4 children). */\n subtreeLevels: number;\n /** The numbers of the levels in the tree with available tiles. */\n availableLevels: number;\n /** An object describing the location of subtree files. */\n subtrees: {\n /** A template URI pointing to subtree files. A subtree is a fixed-depth (defined by `subtreeLevels`) portion of the tree to keep memory use bounded.\n * The URI of each file is substituted with the subtree root's global level, x, and y. For subdivision scheme `OCTREE`, z shall also be given. Relative paths are relative to the tileset JSON. */\n uri: string;\n };\n};\n"],"mappings":""}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import type { GLTFPostprocessed } from '@loaders.gl/gltf';
|
|
1
|
+
import type { GLTFPostprocessed, FeatureTableJson } from '@loaders.gl/gltf';
|
|
2
|
+
export type { FeatureTableJson };
|
|
2
3
|
import { LoaderWithParser } from '@loaders.gl/loader-utils';
|
|
3
4
|
import { Matrix4, Vector3 } from '@math.gl/core';
|
|
4
5
|
import { TILESET_TYPE, LOD_METRIC_TYPE, TILE_TYPE, TILE_REFINEMENT } from '@loaders.gl/tiles';
|
|
5
|
-
export type FeatureTableJson = {
|
|
6
|
-
[key: string]: any[];
|
|
7
|
-
};
|
|
8
6
|
export type B3DMContent = {
|
|
9
7
|
batchTableJson?: FeatureTableJson;
|
|
10
8
|
byteLength: number;
|
|
@@ -375,5 +373,4 @@ type ImplicitTilingData = {
|
|
|
375
373
|
uri: string;
|
|
376
374
|
};
|
|
377
375
|
};
|
|
378
|
-
export {};
|
|
379
376
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAE,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAC1E,YAAY,EAAC,gBAAgB,EAAC,CAAC;AAE/B,OAAO,EAAC,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAC,OAAO,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAC,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAE5F,MAAM,MAAM,WAAW,GAAG;IACxB,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,eAAe,EAAE,OAAO,CAAC;IACzB,uBAAu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
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.25",
|
|
4
4
|
"description": "3D Tiles, an open standard for streaming massive heterogeneous 3D geospatial datasets.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
"build-bundle": "esbuild src/bundle.ts --bundle --outfile=dist/dist.min.js"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@loaders.gl/draco": "4.0.0-alpha.
|
|
38
|
-
"@loaders.gl/gltf": "4.0.0-alpha.
|
|
39
|
-
"@loaders.gl/loader-utils": "4.0.0-alpha.
|
|
40
|
-
"@loaders.gl/math": "4.0.0-alpha.
|
|
41
|
-
"@loaders.gl/tiles": "4.0.0-alpha.
|
|
42
|
-
"@loaders.gl/zip": "4.0.0-alpha.
|
|
37
|
+
"@loaders.gl/draco": "4.0.0-alpha.25",
|
|
38
|
+
"@loaders.gl/gltf": "4.0.0-alpha.25",
|
|
39
|
+
"@loaders.gl/loader-utils": "4.0.0-alpha.25",
|
|
40
|
+
"@loaders.gl/math": "4.0.0-alpha.25",
|
|
41
|
+
"@loaders.gl/tiles": "4.0.0-alpha.25",
|
|
42
|
+
"@loaders.gl/zip": "4.0.0-alpha.25",
|
|
43
43
|
"@math.gl/core": "^3.5.1",
|
|
44
44
|
"@math.gl/geospatial": "^3.5.1",
|
|
45
45
|
"@probe.gl/log": "^4.0.4",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@loaders.gl/core": "^4.0.0-alpha.8"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "40135f391b869388dbbcd615bbe51178d0c370be"
|
|
52
52
|
}
|
package/src/types.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import type {GLTFPostprocessed} from '@loaders.gl/gltf';
|
|
1
|
+
import type {GLTFPostprocessed, FeatureTableJson} from '@loaders.gl/gltf';
|
|
2
|
+
export type {FeatureTableJson};
|
|
3
|
+
|
|
2
4
|
import {LoaderWithParser} from '@loaders.gl/loader-utils';
|
|
3
5
|
import {Matrix4, Vector3} from '@math.gl/core';
|
|
4
6
|
import {TILESET_TYPE, LOD_METRIC_TYPE, TILE_TYPE, TILE_REFINEMENT} from '@loaders.gl/tiles';
|
|
5
7
|
|
|
6
|
-
export type FeatureTableJson = {
|
|
7
|
-
[key: string]: any[];
|
|
8
|
-
};
|
|
9
|
-
|
|
10
8
|
export type B3DMContent = {
|
|
11
9
|
batchTableJson?: FeatureTableJson;
|
|
12
10
|
byteLength: number;
|