@loaders.gl/3d-tiles 4.0.0-alpha.18 → 4.0.0-alpha.20
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
CHANGED
|
@@ -566,32 +566,33 @@
|
|
|
566
566
|
});
|
|
567
567
|
|
|
568
568
|
// ../worker-utils/src/lib/library-utils/library-utils.ts
|
|
569
|
-
async function loadLibrary(libraryUrl, moduleName = null, options = {}) {
|
|
569
|
+
async function loadLibrary(libraryUrl, moduleName = null, options = {}, libraryName = null) {
|
|
570
570
|
if (moduleName) {
|
|
571
|
-
libraryUrl = getLibraryUrl(libraryUrl, moduleName, options);
|
|
571
|
+
libraryUrl = getLibraryUrl(libraryUrl, moduleName, options, libraryName);
|
|
572
572
|
}
|
|
573
573
|
loadLibraryPromises[libraryUrl] = loadLibraryPromises[libraryUrl] || loadLibraryFromFile(libraryUrl);
|
|
574
574
|
return await loadLibraryPromises[libraryUrl];
|
|
575
575
|
}
|
|
576
|
-
function getLibraryUrl(library, moduleName, options) {
|
|
577
|
-
if (library.startsWith("http")) {
|
|
576
|
+
function getLibraryUrl(library, moduleName, options = {}, libraryName = null) {
|
|
577
|
+
if (!options.useLocalLibraries && library.startsWith("http")) {
|
|
578
578
|
return library;
|
|
579
579
|
}
|
|
580
|
+
libraryName = libraryName || library;
|
|
580
581
|
const modules = options.modules || {};
|
|
581
|
-
if (modules[
|
|
582
|
-
return modules[
|
|
582
|
+
if (modules[libraryName]) {
|
|
583
|
+
return modules[libraryName];
|
|
583
584
|
}
|
|
584
585
|
if (!isBrowser2) {
|
|
585
|
-
return `modules/${moduleName}/dist/libs/${
|
|
586
|
+
return `modules/${moduleName}/dist/libs/${libraryName}`;
|
|
586
587
|
}
|
|
587
588
|
if (options.CDN) {
|
|
588
589
|
assert3(options.CDN.startsWith("http"));
|
|
589
|
-
return `${options.CDN}/${moduleName}@${VERSION2}/dist/libs/${
|
|
590
|
+
return `${options.CDN}/${moduleName}@${VERSION2}/dist/libs/${libraryName}`;
|
|
590
591
|
}
|
|
591
592
|
if (isWorker) {
|
|
592
|
-
return `../src/libs/${
|
|
593
|
+
return `../src/libs/${libraryName}`;
|
|
593
594
|
}
|
|
594
|
-
return `modules/${moduleName}/src/libs/${
|
|
595
|
+
return `modules/${moduleName}/src/libs/${libraryName}`;
|
|
595
596
|
}
|
|
596
597
|
async function loadLibraryFromFile(libraryUrl) {
|
|
597
598
|
if (libraryUrl.endsWith("wasm")) {
|
|
@@ -6204,6 +6205,7 @@
|
|
|
6204
6205
|
mimeType: void 0,
|
|
6205
6206
|
nothrow: false,
|
|
6206
6207
|
log: new ConsoleLog(),
|
|
6208
|
+
useLocalLibraries: false,
|
|
6207
6209
|
CDN: "https://unpkg.com/@loaders.gl",
|
|
6208
6210
|
worker: true,
|
|
6209
6211
|
maxConcurrency: 3,
|
|
@@ -6784,12 +6786,12 @@
|
|
|
6784
6786
|
// ../core/src/lib/loader-utils/get-fetch-function.ts
|
|
6785
6787
|
function getFetchFunction(options, context) {
|
|
6786
6788
|
const globalOptions = getGlobalLoaderOptions();
|
|
6787
|
-
const
|
|
6788
|
-
if (typeof
|
|
6789
|
-
return
|
|
6789
|
+
const loaderOptions = options || globalOptions;
|
|
6790
|
+
if (typeof loaderOptions.fetch === "function") {
|
|
6791
|
+
return loaderOptions.fetch;
|
|
6790
6792
|
}
|
|
6791
|
-
if (isObject(
|
|
6792
|
-
return (url) => fetchFile(url,
|
|
6793
|
+
if (isObject(loaderOptions.fetch)) {
|
|
6794
|
+
return (url) => fetchFile(url, loaderOptions.fetch);
|
|
6793
6795
|
}
|
|
6794
6796
|
if (context?.fetch) {
|
|
6795
6797
|
return context?.fetch;
|
|
@@ -7568,13 +7570,13 @@
|
|
|
7568
7570
|
let wasmBinary;
|
|
7569
7571
|
switch (options.draco && options.draco.decoderType) {
|
|
7570
7572
|
case "js":
|
|
7571
|
-
DracoDecoderModule = await loadLibrary(
|
|
7573
|
+
DracoDecoderModule = await loadLibrary(DRACO_EXTERNAL_LIBRARY_URLS[DRACO_EXTERNAL_LIBRARIES.FALLBACK_DECODER], "draco", options, DRACO_EXTERNAL_LIBRARIES.FALLBACK_DECODER);
|
|
7572
7574
|
break;
|
|
7573
7575
|
case "wasm":
|
|
7574
7576
|
default:
|
|
7575
7577
|
[DracoDecoderModule, wasmBinary] = await Promise.all([
|
|
7576
|
-
await loadLibrary(
|
|
7577
|
-
await loadLibrary(
|
|
7578
|
+
await loadLibrary(DRACO_EXTERNAL_LIBRARY_URLS[DRACO_EXTERNAL_LIBRARIES.DECODER], "draco", options, DRACO_EXTERNAL_LIBRARIES.DECODER),
|
|
7579
|
+
await loadLibrary(DRACO_EXTERNAL_LIBRARY_URLS[DRACO_EXTERNAL_LIBRARIES.DECODER_WASM], "draco", options, DRACO_EXTERNAL_LIBRARIES.DECODER_WASM)
|
|
7578
7580
|
]);
|
|
7579
7581
|
}
|
|
7580
7582
|
DracoDecoderModule = DracoDecoderModule || globalThis.DracoDecoderModule;
|
|
@@ -7592,17 +7594,25 @@
|
|
|
7592
7594
|
});
|
|
7593
7595
|
});
|
|
7594
7596
|
}
|
|
7595
|
-
var DRACO_DECODER_VERSION, DRACO_ENCODER_VERSION, STATIC_DECODER_URL,
|
|
7597
|
+
var DRACO_DECODER_VERSION, DRACO_ENCODER_VERSION, STATIC_DECODER_URL, DRACO_EXTERNAL_LIBRARIES, DRACO_EXTERNAL_LIBRARY_URLS, loadDecoderPromise;
|
|
7596
7598
|
var init_draco_module_loader = __esm({
|
|
7597
7599
|
"../draco/src/lib/draco-module-loader.ts"() {
|
|
7598
7600
|
init_src();
|
|
7599
7601
|
DRACO_DECODER_VERSION = "1.5.5";
|
|
7600
7602
|
DRACO_ENCODER_VERSION = "1.4.1";
|
|
7601
7603
|
STATIC_DECODER_URL = `https://www.gstatic.com/draco/versioned/decoders/${DRACO_DECODER_VERSION}`;
|
|
7602
|
-
|
|
7603
|
-
|
|
7604
|
-
|
|
7605
|
-
|
|
7604
|
+
DRACO_EXTERNAL_LIBRARIES = {
|
|
7605
|
+
DECODER: "draco_wasm_wrapper.js",
|
|
7606
|
+
DECODER_WASM: "draco_decoder.wasm",
|
|
7607
|
+
FALLBACK_DECODER: "draco_decoder.js",
|
|
7608
|
+
ENCODER: "draco_encoder.js"
|
|
7609
|
+
};
|
|
7610
|
+
DRACO_EXTERNAL_LIBRARY_URLS = {
|
|
7611
|
+
[DRACO_EXTERNAL_LIBRARIES.DECODER]: `${STATIC_DECODER_URL}/${DRACO_EXTERNAL_LIBRARIES.DECODER}`,
|
|
7612
|
+
[DRACO_EXTERNAL_LIBRARIES.DECODER_WASM]: `${STATIC_DECODER_URL}/${DRACO_EXTERNAL_LIBRARIES.DECODER_WASM}`,
|
|
7613
|
+
[DRACO_EXTERNAL_LIBRARIES.FALLBACK_DECODER]: `${STATIC_DECODER_URL}/${DRACO_EXTERNAL_LIBRARIES.FALLBACK_DECODER}`,
|
|
7614
|
+
[DRACO_EXTERNAL_LIBRARIES.ENCODER]: `https://raw.githubusercontent.com/google/draco/${DRACO_ENCODER_VERSION}/javascript/${DRACO_EXTERNAL_LIBRARIES.ENCODER}`
|
|
7615
|
+
};
|
|
7606
7616
|
}
|
|
7607
7617
|
});
|
|
7608
7618
|
|
|
@@ -9403,8 +9413,8 @@
|
|
|
9403
9413
|
let BASIS = null;
|
|
9404
9414
|
let wasmBinary = null;
|
|
9405
9415
|
[BASIS, wasmBinary] = await Promise.all([
|
|
9406
|
-
await loadLibrary(
|
|
9407
|
-
await loadLibrary(
|
|
9416
|
+
await loadLibrary(BASIS_EXTERNAL_LIBRARIES.TRANSCODER, "textures", options),
|
|
9417
|
+
await loadLibrary(BASIS_EXTERNAL_LIBRARIES.TRANSCODER_WASM, "textures", options)
|
|
9408
9418
|
]);
|
|
9409
9419
|
BASIS = BASIS || globalThis.BASIS;
|
|
9410
9420
|
return await initializeBasisTranscoderModule(BASIS, wasmBinary);
|
|
@@ -9434,8 +9444,8 @@
|
|
|
9434
9444
|
let BASIS_ENCODER = null;
|
|
9435
9445
|
let wasmBinary = null;
|
|
9436
9446
|
[BASIS_ENCODER, wasmBinary] = await Promise.all([
|
|
9437
|
-
await loadLibrary(
|
|
9438
|
-
await loadLibrary(
|
|
9447
|
+
await loadLibrary(BASIS_EXTERNAL_LIBRARIES.ENCODER, "textures", options),
|
|
9448
|
+
await loadLibrary(BASIS_EXTERNAL_LIBRARIES.ENCODER_WASM, "textures", options)
|
|
9439
9449
|
]);
|
|
9440
9450
|
BASIS_ENCODER = BASIS_ENCODER || globalThis.BASIS;
|
|
9441
9451
|
return await initializeBasisEncoderModule(BASIS_ENCODER, wasmBinary);
|
|
@@ -9453,13 +9463,16 @@
|
|
|
9453
9463
|
});
|
|
9454
9464
|
});
|
|
9455
9465
|
}
|
|
9456
|
-
var
|
|
9466
|
+
var BASIS_EXTERNAL_LIBRARIES, loadBasisTranscoderPromise, loadBasisEncoderPromise;
|
|
9457
9467
|
var init_basis_module_loader = __esm({
|
|
9458
9468
|
"../textures/src/lib/parsers/basis-module-loader.ts"() {
|
|
9459
9469
|
init_src();
|
|
9460
|
-
|
|
9461
|
-
|
|
9462
|
-
|
|
9470
|
+
BASIS_EXTERNAL_LIBRARIES = {
|
|
9471
|
+
TRANSCODER: "basis_transcoder.js",
|
|
9472
|
+
TRANSCODER_WASM: "basis_transcoder.wasm",
|
|
9473
|
+
ENCODER: "basis_encoder.js",
|
|
9474
|
+
ENCODER_WASM: "basis_encoder.wasm"
|
|
9475
|
+
};
|
|
9463
9476
|
}
|
|
9464
9477
|
});
|
|
9465
9478
|
|
|
@@ -10708,7 +10721,7 @@
|
|
|
10708
10721
|
});
|
|
10709
10722
|
async function decode2(gltfData, options) {
|
|
10710
10723
|
const scenegraph = new GLTFScenegraph(gltfData);
|
|
10711
|
-
if (!options?.gltf?.decompressMeshes) {
|
|
10724
|
+
if (!options?.gltf?.decompressMeshes || !options.gltf?.loadBuffers) {
|
|
10712
10725
|
return;
|
|
10713
10726
|
}
|
|
10714
10727
|
const promises = [];
|
|
@@ -11012,7 +11025,7 @@
|
|
|
11012
11025
|
async function decode4(gltfData, options) {
|
|
11013
11026
|
const gltfScenegraph = new GLTFScenegraph(gltfData);
|
|
11014
11027
|
const hasExtension = gltfScenegraph.hasExtension(EXT_MESHOPT_TRANSFORM);
|
|
11015
|
-
if (!hasExtension) {
|
|
11028
|
+
if (!hasExtension || !options.gltf?.loadBuffers) {
|
|
11016
11029
|
return;
|
|
11017
11030
|
}
|
|
11018
11031
|
const materials = gltfData.json.materials || [];
|
|
@@ -11912,7 +11925,11 @@
|
|
|
11912
11925
|
arrayBuffer = sliceArrayBuffer(array.buffer, array.byteOffset, array.byteLength);
|
|
11913
11926
|
}
|
|
11914
11927
|
assert7(arrayBuffer, "glTF image has no data");
|
|
11915
|
-
let parsedImage = await parse5(arrayBuffer, [ImageLoader, BasisLoader], {
|
|
11928
|
+
let parsedImage = await parse5(arrayBuffer, [ImageLoader, BasisLoader], {
|
|
11929
|
+
...options,
|
|
11930
|
+
mimeType: image.mimeType,
|
|
11931
|
+
basis: options.basis || { format: selectSupportedBasisFormat() }
|
|
11932
|
+
}, context);
|
|
11916
11933
|
if (parsedImage && parsedImage[0]) {
|
|
11917
11934
|
parsedImage = {
|
|
11918
11935
|
compressed: true,
|
|
@@ -12816,11 +12833,11 @@
|
|
|
12816
12833
|
});
|
|
12817
12834
|
|
|
12818
12835
|
// node_modules/@probe.gl/env/dist/utils/globals.js
|
|
12819
|
-
var
|
|
12836
|
+
var VERSION9, isBrowser6;
|
|
12820
12837
|
var init_globals6 = __esm({
|
|
12821
12838
|
"node_modules/@probe.gl/env/dist/utils/globals.js"() {
|
|
12822
12839
|
init_is_browser2();
|
|
12823
|
-
|
|
12840
|
+
VERSION9 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
|
|
12824
12841
|
isBrowser6 = isBrowser5();
|
|
12825
12842
|
}
|
|
12826
12843
|
});
|
|
@@ -13155,7 +13172,7 @@
|
|
|
13155
13172
|
id: ""
|
|
13156
13173
|
};
|
|
13157
13174
|
this.id = void 0;
|
|
13158
|
-
this.VERSION =
|
|
13175
|
+
this.VERSION = VERSION9;
|
|
13159
13176
|
this._startTs = getHiResTimestamp2();
|
|
13160
13177
|
this._deltaTs = getHiResTimestamp2();
|
|
13161
13178
|
this._storage = void 0;
|
|
@@ -13358,7 +13375,7 @@
|
|
|
13358
13375
|
return noop2;
|
|
13359
13376
|
}
|
|
13360
13377
|
};
|
|
13361
|
-
Log2.VERSION =
|
|
13378
|
+
Log2.VERSION = VERSION9;
|
|
13362
13379
|
}
|
|
13363
13380
|
});
|
|
13364
13381
|
|
|
@@ -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.20" !== 'undefined' ? "4.0.0-alpha.20" : 'latest';
|
|
8
8
|
exports.VERSION = VERSION;
|
|
9
9
|
//# sourceMappingURL=version.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = typeof "4.0.0-alpha.
|
|
1
|
+
export const VERSION = typeof "4.0.0-alpha.20" !== 'undefined' ? "4.0.0-alpha.20" : 'latest';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/3d-tiles",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.20",
|
|
4
4
|
"description": "3D Tiles, an open standard for streaming massive heterogeneous 3D geospatial datasets.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -34,11 +34,11 @@
|
|
|
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.
|
|
37
|
+
"@loaders.gl/draco": "4.0.0-alpha.20",
|
|
38
|
+
"@loaders.gl/gltf": "4.0.0-alpha.20",
|
|
39
|
+
"@loaders.gl/loader-utils": "4.0.0-alpha.20",
|
|
40
|
+
"@loaders.gl/math": "4.0.0-alpha.20",
|
|
41
|
+
"@loaders.gl/tiles": "4.0.0-alpha.20",
|
|
42
42
|
"@math.gl/core": "^3.5.1",
|
|
43
43
|
"@math.gl/geospatial": "^3.5.1",
|
|
44
44
|
"@probe.gl/log": "^4.0.4",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@loaders.gl/core": "^4.0.0-alpha.8"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "ac122e83102657c38207d59c631a5ce4e7aa46bd"
|
|
51
51
|
}
|