@loaders.gl/i3s 4.2.0-alpha.6 → 4.2.0-beta.2
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 +19 -2
- package/dist/arcgis-webscene-loader.d.ts.map +1 -1
- package/dist/arcgis-webscene-loader.js +3 -1
- package/dist/dist.dev.js +139 -100
- package/dist/dist.min.js +1 -1
- package/dist/i3s-attribute-loader.d.ts +14 -3
- package/dist/i3s-attribute-loader.d.ts.map +1 -1
- package/dist/i3s-attribute-loader.js +3 -1
- package/dist/i3s-building-scene-layer-loader.d.ts +15 -3
- package/dist/i3s-building-scene-layer-loader.d.ts.map +1 -1
- package/dist/i3s-building-scene-layer-loader.js +3 -1
- package/dist/i3s-content-loader.d.ts +18 -2
- package/dist/i3s-content-loader.d.ts.map +1 -1
- package/dist/i3s-content-loader.js +6 -1
- package/dist/i3s-content-worker-node.js +48 -48
- package/dist/i3s-content-worker-node.js.map +4 -4
- package/dist/i3s-content-worker.js +1720 -1686
- package/dist/i3s-loader.d.ts +30 -2
- package/dist/i3s-loader.d.ts.map +1 -1
- package/dist/i3s-loader.js +6 -1
- package/dist/i3s-node-page-loader.d.ts +17 -3
- package/dist/i3s-node-page-loader.d.ts.map +1 -1
- package/dist/i3s-node-page-loader.js +6 -1
- package/dist/i3s-slpk-loader.d.ts +13 -2
- package/dist/i3s-slpk-loader.d.ts.map +1 -1
- package/dist/i3s-slpk-loader.js +6 -1
- package/dist/index.cjs +21 -7
- package/dist/index.cjs.map +2 -2
- package/dist/lib/parsers/parse-i3s-tile-content.d.ts.map +1 -1
- package/dist/lib/parsers/parse-i3s-tile-content.js +0 -1
- package/package.json +12 -12
- package/src/arcgis-webscene-loader.ts +4 -6
- package/src/i3s-attribute-loader.ts +4 -2
- package/src/i3s-building-scene-layer-loader.ts +6 -6
- package/src/i3s-content-loader.ts +9 -2
- package/src/i3s-loader.ts +9 -2
- package/src/i3s-node-page-loader.ts +9 -2
- package/src/i3s-slpk-loader.ts +9 -2
- package/src/lib/parsers/parse-i3s-tile-content.ts +3 -4
|
@@ -13,11 +13,9 @@ export type ArcGISWebSceneLoaderOptions = LoaderOptions & {};
|
|
|
13
13
|
* Loader for ArcGIS WebScene
|
|
14
14
|
* Spec - https://developers.arcgis.com/web-scene-specification/objects/webscene/
|
|
15
15
|
*/
|
|
16
|
-
export const ArcGISWebSceneLoader
|
|
17
|
-
ArcGISWebSceneData,
|
|
18
|
-
never,
|
|
19
|
-
ArcGISWebSceneLoaderOptions
|
|
20
|
-
> = {
|
|
16
|
+
export const ArcGISWebSceneLoader = {
|
|
17
|
+
dataType: null as unknown as ArcGISWebSceneData,
|
|
18
|
+
batchType: null as never,
|
|
21
19
|
name: 'ArcGIS Web Scene Loader',
|
|
22
20
|
id: 'arcgis-web-scene',
|
|
23
21
|
module: 'i3s',
|
|
@@ -26,7 +24,7 @@ export const ArcGISWebSceneLoader: LoaderWithParser<
|
|
|
26
24
|
parse,
|
|
27
25
|
extensions: ['json'],
|
|
28
26
|
options: {}
|
|
29
|
-
}
|
|
27
|
+
} as const satisfies LoaderWithParser<ArcGISWebSceneData, never, ArcGISWebSceneLoaderOptions>;
|
|
30
28
|
|
|
31
29
|
/**
|
|
32
30
|
* Parse ArcGIS webscene
|
|
@@ -14,7 +14,9 @@ const REJECTED_STATUS = 'rejected';
|
|
|
14
14
|
/**
|
|
15
15
|
* Loader for I3S attributes
|
|
16
16
|
*/
|
|
17
|
-
export const I3SAttributeLoader
|
|
17
|
+
export const I3SAttributeLoader = {
|
|
18
|
+
dataType: null as unknown as I3STileAttributes,
|
|
19
|
+
batchType: null as never,
|
|
18
20
|
name: 'I3S Attribute',
|
|
19
21
|
id: 'i3s-attribute',
|
|
20
22
|
module: 'i3s',
|
|
@@ -24,7 +26,7 @@ export const I3SAttributeLoader: LoaderWithParser<I3STileAttributes, never, I3SL
|
|
|
24
26
|
extensions: ['bin'],
|
|
25
27
|
options: {},
|
|
26
28
|
binary: true
|
|
27
|
-
}
|
|
29
|
+
} as const satisfies LoaderWithParser<I3STileAttributes, never, I3SLoaderOptions>;
|
|
28
30
|
|
|
29
31
|
|
|
30
32
|
// TODO - these seem to use the loader rather than being part of the loader. Move to different file...
|
|
@@ -8,14 +8,14 @@ import {parseBuildingSceneLayer} from './lib/parsers/parse-i3s-building-scene-la
|
|
|
8
8
|
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
9
9
|
|
|
10
10
|
const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
|
|
11
|
+
|
|
11
12
|
/**
|
|
12
13
|
* Loader for I3S - Building Scene Layer
|
|
13
14
|
*/
|
|
14
|
-
export const I3SBuildingSceneLayerLoader
|
|
15
|
-
BuildingSceneLayerTileset,
|
|
16
|
-
never,
|
|
17
|
-
|
|
18
|
-
> = {
|
|
15
|
+
export const I3SBuildingSceneLayerLoader = {
|
|
16
|
+
dataType: null as unknown as BuildingSceneLayerTileset,
|
|
17
|
+
batchType: null as never,
|
|
18
|
+
|
|
19
19
|
name: 'I3S Building Scene Layer',
|
|
20
20
|
id: 'i3s-building-scene-layer',
|
|
21
21
|
module: 'i3s',
|
|
@@ -24,7 +24,7 @@ export const I3SBuildingSceneLayerLoader: LoaderWithParser<
|
|
|
24
24
|
parse,
|
|
25
25
|
extensions: ['json'],
|
|
26
26
|
options: {}
|
|
27
|
-
}
|
|
27
|
+
} as const satisfies LoaderWithParser<BuildingSceneLayerTileset, never, I3SLoaderOptions>;
|
|
28
28
|
|
|
29
29
|
async function parse(
|
|
30
30
|
data: ArrayBuffer,
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright vis.gl contributors
|
|
4
|
+
|
|
1
5
|
import type {LoaderWithParser, LoaderContext} from '@loaders.gl/loader-utils';
|
|
2
6
|
import type {I3SLoaderOptions} from './i3s-loader';
|
|
3
7
|
import {parseI3STileContent} from './lib/parsers/parse-i3s-tile-content';
|
|
@@ -11,7 +15,10 @@ const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
|
|
|
11
15
|
/**
|
|
12
16
|
* Loader for I3S - Indexed 3D Scene Layer
|
|
13
17
|
*/
|
|
14
|
-
export const I3SContentLoader
|
|
18
|
+
export const I3SContentLoader = {
|
|
19
|
+
dataType: null as unknown as I3STileContent | null,
|
|
20
|
+
batchType: null as never,
|
|
21
|
+
|
|
15
22
|
name: 'I3S Content (Indexed Scene Layers)',
|
|
16
23
|
id: 'i3s-content',
|
|
17
24
|
module: 'i3s',
|
|
@@ -23,7 +30,7 @@ export const I3SContentLoader: LoaderWithParser<I3STileContent | null, never, I3
|
|
|
23
30
|
options: {
|
|
24
31
|
'i3s-content': {}
|
|
25
32
|
}
|
|
26
|
-
}
|
|
33
|
+
} as const satisfies LoaderWithParser<I3STileContent | null, never, I3SLoaderOptions>;
|
|
27
34
|
|
|
28
35
|
async function parse(data, options?: I3SLoaderOptions, context?: LoaderContext) {
|
|
29
36
|
const {tile, _tileOptions, tileset, _tilesetOptions} = options?.i3s || {};
|
package/src/i3s-loader.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright vis.gl contributors
|
|
4
|
+
|
|
1
5
|
import type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';
|
|
2
6
|
import {parse} from '@loaders.gl/core';
|
|
3
7
|
import type {I3STilesetHeader} from './types';
|
|
@@ -24,7 +28,10 @@ export type I3SLoaderOptions = LoaderOptions & {
|
|
|
24
28
|
/**
|
|
25
29
|
* Loader for I3S - Indexed 3D Scene Layer
|
|
26
30
|
*/
|
|
27
|
-
export const I3SLoader
|
|
31
|
+
export const I3SLoader = {
|
|
32
|
+
dataType: null as unknown as I3STilesetHeader,
|
|
33
|
+
batchType: null as never,
|
|
34
|
+
|
|
28
35
|
name: 'I3S (Indexed Scene Layers)',
|
|
29
36
|
id: 'i3s',
|
|
30
37
|
module: 'i3s',
|
|
@@ -47,7 +54,7 @@ export const I3SLoader: LoaderWithParser<I3STilesetHeader, never, LoaderOptions>
|
|
|
47
54
|
coordinateSystem: COORDINATE_SYSTEM.METER_OFFSETS
|
|
48
55
|
}
|
|
49
56
|
}
|
|
50
|
-
}
|
|
57
|
+
} as const satisfies LoaderWithParser<I3STilesetHeader, never, LoaderOptions>;
|
|
51
58
|
|
|
52
59
|
async function parseI3S(data, options: I3SLoaderOptions = {}, context): Promise<I3STilesetHeader> {
|
|
53
60
|
const url = context.url;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright vis.gl contributors
|
|
4
|
+
|
|
1
5
|
import type {LoaderOptions, LoaderWithParser} from '@loaders.gl/loader-utils';
|
|
2
6
|
import type {I3SLoaderOptions} from './i3s-loader';
|
|
3
7
|
import type {NodePage} from './types';
|
|
@@ -9,7 +13,10 @@ const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
|
|
|
9
13
|
/**
|
|
10
14
|
* Loader for I3S node pages
|
|
11
15
|
*/
|
|
12
|
-
export const I3SNodePageLoader
|
|
16
|
+
export const I3SNodePageLoader = {
|
|
17
|
+
dataType: null as unknown as NodePage,
|
|
18
|
+
batchType: null as never,
|
|
19
|
+
|
|
13
20
|
name: 'I3S Node Page',
|
|
14
21
|
id: 'i3s-node-page',
|
|
15
22
|
module: 'i3s',
|
|
@@ -20,7 +27,7 @@ export const I3SNodePageLoader: LoaderWithParser<NodePage, never, I3SLoaderOptio
|
|
|
20
27
|
options: {
|
|
21
28
|
i3s: {}
|
|
22
29
|
}
|
|
23
|
-
}
|
|
30
|
+
} as const satisfies LoaderWithParser<NodePage, never, I3SLoaderOptions>;
|
|
24
31
|
|
|
25
32
|
async function parseNodePage(data: ArrayBuffer, options?: LoaderOptions): Promise<NodePage> {
|
|
26
33
|
return JSON.parse(new TextDecoder().decode(data)) as NodePage;
|
package/src/i3s-slpk-loader.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright vis.gl contributors
|
|
4
|
+
|
|
1
5
|
import type {LoaderOptions, LoaderWithParser} from '@loaders.gl/loader-utils';
|
|
2
6
|
import {DataViewFile} from '@loaders.gl/loader-utils';
|
|
3
7
|
import {parseSLPKArchive} from './lib/parsers/parse-slpk/parse-slpk';
|
|
@@ -21,7 +25,10 @@ export type SLPKLoaderOptions = LoaderOptions & {
|
|
|
21
25
|
* @todo - this reloads the entire archive for every tile, should be optimized
|
|
22
26
|
* @todo - this should be updated to use `parseFile` and ReadableFile
|
|
23
27
|
*/
|
|
24
|
-
export const SLPKLoader
|
|
28
|
+
export const SLPKLoader = {
|
|
29
|
+
dataType: null as unknown as ArrayBuffer,
|
|
30
|
+
batchType: null as never,
|
|
31
|
+
|
|
25
32
|
name: 'I3S SLPK (Scene Layer Package)',
|
|
26
33
|
id: 'slpk',
|
|
27
34
|
module: 'i3s',
|
|
@@ -33,4 +40,4 @@ export const SLPKLoader: LoaderWithParser<ArrayBuffer, never, SLPKLoaderOptions>
|
|
|
33
40
|
const archive = await parseSLPKArchive(new DataViewFile(new DataView(data)));
|
|
34
41
|
return archive.getFile(options.slpk?.path ?? '', options.slpk?.pathMode);
|
|
35
42
|
}
|
|
36
|
-
}
|
|
43
|
+
} as const satisfies LoaderWithParser<ArrayBuffer, never, SLPKLoaderOptions>;
|
|
@@ -76,17 +76,16 @@ export async function parseI3STileContent(
|
|
|
76
76
|
try {
|
|
77
77
|
// Image constructor is not supported in worker thread.
|
|
78
78
|
// Do parsing image data on the main thread by using context to avoid worker issues.
|
|
79
|
-
const texture = await parseFromContext(arrayBuffer, [], options, context!);
|
|
80
|
-
// @ts-expect-error
|
|
79
|
+
const texture: any = await parseFromContext(arrayBuffer, [], options, context!);
|
|
81
80
|
content.texture = texture;
|
|
82
81
|
} catch (e) {
|
|
83
82
|
// context object is different between worker and node.js conversion script.
|
|
84
83
|
// To prevent error we parse data in ordinary way if it is not parsed by using context.
|
|
85
|
-
const texture = await parse(arrayBuffer, loader, options, context);
|
|
84
|
+
const texture: any = await parse(arrayBuffer, loader, options, context);
|
|
86
85
|
content.texture = texture;
|
|
87
86
|
}
|
|
88
87
|
} else if (loader === CompressedTextureLoader || loader === BasisLoader) {
|
|
89
|
-
let texture = await load(arrayBuffer, loader, tileOptions.textureLoaderOptions);
|
|
88
|
+
let texture: any = await load(arrayBuffer, loader, tileOptions.textureLoaderOptions);
|
|
90
89
|
if (loader === BasisLoader) {
|
|
91
90
|
texture = texture[0];
|
|
92
91
|
}
|