@loaders.gl/i3s 4.2.0-alpha.3 → 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 +20 -11
- 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 +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 +2 -2
- package/dist/i3s-content-worker-node.js.map +2 -2
- package/dist/i3s-content-worker.js +9 -7
- package/dist/i3s-loader.d.ts +2 -2
- package/dist/i3s-loader.d.ts.map +1 -1
- package/dist/i3s-loader.js +77 -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 +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
package/dist/index.cjs
CHANGED
|
@@ -17,9 +17,9 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
|
-
//
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
20
|
+
// dist/index.js
|
|
21
|
+
var dist_exports = {};
|
|
22
|
+
__export(dist_exports, {
|
|
23
23
|
ArcGISWebSceneLoader: () => ArcGISWebSceneLoader,
|
|
24
24
|
COORDINATE_SYSTEM: () => COORDINATE_SYSTEM,
|
|
25
25
|
I3SAttributeLoader: () => I3SAttributeLoader,
|
|
@@ -34,9 +34,9 @@ __export(src_exports, {
|
|
|
34
34
|
loadFeatureAttributes: () => loadFeatureAttributes,
|
|
35
35
|
parseSLPKArchive: () => parseSLPKArchive
|
|
36
36
|
});
|
|
37
|
-
module.exports = __toCommonJS(
|
|
37
|
+
module.exports = __toCommonJS(dist_exports);
|
|
38
38
|
|
|
39
|
-
//
|
|
39
|
+
// dist/lib/parsers/constants.js
|
|
40
40
|
var import_math = require("@loaders.gl/math");
|
|
41
41
|
function getConstructorForDataFormat(dataType) {
|
|
42
42
|
switch (dataType) {
|
|
@@ -84,19 +84,19 @@ var STRING_ATTRIBUTE_TYPE = "String";
|
|
|
84
84
|
var OBJECT_ID_ATTRIBUTE_TYPE = "Oid32";
|
|
85
85
|
var FLOAT_64_TYPE = "Float64";
|
|
86
86
|
var INT_16_ATTRIBUTE_TYPE = "Int16";
|
|
87
|
-
var COORDINATE_SYSTEM
|
|
87
|
+
var COORDINATE_SYSTEM;
|
|
88
|
+
(function(COORDINATE_SYSTEM2) {
|
|
88
89
|
COORDINATE_SYSTEM2[COORDINATE_SYSTEM2["DEFAULT"] = -1] = "DEFAULT";
|
|
89
90
|
COORDINATE_SYSTEM2[COORDINATE_SYSTEM2["LNGLAT"] = 1] = "LNGLAT";
|
|
90
91
|
COORDINATE_SYSTEM2[COORDINATE_SYSTEM2["METER_OFFSETS"] = 2] = "METER_OFFSETS";
|
|
91
92
|
COORDINATE_SYSTEM2[COORDINATE_SYSTEM2["LNGLAT_OFFSETS"] = 3] = "LNGLAT_OFFSETS";
|
|
92
93
|
COORDINATE_SYSTEM2[COORDINATE_SYSTEM2["CARTESIAN"] = 0] = "CARTESIAN";
|
|
93
|
-
|
|
94
|
-
})(COORDINATE_SYSTEM || {});
|
|
94
|
+
})(COORDINATE_SYSTEM || (COORDINATE_SYSTEM = {}));
|
|
95
95
|
|
|
96
|
-
//
|
|
96
|
+
// dist/i3s-loader.js
|
|
97
97
|
var import_core5 = require("@loaders.gl/core");
|
|
98
98
|
|
|
99
|
-
//
|
|
99
|
+
// dist/lib/parsers/parse-i3s-tile-content.js
|
|
100
100
|
var import_core = require("@loaders.gl/core");
|
|
101
101
|
var import_core2 = require("@math.gl/core");
|
|
102
102
|
var import_geospatial = require("@math.gl/geospatial");
|
|
@@ -105,7 +105,14 @@ var import_images = require("@loaders.gl/images");
|
|
|
105
105
|
var import_draco = require("@loaders.gl/draco");
|
|
106
106
|
var import_textures = require("@loaders.gl/textures");
|
|
107
107
|
|
|
108
|
-
//
|
|
108
|
+
// dist/types.js
|
|
109
|
+
var HeaderAttributeProperty;
|
|
110
|
+
(function(HeaderAttributeProperty2) {
|
|
111
|
+
HeaderAttributeProperty2["vertexCount"] = "vertexCount";
|
|
112
|
+
HeaderAttributeProperty2["featureCount"] = "featureCount";
|
|
113
|
+
})(HeaderAttributeProperty || (HeaderAttributeProperty = {}));
|
|
114
|
+
|
|
115
|
+
// dist/lib/utils/url-utils.js
|
|
109
116
|
function getUrlWithoutParams(url) {
|
|
110
117
|
let urlWithoutParams;
|
|
111
118
|
try {
|
|
@@ -137,7 +144,7 @@ function generateTilesetAttributeUrls(tileset, url, resource) {
|
|
|
137
144
|
return attributeUrls;
|
|
138
145
|
}
|
|
139
146
|
|
|
140
|
-
//
|
|
147
|
+
// dist/lib/parsers/parse-i3s-tile-content.js
|
|
141
148
|
var scratchVector = new import_core2.Vector3([0, 0, 0]);
|
|
142
149
|
function getLoaderForTextureFormat(textureFormat) {
|
|
143
150
|
switch (textureFormat) {
|
|
@@ -236,14 +243,7 @@ async function parseI3SNodeGeometry(arrayBuffer, content, tileOptions, tilesetOp
|
|
|
236
243
|
});
|
|
237
244
|
vertexCount = decompressedGeometry.header.vertexCount;
|
|
238
245
|
indices = (_a = decompressedGeometry.indices) == null ? void 0 : _a.value;
|
|
239
|
-
const {
|
|
240
|
-
POSITION,
|
|
241
|
-
NORMAL,
|
|
242
|
-
COLOR_0,
|
|
243
|
-
TEXCOORD_0,
|
|
244
|
-
["feature-index"]: featureIndex,
|
|
245
|
-
["uv-region"]: uvRegion
|
|
246
|
-
} = decompressedGeometry.attributes;
|
|
246
|
+
const { POSITION, NORMAL, COLOR_0, TEXCOORD_0, ["feature-index"]: featureIndex, ["uv-region"]: uvRegion } = decompressedGeometry.attributes;
|
|
247
247
|
attributes = {
|
|
248
248
|
position: POSITION,
|
|
249
249
|
normal: NORMAL,
|
|
@@ -258,41 +258,24 @@ async function parseI3SNodeGeometry(arrayBuffer, content, tileOptions, tilesetOp
|
|
|
258
258
|
flattenFeatureIdsByFeatureIndices(attributes, featureIds);
|
|
259
259
|
}
|
|
260
260
|
} else {
|
|
261
|
-
const {
|
|
262
|
-
vertexAttributes,
|
|
263
|
-
ordering: attributesOrder,
|
|
264
|
-
featureAttributes,
|
|
265
|
-
featureAttributeOrder
|
|
266
|
-
} = tilesetOptions.store.defaultGeometrySchema;
|
|
261
|
+
const { vertexAttributes, ordering: attributesOrder, featureAttributes, featureAttributeOrder } = tilesetOptions.store.defaultGeometrySchema;
|
|
267
262
|
const headers = parseHeaders(arrayBuffer, tilesetOptions);
|
|
268
263
|
byteOffset = headers.byteOffset;
|
|
269
264
|
vertexCount = headers.vertexCount;
|
|
270
265
|
featureCount = headers.featureCount;
|
|
271
|
-
const { attributes: normalizedVertexAttributes, byteOffset: offset } = normalizeAttributes(
|
|
272
|
-
|
|
273
|
-
byteOffset,
|
|
274
|
-
vertexAttributes,
|
|
275
|
-
vertexCount,
|
|
276
|
-
attributesOrder
|
|
277
|
-
);
|
|
278
|
-
const { attributes: normalizedFeatureAttributes } = normalizeAttributes(
|
|
279
|
-
arrayBuffer,
|
|
280
|
-
offset,
|
|
281
|
-
featureAttributes,
|
|
282
|
-
featureCount,
|
|
283
|
-
featureAttributeOrder
|
|
284
|
-
);
|
|
266
|
+
const { attributes: normalizedVertexAttributes, byteOffset: offset } = normalizeAttributes(arrayBuffer, byteOffset, vertexAttributes, vertexCount, attributesOrder);
|
|
267
|
+
const { attributes: normalizedFeatureAttributes } = normalizeAttributes(arrayBuffer, offset, featureAttributes, featureCount, featureAttributeOrder);
|
|
285
268
|
flattenFeatureIdsByFaceRanges(normalizedFeatureAttributes);
|
|
286
269
|
attributes = concatAttributes(normalizedVertexAttributes, normalizedFeatureAttributes);
|
|
287
270
|
}
|
|
288
271
|
if (!((_b = options == null ? void 0 : options.i3s) == null ? void 0 : _b.coordinateSystem) || // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
|
|
289
|
-
options.i3s.coordinateSystem ===
|
|
272
|
+
options.i3s.coordinateSystem === COORDINATE_SYSTEM.METER_OFFSETS) {
|
|
290
273
|
const enuMatrix = parsePositions(attributes.position, tileOptions);
|
|
291
274
|
content.modelMatrix = enuMatrix.invert();
|
|
292
|
-
content.coordinateSystem =
|
|
275
|
+
content.coordinateSystem = COORDINATE_SYSTEM.METER_OFFSETS;
|
|
293
276
|
} else {
|
|
294
277
|
content.modelMatrix = getModelMatrix(attributes.position);
|
|
295
|
-
content.coordinateSystem =
|
|
278
|
+
content.coordinateSystem = COORDINATE_SYSTEM.LNGLAT_OFFSETS;
|
|
296
279
|
}
|
|
297
280
|
content.attributes = {
|
|
298
281
|
positions: attributes.position,
|
|
@@ -348,11 +331,11 @@ function parseHeaders(arrayBuffer, options) {
|
|
|
348
331
|
for (const { property, type } of options.store.defaultGeometrySchema.header) {
|
|
349
332
|
const TypedArrayTypeHeader = getConstructorForDataFormat(type);
|
|
350
333
|
switch (property) {
|
|
351
|
-
case
|
|
334
|
+
case HeaderAttributeProperty.vertexCount:
|
|
352
335
|
vertexCount = new TypedArrayTypeHeader(arrayBuffer, 0, 4)[0];
|
|
353
336
|
byteOffset += sizeOf(type);
|
|
354
337
|
break;
|
|
355
|
-
case
|
|
338
|
+
case HeaderAttributeProperty.featureCount:
|
|
356
339
|
featureCount = new TypedArrayTypeHeader(arrayBuffer, 4, 4)[0];
|
|
357
340
|
byteOffset += sizeOf(type);
|
|
358
341
|
break;
|
|
@@ -479,9 +462,7 @@ function makePbrMaterial(materialDefinition, texture) {
|
|
|
479
462
|
pbrMaterial.emissiveFactor = convertColorFormat(pbrMaterial.emissiveFactor);
|
|
480
463
|
}
|
|
481
464
|
if (pbrMaterial.pbrMetallicRoughness && pbrMaterial.pbrMetallicRoughness.baseColorFactor) {
|
|
482
|
-
pbrMaterial.pbrMetallicRoughness.baseColorFactor = convertColorFormat(
|
|
483
|
-
pbrMaterial.pbrMetallicRoughness.baseColorFactor
|
|
484
|
-
);
|
|
465
|
+
pbrMaterial.pbrMetallicRoughness.baseColorFactor = convertColorFormat(pbrMaterial.pbrMetallicRoughness.baseColorFactor);
|
|
485
466
|
}
|
|
486
467
|
if (texture) {
|
|
487
468
|
setMaterialTexture(pbrMaterial, texture);
|
|
@@ -551,8 +532,8 @@ function getFeatureIdsFromFeatureIndexMetadata(featureIndex) {
|
|
|
551
532
|
return (_b = (_a = featureIndex == null ? void 0 : featureIndex.metadata) == null ? void 0 : _a["i3s-feature-ids"]) == null ? void 0 : _b.intArray;
|
|
552
533
|
}
|
|
553
534
|
|
|
554
|
-
//
|
|
555
|
-
var VERSION =
|
|
535
|
+
// dist/i3s-content-loader.js
|
|
536
|
+
var VERSION = true ? "4.2.0-alpha.4" : "latest";
|
|
556
537
|
var I3SContentLoader = {
|
|
557
538
|
name: "I3S Content (Indexed Scene Layers)",
|
|
558
539
|
id: "i3s-content",
|
|
@@ -573,27 +554,21 @@ async function parse2(data, options, context) {
|
|
|
573
554
|
if (!tileOptions || !tilesetOptions) {
|
|
574
555
|
return null;
|
|
575
556
|
}
|
|
576
|
-
return await parseI3STileContent(
|
|
577
|
-
data,
|
|
578
|
-
tileOptions,
|
|
579
|
-
tilesetOptions,
|
|
580
|
-
options,
|
|
581
|
-
context
|
|
582
|
-
);
|
|
557
|
+
return await parseI3STileContent(data, tileOptions, tilesetOptions, options, context);
|
|
583
558
|
}
|
|
584
559
|
|
|
585
|
-
//
|
|
560
|
+
// dist/lib/parsers/parse-i3s.js
|
|
586
561
|
var import_culling = require("@math.gl/culling");
|
|
587
562
|
var import_geospatial2 = require("@math.gl/geospatial");
|
|
588
563
|
var import_core4 = require("@loaders.gl/core");
|
|
589
564
|
var import_tiles = require("@loaders.gl/tiles");
|
|
590
565
|
|
|
591
|
-
//
|
|
566
|
+
// dist/lib/helpers/i3s-nodepages-tiles.js
|
|
592
567
|
var import_core3 = require("@loaders.gl/core");
|
|
593
568
|
var import_textures2 = require("@loaders.gl/textures");
|
|
594
569
|
|
|
595
|
-
//
|
|
596
|
-
var VERSION2 =
|
|
570
|
+
// dist/i3s-node-page-loader.js
|
|
571
|
+
var VERSION2 = true ? "4.2.0-alpha.4" : "latest";
|
|
597
572
|
var I3SNodePageLoader = {
|
|
598
573
|
name: "I3S Node Page",
|
|
599
574
|
id: "i3s-node-page",
|
|
@@ -610,7 +585,7 @@ async function parseNodePage(data, options) {
|
|
|
610
585
|
return JSON.parse(new TextDecoder().decode(data));
|
|
611
586
|
}
|
|
612
587
|
|
|
613
|
-
//
|
|
588
|
+
// dist/lib/helpers/i3s-nodepages-tiles.js
|
|
614
589
|
var I3SNodePagesTiles = class {
|
|
615
590
|
/**
|
|
616
591
|
* @constructs
|
|
@@ -620,11 +595,11 @@ var I3SNodePagesTiles = class {
|
|
|
620
595
|
* @param options - i3s loader options
|
|
621
596
|
*/
|
|
622
597
|
constructor(tileset, url = "", options) {
|
|
598
|
+
var _a, _b;
|
|
623
599
|
this.nodePages = [];
|
|
624
600
|
this.pendingNodePages = [];
|
|
625
601
|
this.textureDefinitionsSelectedFormats = [];
|
|
626
602
|
this.textureLoaderOptions = {};
|
|
627
|
-
var _a, _b;
|
|
628
603
|
this.tileset = { ...tileset };
|
|
629
604
|
this.url = url;
|
|
630
605
|
this.nodesPerPage = ((_a = tileset.nodePages) == null ? void 0 : _a.nodesPerPage) || 64;
|
|
@@ -696,11 +671,7 @@ var I3SNodePagesTiles = class {
|
|
|
696
671
|
textureUrl = `${this.url}/nodes/${node.mesh.material.resource}/textures/${textureData.name}`;
|
|
697
672
|
}
|
|
698
673
|
if (this.tileset.attributeStorageInfo) {
|
|
699
|
-
attributeUrls = generateTilesetAttributeUrls(
|
|
700
|
-
this.tileset,
|
|
701
|
-
this.url,
|
|
702
|
-
node.mesh.attribute.resource
|
|
703
|
-
);
|
|
674
|
+
attributeUrls = generateTilesetAttributeUrls(this.tileset, this.url, node.mesh.attribute.resource);
|
|
704
675
|
}
|
|
705
676
|
}
|
|
706
677
|
const lodSelection = this.getLodSelection(node);
|
|
@@ -730,19 +701,13 @@ var I3SNodePagesTiles = class {
|
|
|
730
701
|
const geometryDefinition = this.tileset.geometryDefinitions[meshGeometryData.definition];
|
|
731
702
|
let geometryIndex = -1;
|
|
732
703
|
if (this.options.i3s && this.options.i3s.useDracoGeometry) {
|
|
733
|
-
geometryIndex = geometryDefinition.geometryBuffers.findIndex(
|
|
734
|
-
(buffer) => buffer.compressedAttributes && buffer.compressedAttributes.encoding === "draco"
|
|
735
|
-
);
|
|
704
|
+
geometryIndex = geometryDefinition.geometryBuffers.findIndex((buffer) => buffer.compressedAttributes && buffer.compressedAttributes.encoding === "draco");
|
|
736
705
|
}
|
|
737
706
|
if (geometryIndex === -1) {
|
|
738
|
-
geometryIndex = geometryDefinition.geometryBuffers.findIndex(
|
|
739
|
-
(buffer) => !buffer.compressedAttributes
|
|
740
|
-
);
|
|
707
|
+
geometryIndex = geometryDefinition.geometryBuffers.findIndex((buffer) => !buffer.compressedAttributes);
|
|
741
708
|
}
|
|
742
709
|
if (geometryIndex !== -1) {
|
|
743
|
-
const isDracoGeometry = Boolean(
|
|
744
|
-
geometryDefinition.geometryBuffers[geometryIndex].compressedAttributes
|
|
745
|
-
);
|
|
710
|
+
const isDracoGeometry = Boolean(geometryDefinition.geometryBuffers[geometryIndex].compressedAttributes);
|
|
746
711
|
result = {
|
|
747
712
|
url: `${this.url}/nodes/${meshGeometryData.resource}/geometries/${geometryIndex}`,
|
|
748
713
|
isDracoGeometry
|
|
@@ -845,7 +810,7 @@ var I3SNodePagesTiles = class {
|
|
|
845
810
|
}
|
|
846
811
|
};
|
|
847
812
|
|
|
848
|
-
//
|
|
813
|
+
// dist/lib/parsers/parse-i3s.js
|
|
849
814
|
function normalizeTileData(tile, context) {
|
|
850
815
|
const url = context.url || "";
|
|
851
816
|
let contentUrl;
|
|
@@ -894,11 +859,7 @@ function normalizeTileNonUrlData(tile) {
|
|
|
894
859
|
...tile.obb.quaternion
|
|
895
860
|
// quaternion
|
|
896
861
|
];
|
|
897
|
-
const obb = new import_culling.OrientedBoundingBox().fromCenterHalfSizeQuaternion(
|
|
898
|
-
boundingVolume.box.slice(0, 3),
|
|
899
|
-
tile.obb.halfSize,
|
|
900
|
-
tile.obb.quaternion
|
|
901
|
-
);
|
|
862
|
+
const obb = new import_culling.OrientedBoundingBox().fromCenterHalfSizeQuaternion(boundingVolume.box.slice(0, 3), tile.obb.halfSize, tile.obb.quaternion);
|
|
902
863
|
const boundingSphere = obb.getBoundingSphere();
|
|
903
864
|
boundingVolume.sphere = [...boundingSphere.center, boundingSphere.radius];
|
|
904
865
|
mbs = [...tile.obb.center, boundingSphere.radius];
|
|
@@ -944,8 +905,8 @@ async function normalizeTilesetData(tileset, options, context) {
|
|
|
944
905
|
};
|
|
945
906
|
}
|
|
946
907
|
|
|
947
|
-
//
|
|
948
|
-
var VERSION3 =
|
|
908
|
+
// dist/i3s-loader.js
|
|
909
|
+
var VERSION3 = true ? "4.2.0-alpha.4" : "latest";
|
|
949
910
|
var TILESET_REGEX = /layers\/[0-9]+$/;
|
|
950
911
|
var TILE_HEADER_REGEX = /nodes\/([0-9-]+|root)$/;
|
|
951
912
|
var SLPK_HEX = "504b0304";
|
|
@@ -970,7 +931,7 @@ var I3SLoader = {
|
|
|
970
931
|
useDracoGeometry: true,
|
|
971
932
|
useCompressedTextures: true,
|
|
972
933
|
decodeTextures: true,
|
|
973
|
-
coordinateSystem:
|
|
934
|
+
coordinateSystem: COORDINATE_SYSTEM.METER_OFFSETS
|
|
974
935
|
}
|
|
975
936
|
}
|
|
976
937
|
};
|
|
@@ -1025,13 +986,13 @@ function getMagicNumber(data) {
|
|
|
1025
986
|
return null;
|
|
1026
987
|
}
|
|
1027
988
|
|
|
1028
|
-
//
|
|
989
|
+
// dist/i3s-slpk-loader.js
|
|
1029
990
|
var import_loader_utils2 = require("@loaders.gl/loader-utils");
|
|
1030
991
|
|
|
1031
|
-
//
|
|
992
|
+
// dist/lib/parsers/parse-slpk/parse-slpk.js
|
|
1032
993
|
var import_zip2 = require("@loaders.gl/zip");
|
|
1033
994
|
|
|
1034
|
-
//
|
|
995
|
+
// dist/lib/parsers/parse-slpk/slpk-archieve.js
|
|
1035
996
|
var import_crypto = require("@loaders.gl/crypto");
|
|
1036
997
|
var import_zip = require("@loaders.gl/zip");
|
|
1037
998
|
var import_compression = require("@loaders.gl/compression");
|
|
@@ -1156,10 +1117,7 @@ var SLPKArchive = class extends import_zip.IndexedArchive {
|
|
|
1156
1117
|
if (!localFileHeader) {
|
|
1157
1118
|
return void 0;
|
|
1158
1119
|
}
|
|
1159
|
-
compressedFile = await this.fileProvider.slice(
|
|
1160
|
-
localFileHeader.fileDataOffset,
|
|
1161
|
-
localFileHeader.fileDataOffset + localFileHeader.compressedSize
|
|
1162
|
-
);
|
|
1120
|
+
compressedFile = await this.fileProvider.slice(localFileHeader.fileDataOffset, localFileHeader.fileDataOffset + localFileHeader.compressedSize);
|
|
1163
1121
|
} else {
|
|
1164
1122
|
try {
|
|
1165
1123
|
compressedFile = await this.getFileWithoutHash(path);
|
|
@@ -1171,36 +1129,28 @@ var SLPKArchive = class extends import_zip.IndexedArchive {
|
|
|
1171
1129
|
}
|
|
1172
1130
|
};
|
|
1173
1131
|
|
|
1174
|
-
//
|
|
1132
|
+
// dist/lib/parsers/parse-slpk/parse-slpk.js
|
|
1175
1133
|
async function parseSLPKArchive(fileProvider, cb, fileName) {
|
|
1176
1134
|
const hashCDOffset = await (0, import_zip2.searchFromTheEnd)(fileProvider, import_zip2.CD_HEADER_SIGNATURE);
|
|
1177
1135
|
const cdFileHeader = await (0, import_zip2.parseZipCDFileHeader)(hashCDOffset, fileProvider);
|
|
1178
1136
|
let hashTable;
|
|
1179
1137
|
if ((cdFileHeader == null ? void 0 : cdFileHeader.fileName) !== "@specialIndexFileHASH128@") {
|
|
1180
1138
|
hashTable = await (0, import_zip2.makeHashTableFromZipHeaders)(fileProvider);
|
|
1181
|
-
cb == null ? void 0 : cb(
|
|
1182
|
-
"SLPK doesnt contain hash file, hash info has been composed according to zip archive headers"
|
|
1183
|
-
);
|
|
1139
|
+
cb == null ? void 0 : cb("SLPK doesnt contain hash file, hash info has been composed according to zip archive headers");
|
|
1184
1140
|
} else {
|
|
1185
|
-
const localFileHeader = await (0, import_zip2.parseZipLocalFileHeader)(
|
|
1186
|
-
cdFileHeader.localHeaderOffset,
|
|
1187
|
-
fileProvider
|
|
1188
|
-
);
|
|
1141
|
+
const localFileHeader = await (0, import_zip2.parseZipLocalFileHeader)(cdFileHeader.localHeaderOffset, fileProvider);
|
|
1189
1142
|
if (!localFileHeader) {
|
|
1190
1143
|
throw new Error("corrupted SLPK");
|
|
1191
1144
|
}
|
|
1192
1145
|
const fileDataOffset = localFileHeader.fileDataOffset;
|
|
1193
|
-
const hashFile = await fileProvider.slice(
|
|
1194
|
-
fileDataOffset,
|
|
1195
|
-
fileDataOffset + localFileHeader.compressedSize
|
|
1196
|
-
);
|
|
1146
|
+
const hashFile = await fileProvider.slice(fileDataOffset, fileDataOffset + localFileHeader.compressedSize);
|
|
1197
1147
|
hashTable = (0, import_zip2.parseHashTable)(hashFile);
|
|
1198
1148
|
}
|
|
1199
1149
|
return new SLPKArchive(fileProvider, hashTable, fileName);
|
|
1200
1150
|
}
|
|
1201
1151
|
|
|
1202
|
-
//
|
|
1203
|
-
var VERSION4 =
|
|
1152
|
+
// dist/i3s-slpk-loader.js
|
|
1153
|
+
var VERSION4 = true ? "4.2.0-alpha.4" : "latest";
|
|
1204
1154
|
var SLPKLoader = {
|
|
1205
1155
|
name: "I3S SLPK (Scene Layer Package)",
|
|
1206
1156
|
id: "slpk",
|
|
@@ -1216,10 +1166,10 @@ var SLPKLoader = {
|
|
|
1216
1166
|
}
|
|
1217
1167
|
};
|
|
1218
1168
|
|
|
1219
|
-
//
|
|
1169
|
+
// dist/i3s-attribute-loader.js
|
|
1220
1170
|
var import_core6 = require("@loaders.gl/core");
|
|
1221
1171
|
|
|
1222
|
-
//
|
|
1172
|
+
// dist/lib/parsers/parse-i3s-attribute.js
|
|
1223
1173
|
function parseI3STileAttribute(arrayBuffer, options) {
|
|
1224
1174
|
const { attributeName, attributeType } = options;
|
|
1225
1175
|
if (!attributeName) {
|
|
@@ -1261,11 +1211,7 @@ function parseStringsAttribute(arrayBuffer) {
|
|
|
1261
1211
|
const bytesPerStringSize = 4;
|
|
1262
1212
|
const stringsArray = [];
|
|
1263
1213
|
try {
|
|
1264
|
-
const stringsCount = new DataView(
|
|
1265
|
-
arrayBuffer,
|
|
1266
|
-
stringsCountOffset,
|
|
1267
|
-
bytesPerStringSize
|
|
1268
|
-
).getUint32(stringsCountOffset, true);
|
|
1214
|
+
const stringsCount = new DataView(arrayBuffer, stringsCountOffset, bytesPerStringSize).getUint32(stringsCountOffset, true);
|
|
1269
1215
|
const stringSizes = new Uint32Array(arrayBuffer, dataOffset, stringsCount);
|
|
1270
1216
|
let stringOffset = dataOffset + stringsCount * bytesPerStringSize;
|
|
1271
1217
|
for (const stringByteSize of stringSizes) {
|
|
@@ -1280,8 +1226,8 @@ function parseStringsAttribute(arrayBuffer) {
|
|
|
1280
1226
|
return stringsArray;
|
|
1281
1227
|
}
|
|
1282
1228
|
|
|
1283
|
-
//
|
|
1284
|
-
var VERSION5 =
|
|
1229
|
+
// dist/i3s-attribute-loader.js
|
|
1230
|
+
var VERSION5 = true ? "4.2.0-alpha.4" : "latest";
|
|
1285
1231
|
var EMPTY_VALUE = "";
|
|
1286
1232
|
var REJECTED_STATUS = "rejected";
|
|
1287
1233
|
var I3SAttributeLoader = {
|
|
@@ -1385,7 +1331,7 @@ function formatAttributeValue(attribute, featureIdIndex, codedValues) {
|
|
|
1385
1331
|
return value;
|
|
1386
1332
|
}
|
|
1387
1333
|
|
|
1388
|
-
//
|
|
1334
|
+
// dist/lib/parsers/parse-i3s-building-scene-layer.js
|
|
1389
1335
|
var OBJECT_3D_LAYER_TYPE = "3DObject";
|
|
1390
1336
|
async function parseBuildingSceneLayer(data, url) {
|
|
1391
1337
|
const layer0 = JSON.parse(new TextDecoder().decode(data));
|
|
@@ -1418,8 +1364,8 @@ function parseSublayersTree(sublayers, url) {
|
|
|
1418
1364
|
return layers;
|
|
1419
1365
|
}
|
|
1420
1366
|
|
|
1421
|
-
//
|
|
1422
|
-
var VERSION6 =
|
|
1367
|
+
// dist/i3s-building-scene-layer-loader.js
|
|
1368
|
+
var VERSION6 = true ? "4.2.0-alpha.4" : "latest";
|
|
1423
1369
|
var I3SBuildingSceneLayerLoader = {
|
|
1424
1370
|
name: "I3S Building Scene Layer",
|
|
1425
1371
|
id: "i3s-building-scene-layer",
|
|
@@ -1437,7 +1383,7 @@ async function parse4(data, options, context) {
|
|
|
1437
1383
|
return parseBuildingSceneLayer(data, context.url);
|
|
1438
1384
|
}
|
|
1439
1385
|
|
|
1440
|
-
//
|
|
1386
|
+
// dist/lib/parsers/parse-arcgis-webscene.js
|
|
1441
1387
|
var import_core7 = require("@loaders.gl/core");
|
|
1442
1388
|
var SUPPORTED_WKID = 4326;
|
|
1443
1389
|
var ARCGIS_SCENE_SERVER_LAYER_TYPE = "ArcGISSceneServiceLayer";
|
|
@@ -1509,8 +1455,8 @@ async function checkSupportedIndexCRS(layer) {
|
|
|
1509
1455
|
}
|
|
1510
1456
|
}
|
|
1511
1457
|
|
|
1512
|
-
//
|
|
1513
|
-
var VERSION7 =
|
|
1458
|
+
// dist/arcgis-webscene-loader.js
|
|
1459
|
+
var VERSION7 = true ? "4.2.0-alpha.4" : "latest";
|
|
1514
1460
|
var ArcGISWebSceneLoader = {
|
|
1515
1461
|
name: "ArcGIS Web Scene Loader",
|
|
1516
1462
|
id: "arcgis-web-scene",
|
|
@@ -1525,7 +1471,7 @@ async function parse5(data) {
|
|
|
1525
1471
|
return parseWebscene(data);
|
|
1526
1472
|
}
|
|
1527
1473
|
|
|
1528
|
-
//
|
|
1474
|
+
// dist/lib/utils/customize-colors.js
|
|
1529
1475
|
var import_core8 = require("@loaders.gl/core");
|
|
1530
1476
|
async function customizeColors(colors, featureIds, attributeUrls, fields, attributeStorageInfo, colorsByAttribute, token) {
|
|
1531
1477
|
if (!colorsByAttribute) {
|
|
@@ -1536,17 +1482,10 @@ async function customizeColors(colors, featureIds, attributeUrls, fields, attrib
|
|
|
1536
1482
|
value: new Uint8Array(colors.value)
|
|
1537
1483
|
};
|
|
1538
1484
|
const colorizeAttributeField = fields.find(({ name }) => name === (colorsByAttribute == null ? void 0 : colorsByAttribute.attributeName));
|
|
1539
|
-
if (!colorizeAttributeField || !["esriFieldTypeDouble", "esriFieldTypeInteger", "esriFieldTypeSmallInteger"].includes(
|
|
1540
|
-
colorizeAttributeField.type
|
|
1541
|
-
)) {
|
|
1485
|
+
if (!colorizeAttributeField || !["esriFieldTypeDouble", "esriFieldTypeInteger", "esriFieldTypeSmallInteger"].includes(colorizeAttributeField.type)) {
|
|
1542
1486
|
return colors;
|
|
1543
1487
|
}
|
|
1544
|
-
const colorizeAttributeData = await loadFeatureAttributeData(
|
|
1545
|
-
colorizeAttributeField.name,
|
|
1546
|
-
attributeUrls,
|
|
1547
|
-
attributeStorageInfo,
|
|
1548
|
-
token
|
|
1549
|
-
);
|
|
1488
|
+
const colorizeAttributeData = await loadFeatureAttributeData(colorizeAttributeField.name, attributeUrls, attributeStorageInfo, token);
|
|
1550
1489
|
if (!colorizeAttributeData) {
|
|
1551
1490
|
return colors;
|
|
1552
1491
|
}
|
|
@@ -1554,12 +1493,7 @@ async function customizeColors(colors, featureIds, attributeUrls, fields, attrib
|
|
|
1554
1493
|
if (!objectIdField) {
|
|
1555
1494
|
return colors;
|
|
1556
1495
|
}
|
|
1557
|
-
const objectIdAttributeData = await loadFeatureAttributeData(
|
|
1558
|
-
objectIdField.name,
|
|
1559
|
-
attributeUrls,
|
|
1560
|
-
attributeStorageInfo,
|
|
1561
|
-
token
|
|
1562
|
-
);
|
|
1496
|
+
const objectIdAttributeData = await loadFeatureAttributeData(objectIdField.name, attributeUrls, attributeStorageInfo, token);
|
|
1563
1497
|
if (!objectIdAttributeData) {
|
|
1564
1498
|
return colors;
|
|
1565
1499
|
}
|
|
@@ -1611,3 +1545,4 @@ async function loadFeatureAttributeData(attributeName, attributeUrls, attributeS
|
|
|
1611
1545
|
});
|
|
1612
1546
|
return objectIdAttributeData;
|
|
1613
1547
|
}
|
|
1548
|
+
//# sourceMappingURL=index.cjs.map
|