@loaders.gl/i3s 4.2.0-alpha.4 → 4.2.0-alpha.6
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/arcgis-webscene-loader.d.ts +1 -1
- package/dist/arcgis-webscene-loader.d.ts.map +1 -1
- package/dist/arcgis-webscene-loader.js +20 -11
- package/dist/dist.dev.js +1244 -722
- package/dist/dist.min.js +9 -0
- package/dist/i3s-attribute-loader.d.ts +2 -2
- package/dist/i3s-attribute-loader.d.ts.map +1 -1
- package/dist/i3s-attribute-loader.js +146 -95
- package/dist/i3s-building-scene-layer-loader.d.ts +2 -2
- package/dist/i3s-building-scene-layer-loader.d.ts.map +1 -1
- package/dist/i3s-building-scene-layer-loader.js +18 -14
- package/dist/i3s-content-loader.d.ts +2 -2
- package/dist/i3s-content-loader.d.ts.map +1 -1
- package/dist/i3s-content-loader.js +24 -25
- package/dist/i3s-content-worker-node.js +46 -46
- package/dist/i3s-content-worker-node.js.map +4 -4
- package/dist/i3s-content-worker.js +15 -27
- package/dist/i3s-loader.d.ts +2 -2
- package/dist/i3s-loader.d.ts.map +1 -1
- package/dist/i3s-loader.js +78 -66
- package/dist/i3s-node-page-loader.d.ts +2 -2
- package/dist/i3s-node-page-loader.d.ts.map +1 -1
- package/dist/i3s-node-page-loader.js +17 -13
- package/dist/i3s-slpk-loader.js +19 -15
- package/dist/index.cjs +92 -163
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.ts +14 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/lib/helpers/i3s-nodepages-tiles.d.ts +1 -1
- package/dist/lib/helpers/i3s-nodepages-tiles.d.ts.map +1 -1
- package/dist/lib/helpers/i3s-nodepages-tiles.js +230 -184
- package/dist/lib/parsers/constants.js +72 -45
- package/dist/lib/parsers/parse-arcgis-webscene.d.ts +1 -1
- package/dist/lib/parsers/parse-arcgis-webscene.d.ts.map +1 -1
- package/dist/lib/parsers/parse-arcgis-webscene.js +80 -59
- package/dist/lib/parsers/parse-i3s-attribute.js +83 -46
- package/dist/lib/parsers/parse-i3s-building-scene-layer.d.ts +1 -1
- package/dist/lib/parsers/parse-i3s-building-scene-layer.d.ts.map +1 -1
- package/dist/lib/parsers/parse-i3s-building-scene-layer.js +36 -33
- package/dist/lib/parsers/parse-i3s-tile-content.d.ts +1 -1
- package/dist/lib/parsers/parse-i3s-tile-content.d.ts.map +1 -1
- package/dist/lib/parsers/parse-i3s-tile-content.js +433 -388
- package/dist/lib/parsers/parse-i3s.d.ts +1 -1
- package/dist/lib/parsers/parse-i3s.d.ts.map +1 -1
- package/dist/lib/parsers/parse-i3s.js +84 -81
- package/dist/lib/parsers/parse-slpk/parse-slpk.d.ts +1 -1
- package/dist/lib/parsers/parse-slpk/parse-slpk.d.ts.map +1 -1
- package/dist/lib/parsers/parse-slpk/parse-slpk.js +23 -16
- package/dist/lib/parsers/parse-slpk/slpk-archieve.js +134 -97
- package/dist/lib/utils/convert-i3s-obb-to-mbs.js +12 -5
- package/dist/lib/utils/customize-colors.d.ts +1 -1
- package/dist/lib/utils/customize-colors.d.ts.map +1 -1
- package/dist/lib/utils/customize-colors.js +95 -81
- package/dist/lib/utils/url-utils.d.ts +1 -1
- package/dist/lib/utils/url-utils.d.ts.map +1 -1
- package/dist/lib/utils/url-utils.js +48 -28
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +5 -6
- package/dist/workers/i3s-content-worker-node.js +1 -1
- package/dist/workers/i3s-content-worker.js +0 -1
- package/package.json +15 -12
- package/src/i3s-loader.ts +2 -1
- package/src/lib/helpers/i3s-nodepages-tiles.ts +1 -3
- package/src/lib/parsers/parse-i3s-tile-content.ts +4 -26
- package/dist/arcgis-webscene-loader.js.map +0 -1
- package/dist/i3s-attribute-loader.js.map +0 -1
- package/dist/i3s-building-scene-layer-loader.js.map +0 -1
- package/dist/i3s-content-loader.js.map +0 -1
- package/dist/i3s-loader.js.map +0 -1
- package/dist/i3s-node-page-loader.js.map +0 -1
- package/dist/i3s-slpk-loader.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/helpers/i3s-nodepages-tiles.js.map +0 -1
- package/dist/lib/parsers/constants.js.map +0 -1
- package/dist/lib/parsers/parse-arcgis-webscene.js.map +0 -1
- package/dist/lib/parsers/parse-i3s-attribute.js.map +0 -1
- package/dist/lib/parsers/parse-i3s-building-scene-layer.js.map +0 -1
- package/dist/lib/parsers/parse-i3s-tile-content.js.map +0 -1
- package/dist/lib/parsers/parse-i3s.js.map +0 -1
- package/dist/lib/parsers/parse-slpk/parse-slpk.js.map +0 -1
- package/dist/lib/parsers/parse-slpk/slpk-archieve.js.map +0 -1
- package/dist/lib/utils/convert-i3s-obb-to-mbs.js.map +0 -1
- package/dist/lib/utils/customize-colors.js.map +0 -1
- package/dist/lib/utils/url-utils.js.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/workers/i3s-content-worker-node.js.map +0 -1
- package/dist/workers/i3s-content-worker.js.map +0 -1
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
);
|
|
107
107
|
globalThis._loadersgl_.version = NPM_TAG;
|
|
108
108
|
} else {
|
|
109
|
-
globalThis._loadersgl_.version = "4.2.0-alpha.
|
|
109
|
+
globalThis._loadersgl_.version = "4.2.0-alpha.5";
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
return globalThis._loadersgl_.version;
|
|
@@ -627,7 +627,9 @@
|
|
|
627
627
|
}
|
|
628
628
|
getParentPort().then((parentPort2) => {
|
|
629
629
|
if (parentPort2) {
|
|
630
|
-
parentPort2.on("message",
|
|
630
|
+
parentPort2.on("message", (message) => {
|
|
631
|
+
handleMessage(message);
|
|
632
|
+
});
|
|
631
633
|
parentPort2.on("exit", () => console.debug("Node worker closing"));
|
|
632
634
|
} else {
|
|
633
635
|
globalThis.onmessage = handleMessage;
|
|
@@ -1442,7 +1444,7 @@
|
|
|
1442
1444
|
var navigator_ = globalThis.navigator || {};
|
|
1443
1445
|
|
|
1444
1446
|
// ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/utils/globals.js
|
|
1445
|
-
var VERSION2 = true ? "4.2.0-alpha.
|
|
1447
|
+
var VERSION2 = true ? "4.2.0-alpha.5" : "untranspiled source";
|
|
1446
1448
|
var isBrowser4 = isBrowser3();
|
|
1447
1449
|
|
|
1448
1450
|
// ../../node_modules/@probe.gl/log/dist/utils/local-storage.js
|
|
@@ -2031,7 +2033,9 @@
|
|
|
2031
2033
|
function getGlobalLoaderState() {
|
|
2032
2034
|
globalThis.loaders = globalThis.loaders || {};
|
|
2033
2035
|
const { loaders } = globalThis;
|
|
2034
|
-
|
|
2036
|
+
if (!loaders._state) {
|
|
2037
|
+
loaders._state = {};
|
|
2038
|
+
}
|
|
2035
2039
|
return loaders._state;
|
|
2036
2040
|
}
|
|
2037
2041
|
function getGlobalLoaderOptions() {
|
|
@@ -5310,7 +5314,7 @@
|
|
|
5310
5314
|
_defineProperty(Ellipsoid, "WGS84", new Ellipsoid(WGS84_RADIUS_X, WGS84_RADIUS_Y, WGS84_RADIUS_Z));
|
|
5311
5315
|
|
|
5312
5316
|
// ../images/src/lib/utils/version.ts
|
|
5313
|
-
var VERSION3 = true ? "4.2.0-alpha.
|
|
5317
|
+
var VERSION3 = true ? "4.2.0-alpha.5" : "latest";
|
|
5314
5318
|
|
|
5315
5319
|
// ../images/src/lib/category-api/image-type.ts
|
|
5316
5320
|
var parseImageNode = globalThis.loaders?.parseImageNode;
|
|
@@ -5716,7 +5720,7 @@
|
|
|
5716
5720
|
};
|
|
5717
5721
|
|
|
5718
5722
|
// ../draco/src/lib/utils/version.ts
|
|
5719
|
-
var VERSION4 = true ? "4.2.0-alpha.
|
|
5723
|
+
var VERSION4 = true ? "4.2.0-alpha.5" : "latest";
|
|
5720
5724
|
|
|
5721
5725
|
// ../draco/src/draco-loader.ts
|
|
5722
5726
|
var DracoLoader = {
|
|
@@ -6319,7 +6323,7 @@
|
|
|
6319
6323
|
}
|
|
6320
6324
|
|
|
6321
6325
|
// ../textures/src/lib/utils/version.ts
|
|
6322
|
-
var VERSION5 = true ? "4.2.0-alpha.
|
|
6326
|
+
var VERSION5 = true ? "4.2.0-alpha.5" : "latest";
|
|
6323
6327
|
|
|
6324
6328
|
// ../textures/src/lib/parsers/basis-module-loader.ts
|
|
6325
6329
|
var BASIS_EXTERNAL_LIBRARIES = {
|
|
@@ -7481,11 +7485,7 @@
|
|
|
7481
7485
|
texture: null
|
|
7482
7486
|
};
|
|
7483
7487
|
if (tileOptions.textureUrl) {
|
|
7484
|
-
const url = getUrlWithToken(
|
|
7485
|
-
getInternalPathFromUrl(tileOptions.textureUrl),
|
|
7486
|
-
// @ts-expect-error options is not properly typed
|
|
7487
|
-
options?.i3s?.token
|
|
7488
|
-
);
|
|
7488
|
+
const url = getUrlWithToken(tileOptions.textureUrl, options?.i3s?.token);
|
|
7489
7489
|
const loader = getLoaderForTextureFormat(tileOptions.textureFormat);
|
|
7490
7490
|
const fetchFunc = context?.fetch || fetch;
|
|
7491
7491
|
const response = await fetchFunc(url);
|
|
@@ -7523,18 +7523,6 @@
|
|
|
7523
7523
|
}
|
|
7524
7524
|
return await parseI3SNodeGeometry(arrayBuffer, content, tileOptions, tilesetOptions, options);
|
|
7525
7525
|
}
|
|
7526
|
-
function getInternalPathFromUrl(url) {
|
|
7527
|
-
const slpkUrlParts = url.split(".slpk");
|
|
7528
|
-
let filename2;
|
|
7529
|
-
if (slpkUrlParts.length === 1) {
|
|
7530
|
-
filename2 = url;
|
|
7531
|
-
} else if (slpkUrlParts.length === 2) {
|
|
7532
|
-
filename2 = slpkUrlParts[1].slice(1);
|
|
7533
|
-
} else {
|
|
7534
|
-
filename2 = url;
|
|
7535
|
-
}
|
|
7536
|
-
return filename2;
|
|
7537
|
-
}
|
|
7538
7526
|
async function parseI3SNodeGeometry(arrayBuffer, content, tileOptions, tilesetOptions, options) {
|
|
7539
7527
|
const contentByteLength = arrayBuffer.byteLength;
|
|
7540
7528
|
let attributes;
|
|
@@ -7662,11 +7650,11 @@
|
|
|
7662
7650
|
for (const { property, type } of options.store.defaultGeometrySchema.header) {
|
|
7663
7651
|
const TypedArrayTypeHeader = getConstructorForDataFormat(type);
|
|
7664
7652
|
switch (property) {
|
|
7665
|
-
case "vertexCount" /* vertexCount
|
|
7653
|
+
case "vertexCount" /* vertexCount */.toString():
|
|
7666
7654
|
vertexCount = new TypedArrayTypeHeader(arrayBuffer, 0, 4)[0];
|
|
7667
7655
|
byteOffset += sizeOf(type);
|
|
7668
7656
|
break;
|
|
7669
|
-
case "featureCount" /* featureCount
|
|
7657
|
+
case "featureCount" /* featureCount */.toString():
|
|
7670
7658
|
featureCount = new TypedArrayTypeHeader(arrayBuffer, 4, 4)[0];
|
|
7671
7659
|
byteOffset += sizeOf(type);
|
|
7672
7660
|
break;
|
|
@@ -7864,7 +7852,7 @@
|
|
|
7864
7852
|
}
|
|
7865
7853
|
|
|
7866
7854
|
// src/i3s-content-loader.ts
|
|
7867
|
-
var VERSION6 = true ? "4.2.0-alpha.
|
|
7855
|
+
var VERSION6 = true ? "4.2.0-alpha.5" : "latest";
|
|
7868
7856
|
var I3SContentLoader = {
|
|
7869
7857
|
name: "I3S Content (Indexed Scene Layers)",
|
|
7870
7858
|
id: "i3s-content",
|
package/dist/i3s-loader.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LoaderWithParser, LoaderOptions } from '@loaders.gl/loader-utils';
|
|
2
|
-
import type { I3STilesetHeader } from
|
|
3
|
-
import { I3SParseOptions } from
|
|
2
|
+
import type { I3STilesetHeader } from "./types.js";
|
|
3
|
+
import { I3SParseOptions } from "./types.js";
|
|
4
4
|
export type I3SLoaderOptions = LoaderOptions & {
|
|
5
5
|
i3s?: I3SParseOptions;
|
|
6
6
|
};
|
package/dist/i3s-loader.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i3s-loader.d.ts","sourceRoot":"","sources":["../src/i3s-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,gBAAgB,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAE9E,OAAO,KAAK,EAAC,gBAAgB,EAAC,
|
|
1
|
+
{"version":3,"file":"i3s-loader.d.ts","sourceRoot":"","sources":["../src/i3s-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,gBAAgB,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAE9E,OAAO,KAAK,EAAC,gBAAgB,EAAC,mBAAgB;AAI9C,OAAO,EAAC,eAAe,EAAC,mBAAgB;AAaxC,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC7C,GAAG,CAAC,EAAE,eAAe,CAAC;CACvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,gBAAgB,CAAC,gBAAgB,EAAE,KAAK,EAAE,aAAa,CAuB9E,CAAC"}
|
package/dist/i3s-loader.js
CHANGED
|
@@ -3,85 +3,97 @@ import { I3SContentLoader } from "./i3s-content-loader.js";
|
|
|
3
3
|
import { normalizeTileData, normalizeTilesetData } from "./lib/parsers/parse-i3s.js";
|
|
4
4
|
import { COORDINATE_SYSTEM } from "./lib/parsers/constants.js";
|
|
5
5
|
import { getUrlWithoutParams } from "./lib/utils/url-utils.js";
|
|
6
|
-
|
|
6
|
+
// __VERSION__ is injected by babel-plugin-version-inline
|
|
7
|
+
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
8
|
+
const VERSION = typeof "4.2.0-alpha.5" !== 'undefined' ? "4.2.0-alpha.5" : 'latest';
|
|
7
9
|
const TILESET_REGEX = /layers\/[0-9]+$/;
|
|
10
|
+
const LOCAL_SLPK_REGEX = /\.slpk$/;
|
|
8
11
|
const TILE_HEADER_REGEX = /nodes\/([0-9-]+|root)$/;
|
|
9
12
|
const SLPK_HEX = '504b0304';
|
|
10
13
|
const POINT_CLOUD = 'PointCloud';
|
|
14
|
+
/**
|
|
15
|
+
* Loader for I3S - Indexed 3D Scene Layer
|
|
16
|
+
*/
|
|
11
17
|
export const I3SLoader = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
18
|
+
name: 'I3S (Indexed Scene Layers)',
|
|
19
|
+
id: 'i3s',
|
|
20
|
+
module: 'i3s',
|
|
21
|
+
version: VERSION,
|
|
22
|
+
mimeTypes: ['application/octet-stream'],
|
|
23
|
+
parse: parseI3S,
|
|
24
|
+
extensions: ['bin'],
|
|
25
|
+
options: {
|
|
26
|
+
i3s: {
|
|
27
|
+
token: null,
|
|
28
|
+
isTileset: 'auto',
|
|
29
|
+
isTileHeader: 'auto',
|
|
30
|
+
tile: null,
|
|
31
|
+
tileset: null,
|
|
32
|
+
_tileOptions: null,
|
|
33
|
+
_tilesetOptions: null,
|
|
34
|
+
useDracoGeometry: true,
|
|
35
|
+
useCompressedTextures: true,
|
|
36
|
+
decodeTextures: true,
|
|
37
|
+
coordinateSystem: COORDINATE_SYSTEM.METER_OFFSETS
|
|
38
|
+
}
|
|
32
39
|
}
|
|
33
|
-
}
|
|
34
40
|
};
|
|
35
|
-
async function parseI3S(data) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
isTileHeader
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
41
|
+
async function parseI3S(data, options = {}, context) {
|
|
42
|
+
const url = context.url;
|
|
43
|
+
options.i3s = options.i3s || {};
|
|
44
|
+
const magicNumber = getMagicNumber(data);
|
|
45
|
+
// check if file is slpk
|
|
46
|
+
if (magicNumber === SLPK_HEX) {
|
|
47
|
+
throw new Error('Files with .slpk extention currently are not supported by I3SLoader');
|
|
48
|
+
}
|
|
49
|
+
const urlWithoutParams = getUrlWithoutParams(url);
|
|
50
|
+
// auto detect file type based on url
|
|
51
|
+
let isTileset;
|
|
52
|
+
if (options.i3s.isTileset === 'auto') {
|
|
53
|
+
isTileset = TILESET_REGEX.test(urlWithoutParams) || LOCAL_SLPK_REGEX.test(urlWithoutParams);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
isTileset = options.i3s.isTileset;
|
|
57
|
+
}
|
|
58
|
+
let isTileHeader;
|
|
59
|
+
if (options.isTileHeader === 'auto') {
|
|
60
|
+
isTileHeader = TILE_HEADER_REGEX.test(urlWithoutParams);
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
isTileHeader = options.i3s.isTileHeader;
|
|
64
|
+
}
|
|
65
|
+
if (isTileset) {
|
|
66
|
+
data = await parseTileset(data, options, context);
|
|
67
|
+
}
|
|
68
|
+
else if (isTileHeader) {
|
|
69
|
+
data = await parseTile(data, context);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
data = await parseTileContent(data, options);
|
|
73
|
+
}
|
|
74
|
+
return data;
|
|
65
75
|
}
|
|
66
76
|
async function parseTileContent(arrayBuffer, options) {
|
|
67
|
-
|
|
77
|
+
return await parse(arrayBuffer, I3SContentLoader, options);
|
|
68
78
|
}
|
|
69
79
|
async function parseTileset(data, options, context) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
80
|
+
const tilesetJson = JSON.parse(new TextDecoder().decode(data));
|
|
81
|
+
if (tilesetJson?.layerType === POINT_CLOUD) {
|
|
82
|
+
throw new Error('Point Cloud layers currently are not supported by I3SLoader');
|
|
83
|
+
}
|
|
84
|
+
const tilesetPostprocessed = await normalizeTilesetData(tilesetJson, options, context);
|
|
85
|
+
return tilesetPostprocessed;
|
|
76
86
|
}
|
|
77
87
|
async function parseTile(data, context) {
|
|
78
|
-
|
|
79
|
-
|
|
88
|
+
data = JSON.parse(new TextDecoder().decode(data));
|
|
89
|
+
return normalizeTileData(data, context);
|
|
80
90
|
}
|
|
81
91
|
function getMagicNumber(data) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
92
|
+
if (data instanceof ArrayBuffer) {
|
|
93
|
+
// slice binary data (4 bytes from the beginning) and transform it to hexadecimal numeral system
|
|
94
|
+
return [...new Uint8Array(data, 0, 4)]
|
|
95
|
+
.map((value) => value.toString(16).padStart(2, '0'))
|
|
96
|
+
.join('');
|
|
97
|
+
}
|
|
98
|
+
return null;
|
|
86
99
|
}
|
|
87
|
-
//# sourceMappingURL=i3s-loader.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LoaderWithParser } from '@loaders.gl/loader-utils';
|
|
2
|
-
import type { I3SLoaderOptions } from
|
|
3
|
-
import type { NodePage } from
|
|
2
|
+
import type { I3SLoaderOptions } from "./i3s-loader.js";
|
|
3
|
+
import type { NodePage } from "./types.js";
|
|
4
4
|
/**
|
|
5
5
|
* Loader for I3S node pages
|
|
6
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i3s-node-page-loader.d.ts","sourceRoot":"","sources":["../src/i3s-node-page-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAC9E,OAAO,KAAK,EAAC,gBAAgB,EAAC,
|
|
1
|
+
{"version":3,"file":"i3s-node-page-loader.d.ts","sourceRoot":"","sources":["../src/i3s-node-page-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAC9E,OAAO,KAAK,EAAC,gBAAgB,EAAC,wBAAqB;AACnD,OAAO,KAAK,EAAC,QAAQ,EAAC,mBAAgB;AAMtC;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,gBAAgB,CAAC,QAAQ,EAAE,KAAK,EAAE,gBAAgB,CAWjF,CAAC"}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
// __VERSION__ is injected by babel-plugin-version-inline
|
|
2
|
+
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
3
|
+
const VERSION = typeof "4.2.0-alpha.5" !== 'undefined' ? "4.2.0-alpha.5" : 'latest';
|
|
4
|
+
/**
|
|
5
|
+
* Loader for I3S node pages
|
|
6
|
+
*/
|
|
2
7
|
export const I3SNodePageLoader = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
name: 'I3S Node Page',
|
|
9
|
+
id: 'i3s-node-page',
|
|
10
|
+
module: 'i3s',
|
|
11
|
+
version: VERSION,
|
|
12
|
+
mimeTypes: ['application/json'],
|
|
13
|
+
parse: parseNodePage,
|
|
14
|
+
extensions: ['json'],
|
|
15
|
+
options: {
|
|
16
|
+
i3s: {}
|
|
17
|
+
}
|
|
13
18
|
};
|
|
14
19
|
async function parseNodePage(data, options) {
|
|
15
|
-
|
|
20
|
+
return JSON.parse(new TextDecoder().decode(data));
|
|
16
21
|
}
|
|
17
|
-
//# sourceMappingURL=i3s-node-page-loader.js.map
|
package/dist/i3s-slpk-loader.js
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
import { DataViewFile } from '@loaders.gl/loader-utils';
|
|
2
2
|
import { parseSLPKArchive } from "./lib/parsers/parse-slpk/parse-slpk.js";
|
|
3
|
-
|
|
3
|
+
// __VERSION__ is injected by babel-plugin-version-inline
|
|
4
|
+
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
5
|
+
const VERSION = typeof "4.2.0-alpha.5" !== 'undefined' ? "4.2.0-alpha.5" : 'latest';
|
|
6
|
+
/**
|
|
7
|
+
* Loader for SLPK - Scene Layer Package (Archive I3S format)
|
|
8
|
+
* @todo - this reloads the entire archive for every tile, should be optimized
|
|
9
|
+
* @todo - this should be updated to use `parseFile` and ReadableFile
|
|
10
|
+
*/
|
|
4
11
|
export const SLPKLoader = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return archive.getFile((_options$slpk$path = (_options$slpk = options.slpk) === null || _options$slpk === void 0 ? void 0 : _options$slpk.path) !== null && _options$slpk$path !== void 0 ? _options$slpk$path : '', (_options$slpk2 = options.slpk) === null || _options$slpk2 === void 0 ? void 0 : _options$slpk2.pathMode);
|
|
17
|
-
}
|
|
12
|
+
name: 'I3S SLPK (Scene Layer Package)',
|
|
13
|
+
id: 'slpk',
|
|
14
|
+
module: 'i3s',
|
|
15
|
+
version: VERSION,
|
|
16
|
+
mimeTypes: ['application/octet-stream'],
|
|
17
|
+
extensions: ['slpk'],
|
|
18
|
+
options: {},
|
|
19
|
+
parse: async (data, options = {}) => {
|
|
20
|
+
const archive = await parseSLPKArchive(new DataViewFile(new DataView(data)));
|
|
21
|
+
return archive.getFile(options.slpk?.path ?? '', options.slpk?.pathMode);
|
|
22
|
+
}
|
|
18
23
|
};
|
|
19
|
-
//# sourceMappingURL=i3s-slpk-loader.js.map
|