@loaders.gl/3d-tiles 4.0.3 → 4.1.0-alpha.1
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/3d-tiles-archive/3d-tiles-archive-parser.js +2 -2
- package/dist/3d-tiles-archive/3d-tiles-archive-parser.js.map +1 -1
- package/dist/dist.dev.js +81 -14
- package/dist/index.cjs +2 -2
- package/dist/lib/filesystems/tiles-3d-archive-file-system.js +2 -2
- package/dist/lib/filesystems/tiles-3d-archive-file-system.js.map +1 -1
- package/package.json +13 -10
- package/src/3d-tiles-archive/3d-tiles-archive-parser.ts +2 -2
- package/src/lib/filesystems/tiles-3d-archive-file-system.ts +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CD_HEADER_SIGNATURE, makeHashTableFromZipHeaders, parseHashTable, parseZipCDFileHeader, parseZipLocalFileHeader, searchFromTheEnd } from '@loaders.gl/zip';
|
|
2
2
|
import { Tiles3DArchive } from "./3d-tiles-archive-archive.js";
|
|
3
3
|
export const parse3DTilesArchive = async (fileProvider, cb) => {
|
|
4
|
-
const hashCDOffset = await searchFromTheEnd(fileProvider,
|
|
4
|
+
const hashCDOffset = await searchFromTheEnd(fileProvider, CD_HEADER_SIGNATURE);
|
|
5
5
|
const cdFileHeader = await parseZipCDFileHeader(hashCDOffset, fileProvider);
|
|
6
6
|
let hashTable;
|
|
7
7
|
if ((cdFileHeader === null || cdFileHeader === void 0 ? void 0 : cdFileHeader.fileName) !== '@3dtilesIndex1@') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"3d-tiles-archive-parser.js","names":["
|
|
1
|
+
{"version":3,"file":"3d-tiles-archive-parser.js","names":["CD_HEADER_SIGNATURE","makeHashTableFromZipHeaders","parseHashTable","parseZipCDFileHeader","parseZipLocalFileHeader","searchFromTheEnd","Tiles3DArchive","parse3DTilesArchive","fileProvider","cb","hashCDOffset","cdFileHeader","hashTable","fileName","localFileHeader","localHeaderOffset","Error","fileDataOffset","hashFile","slice","compressedSize"],"sources":["../../src/3d-tiles-archive/3d-tiles-archive-parser.ts"],"sourcesContent":["import {FileProvider} from '@loaders.gl/loader-utils';\nimport {\n CD_HEADER_SIGNATURE,\n makeHashTableFromZipHeaders,\n parseHashTable,\n parseZipCDFileHeader,\n parseZipLocalFileHeader,\n searchFromTheEnd\n} from '@loaders.gl/zip';\nimport {Tiles3DArchive} from './3d-tiles-archive-archive';\n\n/**\n * Creates 3tz file handler from raw file\n * @param fileProvider raw file data\n * @param cb is called with information message during parsing\n * @returns 3tz file handler\n */\nexport const parse3DTilesArchive = async (\n fileProvider: FileProvider,\n cb?: (msg: string) => void\n): Promise<Tiles3DArchive> => {\n const hashCDOffset = await searchFromTheEnd(fileProvider, CD_HEADER_SIGNATURE);\n\n const cdFileHeader = await parseZipCDFileHeader(hashCDOffset, fileProvider);\n\n let hashTable: Record<string, bigint>;\n if (cdFileHeader?.fileName !== '@3dtilesIndex1@') {\n hashTable = await makeHashTableFromZipHeaders(fileProvider);\n cb?.(\n '3tz doesnt contain hash file, hash info has been composed according to zip archive headers'\n );\n } else {\n // cb?.('3tz contains hash file');\n const localFileHeader = await parseZipLocalFileHeader(\n cdFileHeader.localHeaderOffset,\n fileProvider\n );\n if (!localFileHeader) {\n throw new Error('corrupted 3tz zip archive');\n }\n\n const fileDataOffset = localFileHeader.fileDataOffset;\n const hashFile = await fileProvider.slice(\n fileDataOffset,\n fileDataOffset + localFileHeader.compressedSize\n );\n\n hashTable = parseHashTable(hashFile);\n }\n\n return new Tiles3DArchive(fileProvider, hashTable);\n};\n"],"mappings":"AACA,SACEA,mBAAmB,EACnBC,2BAA2B,EAC3BC,cAAc,EACdC,oBAAoB,EACpBC,uBAAuB,EACvBC,gBAAgB,QACX,iBAAiB;AAAC,SACjBC,cAAc;AAQtB,OAAO,MAAMC,mBAAmB,GAAG,MAAAA,CACjCC,YAA0B,EAC1BC,EAA0B,KACE;EAC5B,MAAMC,YAAY,GAAG,MAAML,gBAAgB,CAACG,YAAY,EAAER,mBAAmB,CAAC;EAE9E,MAAMW,YAAY,GAAG,MAAMR,oBAAoB,CAACO,YAAY,EAAEF,YAAY,CAAC;EAE3E,IAAII,SAAiC;EACrC,IAAI,CAAAD,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEE,QAAQ,MAAK,iBAAiB,EAAE;IAChDD,SAAS,GAAG,MAAMX,2BAA2B,CAACO,YAAY,CAAC;IAC3DC,EAAE,aAAFA,EAAE,uBAAFA,EAAE,CACA,4FACF,CAAC;EACH,CAAC,MAAM;IAEL,MAAMK,eAAe,GAAG,MAAMV,uBAAuB,CACnDO,YAAY,CAACI,iBAAiB,EAC9BP,YACF,CAAC;IACD,IAAI,CAACM,eAAe,EAAE;MACpB,MAAM,IAAIE,KAAK,CAAC,2BAA2B,CAAC;IAC9C;IAEA,MAAMC,cAAc,GAAGH,eAAe,CAACG,cAAc;IACrD,MAAMC,QAAQ,GAAG,MAAMV,YAAY,CAACW,KAAK,CACvCF,cAAc,EACdA,cAAc,GAAGH,eAAe,CAACM,cACnC,CAAC;IAEDR,SAAS,GAAGV,cAAc,CAACgB,QAAQ,CAAC;EACtC;EAEA,OAAO,IAAIZ,cAAc,CAACE,YAAY,EAAEI,SAAS,CAAC;AACpD,CAAC"}
|
package/dist/dist.dev.js
CHANGED
|
@@ -10110,14 +10110,6 @@ var __exports__ = (() => {
|
|
|
10110
10110
|
var VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
10111
10111
|
|
|
10112
10112
|
// ../draco/src/draco-loader.ts
|
|
10113
|
-
var DEFAULT_DRACO_OPTIONS = {
|
|
10114
|
-
draco: {
|
|
10115
|
-
decoderType: typeof WebAssembly === "object" ? "wasm" : "js",
|
|
10116
|
-
libraryPath: "libs/",
|
|
10117
|
-
extraAttributes: {},
|
|
10118
|
-
attributeNameEntry: void 0
|
|
10119
|
-
}
|
|
10120
|
-
};
|
|
10121
10113
|
var DracoLoader = {
|
|
10122
10114
|
name: "Draco",
|
|
10123
10115
|
id: "draco",
|
|
@@ -10128,7 +10120,14 @@ var __exports__ = (() => {
|
|
|
10128
10120
|
mimeTypes: ["application/octet-stream"],
|
|
10129
10121
|
binary: true,
|
|
10130
10122
|
tests: ["DRACO"],
|
|
10131
|
-
options:
|
|
10123
|
+
options: {
|
|
10124
|
+
draco: {
|
|
10125
|
+
decoderType: typeof WebAssembly === "object" ? "wasm" : "js",
|
|
10126
|
+
libraryPath: "libs/",
|
|
10127
|
+
extraAttributes: {},
|
|
10128
|
+
attributeNameEntry: void 0
|
|
10129
|
+
}
|
|
10130
|
+
}
|
|
10132
10131
|
};
|
|
10133
10132
|
|
|
10134
10133
|
// ../schema/src/lib/table/simple-table/data-type.ts
|
|
@@ -10827,11 +10826,6 @@ var __exports__ = (() => {
|
|
|
10827
10826
|
return octDecodeInRange(x, y, 255, result);
|
|
10828
10827
|
}
|
|
10829
10828
|
|
|
10830
|
-
// ../math/src/geometry/utils/coordinates.ts
|
|
10831
|
-
function emod(n2) {
|
|
10832
|
-
return (n2 % 1 + 1) % 1;
|
|
10833
|
-
}
|
|
10834
|
-
|
|
10835
10829
|
// src/lib/classes/tile-3d-feature-table.ts
|
|
10836
10830
|
var Tile3DFeatureTable = class {
|
|
10837
10831
|
featuresLength = 0;
|
|
@@ -12818,6 +12812,9 @@ var __exports__ = (() => {
|
|
|
12818
12812
|
};
|
|
12819
12813
|
|
|
12820
12814
|
// ../gltf/src/lib/extensions/utils/3d-tiles-utils.ts
|
|
12815
|
+
function emod(n2) {
|
|
12816
|
+
return (n2 % 1 + 1) % 1;
|
|
12817
|
+
}
|
|
12821
12818
|
var ATTRIBUTE_TYPE_TO_COMPONENTS2 = {
|
|
12822
12819
|
SCALAR: 1,
|
|
12823
12820
|
VEC2: 2,
|
|
@@ -18400,6 +18397,76 @@ var __exports__ = (() => {
|
|
|
18400
18397
|
}
|
|
18401
18398
|
return zip64dataList;
|
|
18402
18399
|
};
|
|
18400
|
+
var ZIP_HEADER_FIELDS = [{
|
|
18401
|
+
offset: 0,
|
|
18402
|
+
size: 4,
|
|
18403
|
+
default: new DataView(signature.buffer).getUint32(0, true)
|
|
18404
|
+
}, {
|
|
18405
|
+
offset: 4,
|
|
18406
|
+
size: 2,
|
|
18407
|
+
default: 45
|
|
18408
|
+
}, {
|
|
18409
|
+
offset: 6,
|
|
18410
|
+
size: 2,
|
|
18411
|
+
default: 45
|
|
18412
|
+
}, {
|
|
18413
|
+
offset: 8,
|
|
18414
|
+
size: 2,
|
|
18415
|
+
default: 0
|
|
18416
|
+
}, {
|
|
18417
|
+
offset: 10,
|
|
18418
|
+
size: 2,
|
|
18419
|
+
default: 0
|
|
18420
|
+
}, {
|
|
18421
|
+
offset: 12,
|
|
18422
|
+
size: 2,
|
|
18423
|
+
default: 0
|
|
18424
|
+
}, {
|
|
18425
|
+
offset: 14,
|
|
18426
|
+
size: 2,
|
|
18427
|
+
default: 0
|
|
18428
|
+
}, {
|
|
18429
|
+
offset: 16,
|
|
18430
|
+
size: 4,
|
|
18431
|
+
name: "crc32"
|
|
18432
|
+
}, {
|
|
18433
|
+
offset: 20,
|
|
18434
|
+
size: 4,
|
|
18435
|
+
name: "length"
|
|
18436
|
+
}, {
|
|
18437
|
+
offset: 24,
|
|
18438
|
+
size: 4,
|
|
18439
|
+
name: "length"
|
|
18440
|
+
}, {
|
|
18441
|
+
offset: 28,
|
|
18442
|
+
size: 2,
|
|
18443
|
+
name: "fnlength"
|
|
18444
|
+
}, {
|
|
18445
|
+
offset: 30,
|
|
18446
|
+
size: 2,
|
|
18447
|
+
default: 0,
|
|
18448
|
+
name: "extraLength"
|
|
18449
|
+
}, {
|
|
18450
|
+
offset: 32,
|
|
18451
|
+
size: 2,
|
|
18452
|
+
default: 0
|
|
18453
|
+
}, {
|
|
18454
|
+
offset: 34,
|
|
18455
|
+
size: 2,
|
|
18456
|
+
default: 0
|
|
18457
|
+
}, {
|
|
18458
|
+
offset: 36,
|
|
18459
|
+
size: 2,
|
|
18460
|
+
default: 0
|
|
18461
|
+
}, {
|
|
18462
|
+
offset: 38,
|
|
18463
|
+
size: 4,
|
|
18464
|
+
default: 0
|
|
18465
|
+
}, {
|
|
18466
|
+
offset: 42,
|
|
18467
|
+
size: 4,
|
|
18468
|
+
name: "offset"
|
|
18469
|
+
}];
|
|
18403
18470
|
|
|
18404
18471
|
// ../zip/src/parse-zip/local-file-header.ts
|
|
18405
18472
|
var COMPRESSION_METHOD_OFFSET = 8n;
|
package/dist/index.cjs
CHANGED
|
@@ -2532,7 +2532,7 @@ var Tiles3DArchive = class {
|
|
|
2532
2532
|
|
|
2533
2533
|
// src/3d-tiles-archive/3d-tiles-archive-parser.ts
|
|
2534
2534
|
var parse3DTilesArchive = async (fileProvider, cb) => {
|
|
2535
|
-
const hashCDOffset = await (0, import_zip2.searchFromTheEnd)(fileProvider, import_zip2.
|
|
2535
|
+
const hashCDOffset = await (0, import_zip2.searchFromTheEnd)(fileProvider, import_zip2.CD_HEADER_SIGNATURE);
|
|
2536
2536
|
const cdFileHeader = await (0, import_zip2.parseZipCDFileHeader)(hashCDOffset, fileProvider);
|
|
2537
2537
|
let hashTable;
|
|
2538
2538
|
if ((cdFileHeader == null ? void 0 : cdFileHeader.fileName) !== "@3dtilesIndex1@") {
|
|
@@ -2621,7 +2621,7 @@ var Tiles3DArchiveFileSystem = class extends import_zip3.ZipFileSystem {
|
|
|
2621
2621
|
if (!fileProvider) {
|
|
2622
2622
|
throw new Error("No data detected in the zip archive");
|
|
2623
2623
|
}
|
|
2624
|
-
const hashCDOffset = await (0, import_zip3.searchFromTheEnd)(fileProvider, import_zip3.
|
|
2624
|
+
const hashCDOffset = await (0, import_zip3.searchFromTheEnd)(fileProvider, import_zip3.CD_HEADER_SIGNATURE);
|
|
2625
2625
|
const cdFileHeader = await (0, import_zip3.parseZipCDFileHeader)(hashCDOffset, fileProvider);
|
|
2626
2626
|
if ((cdFileHeader == null ? void 0 : cdFileHeader.fileName) === "@3dtilesIndex1@") {
|
|
2627
2627
|
const localFileHeader = await (0, import_zip3.parseZipLocalFileHeader)(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ZipFileSystem,
|
|
1
|
+
import { ZipFileSystem, CD_HEADER_SIGNATURE, searchFromTheEnd, parseZipCDFileHeader, parseHashTable, parseZipLocalFileHeader } from '@loaders.gl/zip';
|
|
2
2
|
import { Tiles3DArchive } from "../../3d-tiles-archive/3d-tiles-archive-archive.js";
|
|
3
3
|
export class Tiles3DArchiveFileSystem extends ZipFileSystem {
|
|
4
4
|
constructor(file) {
|
|
@@ -30,7 +30,7 @@ export class Tiles3DArchiveFileSystem extends ZipFileSystem {
|
|
|
30
30
|
if (!fileProvider) {
|
|
31
31
|
throw new Error('No data detected in the zip archive');
|
|
32
32
|
}
|
|
33
|
-
const hashCDOffset = await searchFromTheEnd(fileProvider,
|
|
33
|
+
const hashCDOffset = await searchFromTheEnd(fileProvider, CD_HEADER_SIGNATURE);
|
|
34
34
|
const cdFileHeader = await parseZipCDFileHeader(hashCDOffset, fileProvider);
|
|
35
35
|
if ((cdFileHeader === null || cdFileHeader === void 0 ? void 0 : cdFileHeader.fileName) === '@3dtilesIndex1@') {
|
|
36
36
|
const localFileHeader = await parseZipLocalFileHeader(cdFileHeader.localHeaderOffset, fileProvider);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tiles-3d-archive-file-system.js","names":["ZipFileSystem","
|
|
1
|
+
{"version":3,"file":"tiles-3d-archive-file-system.js","names":["ZipFileSystem","CD_HEADER_SIGNATURE","searchFromTheEnd","parseZipCDFileHeader","parseHashTable","parseZipLocalFileHeader","Tiles3DArchive","Tiles3DArchiveFileSystem","constructor","file","hashTable","fetch","filename","fileProvider","Error","archive","fileData","getFile","response","Response","Object","defineProperty","value","fileName","undefined","hashCDOffset","cdFileHeader","localFileHeader","localHeaderOffset","fileDataOffset","hashFile","slice","compressedSize"],"sources":["../../../src/lib/filesystems/tiles-3d-archive-file-system.ts"],"sourcesContent":["import {FileProvider} from '@loaders.gl/loader-utils';\nimport {\n ZipFileSystem,\n CD_HEADER_SIGNATURE,\n searchFromTheEnd,\n parseZipCDFileHeader,\n parseHashTable,\n parseZipLocalFileHeader\n} from '@loaders.gl/zip';\nimport {Tiles3DArchive} from '../../3d-tiles-archive/3d-tiles-archive-archive';\n\n/**\n * FileSystem adapter for a 3tz (3D tiles archive format) file\n * Holds FileProvider object that provides random access to archived files.\n * The difference from ZipFileSystem is usage of `@3dtilesIndex1@` index file that increases\n * access speed to archived files\n * @see https://github.com/erikdahlstrom/3tz-specification/blob/master/Specification.md\n */\nexport class Tiles3DArchiveFileSystem extends ZipFileSystem {\n hashTable?: Record<string, bigint> | null;\n\n /**\n * Constructor\n * @param file - instance of FileProvider or file path string\n */\n constructor(file: FileProvider | string) {\n super(file);\n }\n\n /**\n * Implementation of fetch against this file system.\n * It tries to take `@3dtilesIndex1@` file from the archive and use it\n * for faster access to archived files\n * @param filename - name of a file\n * @returns - Response with file data\n */\n async fetch(filename: string): Promise<Response> {\n const fileProvider = this.fileProvider;\n if (!fileProvider) {\n throw new Error('No data detected in the zip archive');\n }\n await this.parseHashTable();\n if (this.hashTable) {\n const archive = new Tiles3DArchive(fileProvider, this.hashTable);\n\n const fileData = await archive.getFile(filename);\n const response = new Response(fileData);\n Object.defineProperty(response, 'url', {value: `${this.fileName || ''}/${filename}`});\n return response;\n }\n return super.fetch(filename);\n }\n\n /**\n * Try to get and parse '@3dtilesIndex1@' file, that allows to get direct access\n * to files inside the archive\n * @returns void\n */\n private async parseHashTable(): Promise<void> {\n if (this.hashTable !== undefined) {\n return;\n }\n\n const fileProvider = this.fileProvider;\n if (!fileProvider) {\n throw new Error('No data detected in the zip archive');\n }\n\n const hashCDOffset = await searchFromTheEnd(fileProvider, CD_HEADER_SIGNATURE);\n\n const cdFileHeader = await parseZipCDFileHeader(hashCDOffset, fileProvider);\n\n // '@3dtilesIndex1@' is index file that must be the last in the archive. It allows\n // to improve load and read performance when the archive contains a very large number\n // of files.\n if (cdFileHeader?.fileName === '@3dtilesIndex1@') {\n const localFileHeader = await parseZipLocalFileHeader(\n cdFileHeader.localHeaderOffset,\n fileProvider\n );\n if (!localFileHeader) {\n throw new Error('corrupted 3tz');\n }\n\n const fileDataOffset = localFileHeader.fileDataOffset;\n const hashFile = await fileProvider.slice(\n fileDataOffset,\n fileDataOffset + localFileHeader.compressedSize\n );\n\n this.hashTable = parseHashTable(hashFile);\n } else {\n this.hashTable = null;\n }\n }\n}\n"],"mappings":"AACA,SACEA,aAAa,EACbC,mBAAmB,EACnBC,gBAAgB,EAChBC,oBAAoB,EACpBC,cAAc,EACdC,uBAAuB,QAClB,iBAAiB;AAAC,SACjBC,cAAc;AAStB,OAAO,MAAMC,wBAAwB,SAASP,aAAa,CAAC;EAO1DQ,WAAWA,CAACC,IAA2B,EAAE;IACvC,KAAK,CAACA,IAAI,CAAC;IAAC,KAPdC,SAAS;EAQT;EASA,MAAMC,KAAKA,CAACC,QAAgB,EAAqB;IAC/C,MAAMC,YAAY,GAAG,IAAI,CAACA,YAAY;IACtC,IAAI,CAACA,YAAY,EAAE;MACjB,MAAM,IAAIC,KAAK,CAAC,qCAAqC,CAAC;IACxD;IACA,MAAM,IAAI,CAACV,cAAc,CAAC,CAAC;IAC3B,IAAI,IAAI,CAACM,SAAS,EAAE;MAClB,MAAMK,OAAO,GAAG,IAAIT,cAAc,CAACO,YAAY,EAAE,IAAI,CAACH,SAAS,CAAC;MAEhE,MAAMM,QAAQ,GAAG,MAAMD,OAAO,CAACE,OAAO,CAACL,QAAQ,CAAC;MAChD,MAAMM,QAAQ,GAAG,IAAIC,QAAQ,CAACH,QAAQ,CAAC;MACvCI,MAAM,CAACC,cAAc,CAACH,QAAQ,EAAE,KAAK,EAAE;QAACI,KAAK,EAAG,GAAE,IAAI,CAACC,QAAQ,IAAI,EAAG,IAAGX,QAAS;MAAC,CAAC,CAAC;MACrF,OAAOM,QAAQ;IACjB;IACA,OAAO,KAAK,CAACP,KAAK,CAACC,QAAQ,CAAC;EAC9B;EAOA,MAAcR,cAAcA,CAAA,EAAkB;IAC5C,IAAI,IAAI,CAACM,SAAS,KAAKc,SAAS,EAAE;MAChC;IACF;IAEA,MAAMX,YAAY,GAAG,IAAI,CAACA,YAAY;IACtC,IAAI,CAACA,YAAY,EAAE;MACjB,MAAM,IAAIC,KAAK,CAAC,qCAAqC,CAAC;IACxD;IAEA,MAAMW,YAAY,GAAG,MAAMvB,gBAAgB,CAACW,YAAY,EAAEZ,mBAAmB,CAAC;IAE9E,MAAMyB,YAAY,GAAG,MAAMvB,oBAAoB,CAACsB,YAAY,EAAEZ,YAAY,CAAC;IAK3E,IAAI,CAAAa,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEH,QAAQ,MAAK,iBAAiB,EAAE;MAChD,MAAMI,eAAe,GAAG,MAAMtB,uBAAuB,CACnDqB,YAAY,CAACE,iBAAiB,EAC9Bf,YACF,CAAC;MACD,IAAI,CAACc,eAAe,EAAE;QACpB,MAAM,IAAIb,KAAK,CAAC,eAAe,CAAC;MAClC;MAEA,MAAMe,cAAc,GAAGF,eAAe,CAACE,cAAc;MACrD,MAAMC,QAAQ,GAAG,MAAMjB,YAAY,CAACkB,KAAK,CACvCF,cAAc,EACdA,cAAc,GAAGF,eAAe,CAACK,cACnC,CAAC;MAED,IAAI,CAACtB,SAAS,GAAGN,cAAc,CAAC0B,QAAQ,CAAC;IAC3C,CAAC,MAAM;MACL,IAAI,CAACpB,SAAS,GAAG,IAAI;IACvB;EACF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/3d-tiles",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.1.0-alpha.1",
|
|
4
4
|
"description": "3D Tiles, an open standard for streaming massive heterogeneous 3D geospatial datasets.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -12,14 +12,17 @@
|
|
|
12
12
|
"url": "https://github.com/visgl/loaders.gl"
|
|
13
13
|
},
|
|
14
14
|
"keywords": [
|
|
15
|
-
"webgl",
|
|
16
15
|
"loader",
|
|
17
16
|
"3d tile",
|
|
17
|
+
"3d tiles",
|
|
18
18
|
"tile",
|
|
19
|
+
"massive 3D",
|
|
19
20
|
"mesh",
|
|
20
21
|
"gltf",
|
|
21
22
|
"point cloud",
|
|
22
|
-
"pointcloud"
|
|
23
|
+
"pointcloud",
|
|
24
|
+
"webgl",
|
|
25
|
+
"webgpu"
|
|
23
26
|
],
|
|
24
27
|
"types": "dist/index.d.ts",
|
|
25
28
|
"main": "dist/index.cjs",
|
|
@@ -42,12 +45,12 @@
|
|
|
42
45
|
"build-bundle": "ocular-bundle ./src/index.ts"
|
|
43
46
|
},
|
|
44
47
|
"dependencies": {
|
|
45
|
-
"@loaders.gl/draco": "4.0.
|
|
46
|
-
"@loaders.gl/gltf": "4.0.
|
|
47
|
-
"@loaders.gl/loader-utils": "4.0.
|
|
48
|
-
"@loaders.gl/math": "4.0.
|
|
49
|
-
"@loaders.gl/tiles": "4.0.
|
|
50
|
-
"@loaders.gl/zip": "4.0.
|
|
48
|
+
"@loaders.gl/draco": "4.1.0-alpha.1",
|
|
49
|
+
"@loaders.gl/gltf": "4.1.0-alpha.1",
|
|
50
|
+
"@loaders.gl/loader-utils": "4.1.0-alpha.1",
|
|
51
|
+
"@loaders.gl/math": "4.1.0-alpha.1",
|
|
52
|
+
"@loaders.gl/tiles": "4.1.0-alpha.1",
|
|
53
|
+
"@loaders.gl/zip": "4.1.0-alpha.1",
|
|
51
54
|
"@math.gl/core": "^4.0.0",
|
|
52
55
|
"@math.gl/geospatial": "^4.0.0",
|
|
53
56
|
"@probe.gl/log": "^4.0.4",
|
|
@@ -56,5 +59,5 @@
|
|
|
56
59
|
"peerDependencies": {
|
|
57
60
|
"@loaders.gl/core": "^4.0.0"
|
|
58
61
|
},
|
|
59
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "6a4d3da93d45115ad99861474a43c3f4a0b280a7"
|
|
60
63
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {FileProvider} from '@loaders.gl/loader-utils';
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
CD_HEADER_SIGNATURE,
|
|
4
4
|
makeHashTableFromZipHeaders,
|
|
5
5
|
parseHashTable,
|
|
6
6
|
parseZipCDFileHeader,
|
|
@@ -19,7 +19,7 @@ export const parse3DTilesArchive = async (
|
|
|
19
19
|
fileProvider: FileProvider,
|
|
20
20
|
cb?: (msg: string) => void
|
|
21
21
|
): Promise<Tiles3DArchive> => {
|
|
22
|
-
const hashCDOffset = await searchFromTheEnd(fileProvider,
|
|
22
|
+
const hashCDOffset = await searchFromTheEnd(fileProvider, CD_HEADER_SIGNATURE);
|
|
23
23
|
|
|
24
24
|
const cdFileHeader = await parseZipCDFileHeader(hashCDOffset, fileProvider);
|
|
25
25
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {FileProvider} from '@loaders.gl/loader-utils';
|
|
2
2
|
import {
|
|
3
3
|
ZipFileSystem,
|
|
4
|
-
|
|
4
|
+
CD_HEADER_SIGNATURE,
|
|
5
5
|
searchFromTheEnd,
|
|
6
6
|
parseZipCDFileHeader,
|
|
7
7
|
parseHashTable,
|
|
@@ -66,7 +66,7 @@ export class Tiles3DArchiveFileSystem extends ZipFileSystem {
|
|
|
66
66
|
throw new Error('No data detected in the zip archive');
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
const hashCDOffset = await searchFromTheEnd(fileProvider,
|
|
69
|
+
const hashCDOffset = await searchFromTheEnd(fileProvider, CD_HEADER_SIGNATURE);
|
|
70
70
|
|
|
71
71
|
const cdFileHeader = await parseZipCDFileHeader(hashCDOffset, fileProvider);
|
|
72
72
|
|