@loaders.gl/i3s 4.2.0-alpha.4 → 4.2.0-alpha.5
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 +19 -10
- package/dist/dist.dev.js +1244 -731
- 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 +145 -94
- 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 +17 -13
- 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 +23 -24
- package/dist/i3s-content-worker-node.js +1 -1
- package/dist/i3s-content-worker-node.js.map +2 -2
- package/dist/i3s-content-worker.js +3 -1
- package/dist/i3s-loader.d.ts +2 -2
- package/dist/i3s-loader.d.ts.map +1 -1
- package/dist/i3s-loader.js +76 -65
- 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 +16 -12
- package/dist/i3s-slpk-loader.js +18 -14
- package/dist/index.cjs +73 -138
- 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 +226 -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 +79 -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 +460 -394
- 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 +132 -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 +13 -12
- 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
|
@@ -1,119 +1,170 @@
|
|
|
1
1
|
import { load } from '@loaders.gl/core';
|
|
2
2
|
import { parseI3STileAttribute } from "./lib/parsers/parse-i3s-attribute.js";
|
|
3
3
|
import { getUrlWithToken } from "./lib/utils/url-utils.js";
|
|
4
|
+
// __VERSION__ is injected by babel-plugin-version-inline
|
|
5
|
+
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
4
6
|
const VERSION = typeof "4.2.0-alpha.4" !== 'undefined' ? "4.2.0-alpha.4" : 'latest';
|
|
5
7
|
const EMPTY_VALUE = '';
|
|
6
8
|
const REJECTED_STATUS = 'rejected';
|
|
9
|
+
/**
|
|
10
|
+
* Loader for I3S attributes
|
|
11
|
+
*/
|
|
7
12
|
export const I3SAttributeLoader = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
name: 'I3S Attribute',
|
|
14
|
+
id: 'i3s-attribute',
|
|
15
|
+
module: 'i3s',
|
|
16
|
+
version: VERSION,
|
|
17
|
+
mimeTypes: ['application/binary'],
|
|
18
|
+
parse: async (arrayBuffer, options) => parseI3STileAttribute(arrayBuffer, options),
|
|
19
|
+
extensions: ['bin'],
|
|
20
|
+
options: {},
|
|
21
|
+
binary: true
|
|
17
22
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
23
|
+
// TODO - these seem to use the loader rather than being part of the loader. Move to different file...
|
|
24
|
+
/**
|
|
25
|
+
* Load attributes based on feature id
|
|
26
|
+
* @param {Object} tile
|
|
27
|
+
* @param {number} featureId
|
|
28
|
+
* @param {Object} options
|
|
29
|
+
* @returns {Promise}
|
|
30
|
+
*/
|
|
31
|
+
// eslint-disable-next-line complexity
|
|
32
|
+
export async function loadFeatureAttributes(tile, featureId, options = {}) {
|
|
33
|
+
const { attributeStorageInfo, attributeUrls, tilesetFields } = getAttributesData(tile);
|
|
34
|
+
if (!attributeStorageInfo || !attributeUrls || featureId < 0) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
let attributes = [];
|
|
38
|
+
const attributeLoadPromises = [];
|
|
39
|
+
for (let index = 0; index < attributeStorageInfo.length; index++) {
|
|
40
|
+
// @ts-ignore
|
|
41
|
+
const url = getUrlWithToken(attributeUrls[index], options.i3s?.token);
|
|
42
|
+
const attributeName = attributeStorageInfo[index].name;
|
|
43
|
+
const attributeType = getAttributeValueType(attributeStorageInfo[index]);
|
|
44
|
+
const loadOptions = { ...options, attributeName, attributeType };
|
|
45
|
+
const promise = load(url, I3SAttributeLoader, loadOptions);
|
|
46
|
+
attributeLoadPromises.push(promise);
|
|
47
|
+
}
|
|
48
|
+
try {
|
|
49
|
+
attributes = await Promise.allSettled(attributeLoadPromises);
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
// do nothing
|
|
53
|
+
}
|
|
54
|
+
if (!attributes.length) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
return generateAttributesByFeatureId(attributes, attributeStorageInfo, featureId, tilesetFields);
|
|
50
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Gets attributes data from tile.
|
|
61
|
+
* @param tile
|
|
62
|
+
* @returns
|
|
63
|
+
*/
|
|
51
64
|
function getAttributesData(tile) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
return {
|
|
57
|
-
attributeStorageInfo,
|
|
58
|
-
attributeUrls,
|
|
59
|
-
tilesetFields
|
|
60
|
-
};
|
|
65
|
+
const attributeStorageInfo = tile.tileset?.tileset?.attributeStorageInfo;
|
|
66
|
+
const attributeUrls = tile.header?.attributeUrls;
|
|
67
|
+
const tilesetFields = tile.tileset?.tileset?.fields || [];
|
|
68
|
+
return { attributeStorageInfo, attributeUrls, tilesetFields };
|
|
61
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Get attribute value type based on property names
|
|
72
|
+
* @param {Object} attribute
|
|
73
|
+
* @returns {String}
|
|
74
|
+
*/
|
|
62
75
|
export function getAttributeValueType(attribute) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
76
|
+
if (attribute.hasOwnProperty('objectIds')) {
|
|
77
|
+
return 'Oid32';
|
|
78
|
+
}
|
|
79
|
+
else if (attribute.hasOwnProperty('attributeValues')) {
|
|
80
|
+
return attribute.attributeValues.valueType;
|
|
81
|
+
}
|
|
82
|
+
return '';
|
|
69
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Find in attributeStorageInfo attribute name responsible for feature ids list.
|
|
86
|
+
* @param attributeStorageInfo
|
|
87
|
+
* @returns Feature ids attribute name
|
|
88
|
+
*/
|
|
70
89
|
function getFeatureIdsAttributeName(attributeStorageInfo) {
|
|
71
|
-
|
|
72
|
-
|
|
90
|
+
const objectIdsAttribute = attributeStorageInfo.find(attribute => attribute.name.includes('OBJECTID'));
|
|
91
|
+
return objectIdsAttribute?.name;
|
|
73
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Generates mapping featureId to feature attributes
|
|
95
|
+
* @param {Array} attributes
|
|
96
|
+
* @param {Object} attributeStorageInfo
|
|
97
|
+
* @param {number} featureId
|
|
98
|
+
* @returns {Object}
|
|
99
|
+
*/
|
|
74
100
|
function generateAttributesByFeatureId(attributes, attributeStorageInfo, featureId, tilesetFields) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
101
|
+
const objectIdsAttributeName = getFeatureIdsAttributeName(attributeStorageInfo);
|
|
102
|
+
const objectIds = attributes.find((attribute) => attribute.value[objectIdsAttributeName]);
|
|
103
|
+
if (!objectIds) {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
const attributeIndex = objectIds.value[objectIdsAttributeName].indexOf(featureId);
|
|
107
|
+
if (attributeIndex < 0) {
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
return getFeatureAttributesByIndex(attributes, attributeIndex, attributeStorageInfo, tilesetFields);
|
|
85
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* Generates attribute object for feature mapping by feature id
|
|
114
|
+
* @param {Array} attributes
|
|
115
|
+
* @param {Number} featureIdIndex
|
|
116
|
+
* @param {Object} attributeStorageInfo
|
|
117
|
+
* @returns {Object}
|
|
118
|
+
*/
|
|
86
119
|
function getFeatureAttributesByIndex(attributes, featureIdIndex, attributeStorageInfo, tilesetFields) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
120
|
+
const attributesObject = {};
|
|
121
|
+
for (let index = 0; index < attributeStorageInfo.length; index++) {
|
|
122
|
+
const attributeName = attributeStorageInfo[index].name;
|
|
123
|
+
const codedValues = getAttributeCodedValues(attributeName, tilesetFields);
|
|
124
|
+
const attribute = getAttributeByIndexAndAttributeName(attributes, index, attributeName);
|
|
125
|
+
attributesObject[attributeName] = formatAttributeValue(attribute, featureIdIndex, codedValues);
|
|
126
|
+
}
|
|
127
|
+
return attributesObject;
|
|
95
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
* Get coded values list from tileset.
|
|
131
|
+
* @param attributeName
|
|
132
|
+
* @param tilesetFields
|
|
133
|
+
*/
|
|
96
134
|
function getAttributeCodedValues(attributeName, tilesetFields) {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
135
|
+
const attributeField = tilesetFields
|
|
136
|
+
.find(field => field.name === attributeName || field.alias === attributeName);
|
|
137
|
+
return attributeField?.domain?.codedValues || [];
|
|
100
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* Return attribute value if it presents in atrributes list
|
|
141
|
+
* @param {array} attributes
|
|
142
|
+
* @param {number} index
|
|
143
|
+
* @param {string} attributesName
|
|
144
|
+
*/
|
|
101
145
|
function getAttributeByIndexAndAttributeName(attributes, index, attributesName) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
146
|
+
const attributeObject = attributes[index];
|
|
147
|
+
if (attributeObject.status === REJECTED_STATUS) {
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
return attributeObject.value[attributesName];
|
|
107
151
|
}
|
|
152
|
+
/**
|
|
153
|
+
* Do formatting of attribute values or return empty string.
|
|
154
|
+
* @param {Array} attribute
|
|
155
|
+
* @param {Number} featureIdIndex
|
|
156
|
+
* @returns {String}
|
|
157
|
+
*/
|
|
108
158
|
function formatAttributeValue(attribute, featureIdIndex, codedValues) {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
159
|
+
let value = EMPTY_VALUE;
|
|
160
|
+
if (attribute && (featureIdIndex in attribute)) {
|
|
161
|
+
// eslint-disable-next-line no-control-regex
|
|
162
|
+
value = String(attribute[featureIdIndex]).replace(/\u0000|NaN/g, '').trim();
|
|
163
|
+
}
|
|
164
|
+
// Check if coded values are existed. If so we use them.
|
|
165
|
+
if (codedValues.length) {
|
|
166
|
+
const codeValue = codedValues.find(codedValue => codedValue.code === Number(value));
|
|
167
|
+
value = codeValue?.name || EMPTY_VALUE;
|
|
168
|
+
}
|
|
169
|
+
return value;
|
|
118
170
|
}
|
|
119
|
-
//# sourceMappingURL=i3s-attribute-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 { BuildingSceneLayerTileset } from
|
|
2
|
+
import type { I3SLoaderOptions } from "./i3s-loader.js";
|
|
3
|
+
import type { BuildingSceneLayerTileset } from "./types.js";
|
|
4
4
|
/**
|
|
5
5
|
* Loader for I3S - Building Scene Layer
|
|
6
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i3s-building-scene-layer-loader.d.ts","sourceRoot":"","sources":["../src/i3s-building-scene-layer-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,gBAAgB,EAA+B,MAAM,0BAA0B,CAAC;AAC7F,OAAO,KAAK,EAAC,gBAAgB,EAAC,
|
|
1
|
+
{"version":3,"file":"i3s-building-scene-layer-loader.d.ts","sourceRoot":"","sources":["../src/i3s-building-scene-layer-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,gBAAgB,EAA+B,MAAM,0BAA0B,CAAC;AAC7F,OAAO,KAAK,EAAC,gBAAgB,EAAC,wBAAqB;AACnD,OAAO,KAAK,EAAC,yBAAyB,EAAC,mBAAgB;AAQvD;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,gBAAgB,CACxD,yBAAyB,EACzB,KAAK,EACL,gBAAgB,CAUjB,CAAC"}
|
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
import { parseBuildingSceneLayer } from "./lib/parsers/parse-i3s-building-scene-layer.js";
|
|
2
|
+
// __VERSION__ is injected by babel-plugin-version-inline
|
|
3
|
+
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
2
4
|
const VERSION = typeof "4.2.0-alpha.4" !== 'undefined' ? "4.2.0-alpha.4" : 'latest';
|
|
5
|
+
/**
|
|
6
|
+
* Loader for I3S - Building Scene Layer
|
|
7
|
+
*/
|
|
3
8
|
export const I3SBuildingSceneLayerLoader = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
name: 'I3S Building Scene Layer',
|
|
10
|
+
id: 'i3s-building-scene-layer',
|
|
11
|
+
module: 'i3s',
|
|
12
|
+
version: VERSION,
|
|
13
|
+
mimeTypes: ['application/json'],
|
|
14
|
+
parse,
|
|
15
|
+
extensions: ['json'],
|
|
16
|
+
options: {}
|
|
12
17
|
};
|
|
13
18
|
async function parse(data, options, context) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
if (!context?.url) {
|
|
20
|
+
throw new Error('Url is not provided');
|
|
21
|
+
}
|
|
22
|
+
return parseBuildingSceneLayer(data, context.url);
|
|
18
23
|
}
|
|
19
|
-
//# sourceMappingURL=i3s-building-scene-layer-loader.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LoaderWithParser } from '@loaders.gl/loader-utils';
|
|
2
|
-
import type { I3SLoaderOptions } from
|
|
3
|
-
import { I3STileContent } from
|
|
2
|
+
import type { I3SLoaderOptions } from "./i3s-loader.js";
|
|
3
|
+
import { I3STileContent } from "./types.js";
|
|
4
4
|
/**
|
|
5
5
|
* Loader for I3S - Indexed 3D Scene Layer
|
|
6
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i3s-content-loader.d.ts","sourceRoot":"","sources":["../src/i3s-content-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,gBAAgB,EAAgB,MAAM,0BAA0B,CAAC;AAC9E,OAAO,KAAK,EAAC,gBAAgB,EAAC,
|
|
1
|
+
{"version":3,"file":"i3s-content-loader.d.ts","sourceRoot":"","sources":["../src/i3s-content-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,gBAAgB,EAAgB,MAAM,0BAA0B,CAAC;AAC9E,OAAO,KAAK,EAAC,gBAAgB,EAAC,wBAAqB;AAEnD,OAAO,EAAC,cAAc,EAAoC,mBAAgB;AAO1E;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,gBAAgB,CAAC,cAAc,GAAG,IAAI,EAAE,KAAK,EAAE,gBAAgB,CAY7F,CAAC"}
|
|
@@ -1,30 +1,29 @@
|
|
|
1
1
|
import { parseI3STileContent } from "./lib/parsers/parse-i3s-tile-content.js";
|
|
2
|
+
// __VERSION__ is injected by babel-plugin-version-inline
|
|
3
|
+
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
2
4
|
const VERSION = typeof "4.2.0-alpha.4" !== 'undefined' ? "4.2.0-alpha.4" : 'latest';
|
|
5
|
+
/**
|
|
6
|
+
* Loader for I3S - Indexed 3D Scene Layer
|
|
7
|
+
*/
|
|
3
8
|
export const I3SContentLoader = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
name: 'I3S Content (Indexed Scene Layers)',
|
|
10
|
+
id: 'i3s-content',
|
|
11
|
+
module: 'i3s',
|
|
12
|
+
worker: true,
|
|
13
|
+
version: VERSION,
|
|
14
|
+
mimeTypes: ['application/octet-stream'],
|
|
15
|
+
parse,
|
|
16
|
+
extensions: ['bin'],
|
|
17
|
+
options: {
|
|
18
|
+
'i3s-content': {}
|
|
19
|
+
}
|
|
15
20
|
};
|
|
16
21
|
async function parse(data, options, context) {
|
|
17
|
-
|
|
18
|
-
tile
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const tilesetOptions = _tilesetOptions || tileset;
|
|
25
|
-
if (!tileOptions || !tilesetOptions) {
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
return await parseI3STileContent(data, tileOptions, tilesetOptions, options, context);
|
|
22
|
+
const { tile, _tileOptions, tileset, _tilesetOptions } = options?.i3s || {};
|
|
23
|
+
const tileOptions = _tileOptions || tile;
|
|
24
|
+
const tilesetOptions = _tilesetOptions || tileset;
|
|
25
|
+
if (!tileOptions || !tilesetOptions) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
return await parseI3STileContent(data, tileOptions, tilesetOptions, options, context);
|
|
29
29
|
}
|
|
30
|
-
//# sourceMappingURL=i3s-content-loader.js.map
|