@loaders.gl/i3s 4.0.0-alpha.22 → 4.0.0-alpha.24
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/dist.min.js +57 -55
- package/dist/es5/arcgis-webscene-loader.js +4 -4
- package/dist/es5/arcgis-webscene-loader.js.map +1 -1
- package/dist/es5/i3s-attribute-loader.js +1 -1
- package/dist/es5/i3s-attribute-loader.js.map +1 -1
- package/dist/es5/i3s-building-scene-layer-loader.js +1 -1
- package/dist/es5/i3s-building-scene-layer-loader.js.map +1 -1
- package/dist/es5/i3s-content-loader.js +1 -1
- package/dist/es5/i3s-content-loader.js.map +1 -1
- package/dist/es5/i3s-loader.js +1 -1
- package/dist/es5/i3s-loader.js.map +1 -1
- package/dist/es5/i3s-node-page-loader.js +14 -12
- package/dist/es5/i3s-node-page-loader.js.map +1 -1
- package/dist/es5/i3s-slpk-loader.js +3 -3
- package/dist/es5/i3s-slpk-loader.js.map +1 -1
- package/dist/es5/index.js +2 -2
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/lib/parsers/parse-arcgis-webscene.js.map +1 -1
- package/dist/es5/lib/parsers/parse-i3s-tile-content.js.map +1 -1
- package/dist/es5/lib/parsers/parse-i3s.js.map +1 -1
- package/dist/es5/lib/parsers/parse-slpk/parse-slpk.js.map +1 -1
- package/dist/es5/lib/parsers/parse-slpk/slpk-archieve.js.map +1 -1
- package/dist/es5/types.js.map +1 -1
- package/dist/esm/arcgis-webscene-loader.js +2 -2
- package/dist/esm/arcgis-webscene-loader.js.map +1 -1
- package/dist/esm/i3s-attribute-loader.js +1 -1
- package/dist/esm/i3s-attribute-loader.js.map +1 -1
- package/dist/esm/i3s-building-scene-layer-loader.js +1 -1
- package/dist/esm/i3s-building-scene-layer-loader.js.map +1 -1
- package/dist/esm/i3s-content-loader.js +1 -1
- package/dist/esm/i3s-content-loader.js.map +1 -1
- package/dist/esm/i3s-loader.js +1 -1
- package/dist/esm/i3s-loader.js.map +1 -1
- package/dist/esm/i3s-node-page-loader.js +7 -5
- package/dist/esm/i3s-node-page-loader.js.map +1 -1
- package/dist/esm/i3s-slpk-loader.js +2 -2
- package/dist/esm/i3s-slpk-loader.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/parsers/parse-arcgis-webscene.js.map +1 -1
- package/dist/esm/lib/parsers/parse-i3s-tile-content.js.map +1 -1
- package/dist/esm/lib/parsers/parse-i3s.js.map +1 -1
- package/dist/esm/lib/parsers/parse-slpk/parse-slpk.js.map +1 -1
- package/dist/esm/lib/parsers/parse-slpk/slpk-archieve.js.map +1 -1
- package/dist/esm/types.js.map +1 -1
- package/dist/i3s-content-worker-node.js +41 -41
- package/dist/i3s-content-worker-node.js.map +2 -2
- package/dist/i3s-content-worker.js +17 -17
- package/dist/src/arcgis-webscene-loader.d.ts +9 -0
- package/dist/src/arcgis-webscene-loader.d.ts.map +1 -0
- package/dist/src/bundle.d.ts.map +1 -0
- package/dist/{i3s-attribute-loader.d.ts → src/i3s-attribute-loader.d.ts} +3 -2
- package/dist/src/i3s-attribute-loader.d.ts.map +1 -0
- package/dist/src/i3s-building-scene-layer-loader.d.ts +8 -0
- package/dist/src/i3s-building-scene-layer-loader.d.ts.map +1 -0
- package/dist/src/i3s-content-loader.d.ts +8 -0
- package/dist/src/i3s-content-loader.d.ts.map +1 -0
- package/dist/{i3s-loader.d.ts → src/i3s-loader.d.ts} +2 -1
- package/dist/src/i3s-loader.d.ts.map +1 -0
- package/dist/src/i3s-node-page-loader.d.ts +8 -0
- package/dist/src/i3s-node-page-loader.d.ts.map +1 -0
- package/dist/{i3s-slpk-loader.d.ts → src/i3s-slpk-loader.d.ts} +2 -3
- package/dist/src/i3s-slpk-loader.d.ts.map +1 -0
- package/dist/{index.d.ts → src/index.d.ts} +1 -1
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/lib/helpers/i3s-nodepages-tiles.d.ts.map +1 -0
- package/dist/src/lib/parsers/constants.d.ts.map +1 -0
- package/dist/src/lib/parsers/parse-arcgis-webscene.d.ts +7 -0
- package/dist/src/lib/parsers/parse-arcgis-webscene.d.ts.map +1 -0
- package/dist/src/lib/parsers/parse-i3s-attribute.d.ts.map +1 -0
- package/dist/src/lib/parsers/parse-i3s-building-scene-layer.d.ts.map +1 -0
- package/dist/src/lib/parsers/parse-i3s-tile-content.d.ts.map +1 -0
- package/dist/{lib → src/lib}/parsers/parse-i3s.d.ts +1 -1
- package/dist/src/lib/parsers/parse-i3s.d.ts.map +1 -0
- package/dist/{lib → src/lib}/parsers/parse-slpk/parse-slpk.d.ts +1 -1
- package/dist/src/lib/parsers/parse-slpk/parse-slpk.d.ts.map +1 -0
- package/dist/{lib → src/lib}/parsers/parse-slpk/slpk-archieve.d.ts +2 -1
- package/dist/src/lib/parsers/parse-slpk/slpk-archieve.d.ts.map +1 -0
- package/dist/src/lib/utils/convert-i3s-obb-to-mbs.d.ts.map +1 -0
- package/dist/src/lib/utils/customize-/321/201olors.d.ts.map +1 -0
- package/dist/src/lib/utils/url-utils.d.ts.map +1 -0
- package/dist/{types.d.ts → src/types.d.ts} +16 -16
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/workers/i3s-content-worker-node.d.ts.map +1 -0
- package/dist/src/workers/i3s-content-worker.d.ts.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +9 -9
- package/src/arcgis-webscene-loader.ts +12 -6
- package/src/i3s-attribute-loader.ts +2 -1
- package/src/i3s-building-scene-layer-loader.ts +6 -1
- package/src/i3s-content-loader.ts +3 -2
- package/src/i3s-loader.ts +3 -2
- package/src/i3s-node-page-loader.ts +9 -6
- package/src/i3s-slpk-loader.ts +3 -3
- package/src/index.ts +1 -1
- package/src/lib/parsers/parse-arcgis-webscene.ts +2 -2
- package/src/lib/parsers/parse-i3s-tile-content.ts +1 -5
- package/src/lib/parsers/parse-i3s.ts +3 -2
- package/src/lib/parsers/parse-slpk/parse-slpk.ts +1 -1
- package/src/lib/parsers/parse-slpk/slpk-archieve.ts +2 -1
- package/src/types.ts +16 -16
- package/dist/arcgis-webscene-loader.d.ts +0 -7
- package/dist/arcgis-webscene-loader.d.ts.map +0 -1
- package/dist/arcgis-webscene-loader.js +0 -28
- package/dist/bundle.d.ts.map +0 -1
- package/dist/bundle.js +0 -5
- package/dist/i3s-attribute-loader.d.ts.map +0 -1
- package/dist/i3s-attribute-loader.js +0 -175
- package/dist/i3s-building-scene-layer-loader.d.ts +0 -6
- package/dist/i3s-building-scene-layer-loader.d.ts.map +0 -1
- package/dist/i3s-building-scene-layer-loader.js +0 -26
- package/dist/i3s-content-loader.d.ts +0 -6
- package/dist/i3s-content-loader.d.ts.map +0 -1
- package/dist/i3s-content-loader.js +0 -32
- package/dist/i3s-loader.d.ts.map +0 -1
- package/dist/i3s-loader.js +0 -100
- package/dist/i3s-node-page-loader.d.ts +0 -7
- package/dist/i3s-node-page-loader.d.ts.map +0 -1
- package/dist/i3s-node-page-loader.js +0 -22
- package/dist/i3s-slpk-loader.d.ts.map +0 -1
- package/dist/i3s-slpk-loader.js +0 -30
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -23
- package/dist/lib/helpers/i3s-nodepages-tiles.d.ts.map +0 -1
- package/dist/lib/helpers/i3s-nodepages-tiles.js +0 -244
- package/dist/lib/parsers/constants.d.ts.map +0 -1
- package/dist/lib/parsers/constants.js +0 -88
- package/dist/lib/parsers/parse-arcgis-webscene.d.ts +0 -7
- package/dist/lib/parsers/parse-arcgis-webscene.d.ts.map +0 -1
- package/dist/lib/parsers/parse-arcgis-webscene.js +0 -88
- package/dist/lib/parsers/parse-i3s-attribute.d.ts.map +0 -1
- package/dist/lib/parsers/parse-i3s-attribute.js +0 -99
- package/dist/lib/parsers/parse-i3s-building-scene-layer.d.ts.map +0 -1
- package/dist/lib/parsers/parse-i3s-building-scene-layer.js +0 -46
- package/dist/lib/parsers/parse-i3s-tile-content.d.ts.map +0 -1
- package/dist/lib/parsers/parse-i3s-tile-content.js +0 -502
- package/dist/lib/parsers/parse-i3s.d.ts.map +0 -1
- package/dist/lib/parsers/parse-i3s.js +0 -105
- package/dist/lib/parsers/parse-slpk/parse-slpk.d.ts.map +0 -1
- package/dist/lib/parsers/parse-slpk/parse-slpk.js +0 -33
- package/dist/lib/parsers/parse-slpk/slpk-archieve.d.ts.map +0 -1
- package/dist/lib/parsers/parse-slpk/slpk-archieve.js +0 -131
- package/dist/lib/utils/convert-i3s-obb-to-mbs.d.ts.map +0 -1
- package/dist/lib/utils/convert-i3s-obb-to-mbs.js +0 -20
- package/dist/lib/utils/customize-/321/201olors.d.ts.map +0 -1
- package/dist/lib/utils/customize-/321/201olors.js +0 -104
- package/dist/lib/utils/url-utils.d.ts.map +0 -1
- package/dist/lib/utils/url-utils.js +0 -45
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -8
- package/dist/workers/i3s-content-worker-node.d.ts.map +0 -1
- package/dist/workers/i3s-content-worker-node.js +0 -7
- package/dist/workers/i3s-content-worker.d.ts.map +0 -1
- package/dist/workers/i3s-content-worker.js +0 -5
- /package/dist/{bundle.d.ts → src/bundle.d.ts} +0 -0
- /package/dist/{lib → src/lib}/helpers/i3s-nodepages-tiles.d.ts +0 -0
- /package/dist/{lib → src/lib}/parsers/constants.d.ts +0 -0
- /package/dist/{lib → src/lib}/parsers/parse-i3s-attribute.d.ts +0 -0
- /package/dist/{lib → src/lib}/parsers/parse-i3s-building-scene-layer.d.ts +0 -0
- /package/dist/{lib → src/lib}/parsers/parse-i3s-tile-content.d.ts +0 -0
- /package/dist/{lib → src/lib}/utils/convert-i3s-obb-to-mbs.d.ts +0 -0
- /package/dist/{lib → src/lib}/utils/customize-/321/201olors.d.ts" +0 -0
- /package/dist/{lib → src/lib}/utils/url-utils.d.ts +0 -0
- /package/dist/{workers → src/workers}/i3s-content-worker-node.d.ts +0 -0
- /package/dist/{workers → src/workers}/i3s-content-worker.d.ts +0 -0
package/dist/dist.min.js
CHANGED
|
@@ -1774,6 +1774,44 @@
|
|
|
1774
1774
|
}
|
|
1775
1775
|
});
|
|
1776
1776
|
|
|
1777
|
+
// ../loader-utils/src/lib/file-provider/data-view-file.ts
|
|
1778
|
+
var toNumber, DataViewFile;
|
|
1779
|
+
var init_data_view_file = __esm({
|
|
1780
|
+
"../loader-utils/src/lib/file-provider/data-view-file.ts"() {
|
|
1781
|
+
toNumber = (bigint) => {
|
|
1782
|
+
if (bigint > Number.MAX_SAFE_INTEGER) {
|
|
1783
|
+
throw new Error("Offset is out of bounds");
|
|
1784
|
+
}
|
|
1785
|
+
return Number(bigint);
|
|
1786
|
+
};
|
|
1787
|
+
DataViewFile = class {
|
|
1788
|
+
constructor(file) {
|
|
1789
|
+
this.file = file;
|
|
1790
|
+
}
|
|
1791
|
+
async destroy() {
|
|
1792
|
+
}
|
|
1793
|
+
async getUint8(offset) {
|
|
1794
|
+
return this.file.getUint8(toNumber(offset));
|
|
1795
|
+
}
|
|
1796
|
+
async getUint16(offset) {
|
|
1797
|
+
return this.file.getUint16(toNumber(offset), true);
|
|
1798
|
+
}
|
|
1799
|
+
async getUint32(offset) {
|
|
1800
|
+
return this.file.getUint32(toNumber(offset), true);
|
|
1801
|
+
}
|
|
1802
|
+
async getBigUint64(offset) {
|
|
1803
|
+
return this.file.getBigUint64(toNumber(offset), true);
|
|
1804
|
+
}
|
|
1805
|
+
async slice(startOffset, endOffset) {
|
|
1806
|
+
return this.file.buffer.slice(toNumber(startOffset), toNumber(endOffset));
|
|
1807
|
+
}
|
|
1808
|
+
get length() {
|
|
1809
|
+
return BigInt(this.file.byteLength);
|
|
1810
|
+
}
|
|
1811
|
+
};
|
|
1812
|
+
}
|
|
1813
|
+
});
|
|
1814
|
+
|
|
1777
1815
|
// ../loader-utils/src/index.ts
|
|
1778
1816
|
var init_src2 = __esm({
|
|
1779
1817
|
"../loader-utils/src/index.ts"() {
|
|
@@ -1788,6 +1826,7 @@
|
|
|
1788
1826
|
init_memory_conversion_utils();
|
|
1789
1827
|
init_promisify();
|
|
1790
1828
|
init_path();
|
|
1829
|
+
init_data_view_file();
|
|
1791
1830
|
}
|
|
1792
1831
|
});
|
|
1793
1832
|
|
|
@@ -7781,7 +7820,7 @@
|
|
|
7781
7820
|
var init_draco_module_loader = __esm({
|
|
7782
7821
|
"../draco/src/lib/draco-module-loader.ts"() {
|
|
7783
7822
|
init_src();
|
|
7784
|
-
DRACO_DECODER_VERSION = "1.5.
|
|
7823
|
+
DRACO_DECODER_VERSION = "1.5.6";
|
|
7785
7824
|
DRACO_ENCODER_VERSION = "1.4.1";
|
|
7786
7825
|
STATIC_DECODER_URL = `https://www.gstatic.com/draco/versioned/decoders/${DRACO_DECODER_VERSION}`;
|
|
7787
7826
|
DRACO_EXTERNAL_LIBRARIES = {
|
|
@@ -8796,18 +8835,12 @@
|
|
|
8796
8835
|
});
|
|
8797
8836
|
|
|
8798
8837
|
// ../textures/src/compressed-texture-loader.ts
|
|
8799
|
-
var
|
|
8838
|
+
var CompressedTextureWorkerLoader, CompressedTextureLoader;
|
|
8800
8839
|
var init_compressed_texture_loader = __esm({
|
|
8801
8840
|
"../textures/src/compressed-texture-loader.ts"() {
|
|
8802
8841
|
init_version4();
|
|
8803
8842
|
init_parse_compressed_texture();
|
|
8804
8843
|
init_parse_basis();
|
|
8805
|
-
DEFAULT_TEXTURE_LOADER_OPTIONS = {
|
|
8806
|
-
"compressed-texture": {
|
|
8807
|
-
libraryPath: "libs/",
|
|
8808
|
-
useBasis: false
|
|
8809
|
-
}
|
|
8810
|
-
};
|
|
8811
8844
|
CompressedTextureWorkerLoader = {
|
|
8812
8845
|
name: "Texture Containers",
|
|
8813
8846
|
id: "compressed-texture",
|
|
@@ -8828,12 +8861,17 @@
|
|
|
8828
8861
|
"application/octet-stream"
|
|
8829
8862
|
],
|
|
8830
8863
|
binary: true,
|
|
8831
|
-
options:
|
|
8864
|
+
options: {
|
|
8865
|
+
"compressed-texture": {
|
|
8866
|
+
libraryPath: "libs/",
|
|
8867
|
+
useBasis: false
|
|
8868
|
+
}
|
|
8869
|
+
}
|
|
8832
8870
|
};
|
|
8833
8871
|
CompressedTextureLoader = {
|
|
8834
8872
|
...CompressedTextureWorkerLoader,
|
|
8835
8873
|
parse: async (arrayBuffer, options) => {
|
|
8836
|
-
if (options["compressed-texture"]
|
|
8874
|
+
if (options?.["compressed-texture"]?.useBasis) {
|
|
8837
8875
|
options.basis = {
|
|
8838
8876
|
format: {
|
|
8839
8877
|
alpha: "BC3",
|
|
@@ -8843,7 +8881,8 @@
|
|
|
8843
8881
|
containerFormat: "ktx2",
|
|
8844
8882
|
module: "encoder"
|
|
8845
8883
|
};
|
|
8846
|
-
|
|
8884
|
+
const result = await parseBasis(arrayBuffer, options);
|
|
8885
|
+
return result[0];
|
|
8847
8886
|
}
|
|
8848
8887
|
return parseCompressedTexture(arrayBuffer);
|
|
8849
8888
|
}
|
|
@@ -10173,7 +10212,9 @@
|
|
|
10173
10212
|
mimeTypes: ["application/json"],
|
|
10174
10213
|
parse: parseNodePage,
|
|
10175
10214
|
extensions: ["json"],
|
|
10176
|
-
options: {
|
|
10215
|
+
options: {
|
|
10216
|
+
i3s: {}
|
|
10217
|
+
}
|
|
10177
10218
|
};
|
|
10178
10219
|
}
|
|
10179
10220
|
});
|
|
@@ -10545,44 +10586,6 @@
|
|
|
10545
10586
|
}
|
|
10546
10587
|
});
|
|
10547
10588
|
|
|
10548
|
-
// ../zip/src/file-provider/data-view-file.ts
|
|
10549
|
-
var toNumber, DataViewFile;
|
|
10550
|
-
var init_data_view_file = __esm({
|
|
10551
|
-
"../zip/src/file-provider/data-view-file.ts"() {
|
|
10552
|
-
toNumber = (bigint) => {
|
|
10553
|
-
if (bigint > Number.MAX_SAFE_INTEGER) {
|
|
10554
|
-
throw new Error("Offset is out of bounds");
|
|
10555
|
-
}
|
|
10556
|
-
return Number(bigint);
|
|
10557
|
-
};
|
|
10558
|
-
DataViewFile = class {
|
|
10559
|
-
constructor(file) {
|
|
10560
|
-
this.file = file;
|
|
10561
|
-
}
|
|
10562
|
-
async destroy() {
|
|
10563
|
-
}
|
|
10564
|
-
async getUint8(offset) {
|
|
10565
|
-
return this.file.getUint8(toNumber(offset));
|
|
10566
|
-
}
|
|
10567
|
-
async getUint16(offset) {
|
|
10568
|
-
return this.file.getUint16(toNumber(offset), true);
|
|
10569
|
-
}
|
|
10570
|
-
async getUint32(offset) {
|
|
10571
|
-
return this.file.getUint32(toNumber(offset), true);
|
|
10572
|
-
}
|
|
10573
|
-
async getBigUint64(offset) {
|
|
10574
|
-
return this.file.getBigUint64(toNumber(offset), true);
|
|
10575
|
-
}
|
|
10576
|
-
async slice(startOffset, endOffset) {
|
|
10577
|
-
return this.file.buffer.slice(toNumber(startOffset), toNumber(endOffset));
|
|
10578
|
-
}
|
|
10579
|
-
get length() {
|
|
10580
|
-
return BigInt(this.file.byteLength);
|
|
10581
|
-
}
|
|
10582
|
-
};
|
|
10583
|
-
}
|
|
10584
|
-
});
|
|
10585
|
-
|
|
10586
10589
|
// ../zip/src/parse-zip/search-from-the-end.ts
|
|
10587
10590
|
var searchFromTheEnd;
|
|
10588
10591
|
var init_search_from_the_end = __esm({
|
|
@@ -15343,7 +15346,6 @@
|
|
|
15343
15346
|
// ../zip/src/index.ts
|
|
15344
15347
|
var init_src10 = __esm({
|
|
15345
15348
|
"../zip/src/index.ts"() {
|
|
15346
|
-
init_data_view_file();
|
|
15347
15349
|
init_cd_file_header();
|
|
15348
15350
|
init_local_file_header();
|
|
15349
15351
|
init_search_from_the_end();
|
|
@@ -15496,7 +15498,7 @@
|
|
|
15496
15498
|
var VERSION12, SLPKLoader;
|
|
15497
15499
|
var init_i3s_slpk_loader = __esm({
|
|
15498
15500
|
"src/i3s-slpk-loader.ts"() {
|
|
15499
|
-
|
|
15501
|
+
init_src2();
|
|
15500
15502
|
init_parse_slpk();
|
|
15501
15503
|
VERSION12 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
15502
15504
|
SLPKLoader = {
|
|
@@ -15646,12 +15648,12 @@
|
|
|
15646
15648
|
async function parse5(data) {
|
|
15647
15649
|
return parseWebscene(data);
|
|
15648
15650
|
}
|
|
15649
|
-
var VERSION14,
|
|
15651
|
+
var VERSION14, ArcGISWebSceneLoader;
|
|
15650
15652
|
var init_arcgis_webscene_loader = __esm({
|
|
15651
15653
|
"src/arcgis-webscene-loader.ts"() {
|
|
15652
15654
|
init_parse_arcgis_webscene();
|
|
15653
15655
|
VERSION14 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
|
|
15654
|
-
|
|
15656
|
+
ArcGISWebSceneLoader = {
|
|
15655
15657
|
name: "ArcGIS Web Scene Loader",
|
|
15656
15658
|
id: "arcgis-web-scene",
|
|
15657
15659
|
module: "i3s",
|
|
@@ -15667,7 +15669,7 @@
|
|
|
15667
15669
|
// src/index.ts
|
|
15668
15670
|
var src_exports = {};
|
|
15669
15671
|
__export(src_exports, {
|
|
15670
|
-
|
|
15672
|
+
ArcGISWebSceneLoader: () => ArcGISWebSceneLoader,
|
|
15671
15673
|
COORDINATE_SYSTEM: () => COORDINATE_SYSTEM,
|
|
15672
15674
|
I3SAttributeLoader: () => I3SAttributeLoader,
|
|
15673
15675
|
I3SBuildingSceneLayerLoader: () => I3SBuildingSceneLayerLoader,
|
|
@@ -4,12 +4,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.ArcGISWebSceneLoader = void 0;
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _parseArcgisWebscene = require("./lib/parsers/parse-arcgis-webscene");
|
|
11
|
-
var VERSION = typeof "4.0.0-alpha.
|
|
12
|
-
var
|
|
11
|
+
var VERSION = typeof "4.0.0-alpha.24" !== 'undefined' ? "4.0.0-alpha.24" : 'beta';
|
|
12
|
+
var ArcGISWebSceneLoader = {
|
|
13
13
|
name: 'ArcGIS Web Scene Loader',
|
|
14
14
|
id: 'arcgis-web-scene',
|
|
15
15
|
module: 'i3s',
|
|
@@ -19,7 +19,7 @@ var ArcGisWebSceneLoader = {
|
|
|
19
19
|
extensions: ['json'],
|
|
20
20
|
options: {}
|
|
21
21
|
};
|
|
22
|
-
exports.
|
|
22
|
+
exports.ArcGISWebSceneLoader = ArcGISWebSceneLoader;
|
|
23
23
|
function parse(_x) {
|
|
24
24
|
return _parse.apply(this, arguments);
|
|
25
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arcgis-webscene-loader.js","names":["_parseArcgisWebscene","require","VERSION","
|
|
1
|
+
{"version":3,"file":"arcgis-webscene-loader.js","names":["_parseArcgisWebscene","require","VERSION","ArcGISWebSceneLoader","name","id","module","version","mimeTypes","parse","extensions","options","exports","_x","_parse","apply","arguments","_asyncToGenerator2","default","_regenerator","mark","_callee","data","wrap","_callee$","_context","prev","next","abrupt","parseWebscene","stop"],"sources":["../../src/arcgis-webscene-loader.ts"],"sourcesContent":["import type {LoaderOptions, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {ArcGISWebSceneData} from './types';\n\nimport {parseWebscene} from './lib/parsers/parse-arcgis-webscene';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'beta';\n\nexport type ArcGISWebSceneLoaderOptions = LoaderOptions & {};\n\n/**\n * Loader for ArcGIS WebScene\n * Spec - https://developers.arcgis.com/web-scene-specification/objects/webscene/\n */\nexport const ArcGISWebSceneLoader: LoaderWithParser<\n ArcGISWebSceneData,\n never,\n ArcGISWebSceneLoaderOptions\n> = {\n name: 'ArcGIS Web Scene Loader',\n id: 'arcgis-web-scene',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/json'],\n parse,\n extensions: ['json'],\n options: {}\n};\n\n/**\n * Parse ArcGIS webscene\n * @param data\n */\nasync function parse(data: ArrayBuffer): Promise<ArcGISWebSceneData> {\n return parseWebscene(data);\n}\n"],"mappings":";;;;;;;;;AAGA,IAAAA,oBAAA,GAAAC,OAAA;AAIA,IAAMC,OAAO,GAAG,uBAAkB,KAAK,WAAW,sBAAiB,MAAM;AAQlE,IAAMC,oBAIZ,GAAG;EACFC,IAAI,EAAE,yBAAyB;EAC/BC,EAAE,EAAE,kBAAkB;EACtBC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEL,OAAO;EAChBM,SAAS,EAAE,CAAC,kBAAkB,CAAC;EAC/BC,KAAK,EAALA,KAAK;EACLC,UAAU,EAAE,CAAC,MAAM,CAAC;EACpBC,OAAO,EAAE,CAAC;AACZ,CAAC;AAACC,OAAA,CAAAT,oBAAA,GAAAA,oBAAA;AAAA,SAMaM,KAAKA,CAAAI,EAAA;EAAA,OAAAC,MAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA;AAAA,SAAAF,OAAA;EAAAA,MAAA,OAAAG,kBAAA,CAAAC,OAAA,EAAAC,YAAA,CAAAD,OAAA,CAAAE,IAAA,CAApB,SAAAC,QAAqBC,IAAiB;IAAA,OAAAH,YAAA,CAAAD,OAAA,CAAAK,IAAA,UAAAC,SAAAC,QAAA;MAAA,kBAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;QAAA;UAAA,OAAAF,QAAA,CAAAG,MAAA,WAC7B,IAAAC,kCAAa,EAACP,IAAI,CAAC;QAAA;QAAA;UAAA,OAAAG,QAAA,CAAAK,IAAA;MAAA;IAAA,GAAAT,OAAA;EAAA,CAC3B;EAAA,OAAAP,MAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA"}
|
|
@@ -15,7 +15,7 @@ var _parseI3sAttribute = require("./lib/parsers/parse-i3s-attribute");
|
|
|
15
15
|
var _urlUtils = require("./lib/utils/url-utils");
|
|
16
16
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
17
17
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
18
|
-
var VERSION = typeof "4.0.0-alpha.
|
|
18
|
+
var VERSION = typeof "4.0.0-alpha.24" !== 'undefined' ? "4.0.0-alpha.24" : 'latest';
|
|
19
19
|
var EMPTY_VALUE = '';
|
|
20
20
|
var REJECTED_STATUS = 'rejected';
|
|
21
21
|
var I3SAttributeLoader = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i3s-attribute-loader.js","names":["_core","require","_parseI3sAttribute","_urlUtils","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty2","default","getOwnPropertyDescriptors","defineProperties","defineProperty","VERSION","EMPTY_VALUE","REJECTED_STATUS","I3SAttributeLoader","name","id","module","version","mimeTypes","parse","_parse","_asyncToGenerator2","_regenerator","mark","_callee","arrayBuffer","options","wrap","_callee$","_context","prev","next","abrupt","parseI3STileAttribute","stop","_x","_x2","extensions","binary","exports","loadFeatureAttributes","_x3","_x4","_loadFeatureAttributes","_callee2","tile","featureId","_getAttributesData","attributeStorageInfo","attributeUrls","tilesetFields","attributes","attributeLoadPromises","index","_options$i3s","url","attributeName","attributeType","loadOptions","promise","_args2","_callee2$","_context2","undefined","getAttributesData","getUrlWithToken","i3s","token","getAttributeValueType","load","Promise","allSettled","sent","t0","generateAttributesByFeatureId","_tile$tileset","_tile$tileset$tileset","_tile$header","_tile$tileset2","_tile$tileset2$tilese","tileset","header","fields","attribute","hasOwnProperty","attributeValues","valueType","getFeatureIdsAttributeName","objectIdsAttribute","find","includes","objectIdsAttributeName","objectIds","value","attributeIndex","indexOf","getFeatureAttributesByIndex","featureIdIndex","attributesObject","codedValues","getAttributeCodedValues","getAttributeByIndexAndAttributeName","formatAttributeValue","_attributeField$domai","attributeField","field","alias","domain","attributesName","attributeObject","status","String","replace","trim","codeValue","codedValue","code","Number"],"sources":["../../src/i3s-attribute-loader.ts"],"sourcesContent":["import type {LoaderOptions, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {load} from '@loaders.gl/core';\nimport type {I3STileAttributes} from './lib/parsers/parse-i3s-attribute';\nimport {parseI3STileAttribute} from './lib/parsers/parse-i3s-attribute';\nimport {getUrlWithToken} from './lib/utils/url-utils';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\nconst EMPTY_VALUE = '';\nconst REJECTED_STATUS = 'rejected';\n\n/**\n * Loader for I3S attributes\n */\nexport const I3SAttributeLoader: LoaderWithParser<I3STileAttributes, never, LoaderOptions> = {\n name: 'I3S Attribute',\n id: 'i3s-attribute',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/binary'],\n parse: async (arrayBuffer: ArrayBuffer, options?: LoaderOptions) => parseI3STileAttribute(arrayBuffer, options),\n extensions: ['bin'],\n options: {},\n binary: true\n};\n\n\n// TODO - these seem to use the loader rather than being part of the loader. Move to different file...\n\n/**\n * Load attributes based on feature id\n * @param {Object} tile\n * @param {number} featureId\n * @param {Object} options\n * @returns {Promise}\n */\n// eslint-disable-next-line complexity\nexport async function loadFeatureAttributes(tile, featureId, options = {}) {\n const {attributeStorageInfo, attributeUrls, tilesetFields} = getAttributesData(tile);\n\n if (!attributeStorageInfo || !attributeUrls || featureId < 0) {\n return null;\n }\n\n let attributes: object[] = [];\n const attributeLoadPromises: Promise<object>[] = [];\n\n for (let index = 0; index < attributeStorageInfo.length; index++) {\n // @ts-ignore\n const url = getUrlWithToken(attributeUrls[index], options.i3s?.token);\n const attributeName = attributeStorageInfo[index].name;\n const attributeType = getAttributeValueType(attributeStorageInfo[index]);\n const loadOptions = {...options, attributeName, attributeType};\n const promise = load(url, I3SAttributeLoader, loadOptions);\n\n attributeLoadPromises.push(promise);\n }\n try {\n attributes = await Promise.allSettled(attributeLoadPromises);\n } catch (error) {\n // do nothing\n }\n\n if (!attributes.length) {\n return null;\n }\n\n return generateAttributesByFeatureId(attributes, attributeStorageInfo, featureId, tilesetFields);\n}\n\n/**\n * Gets attributes data from tile.\n * @param tile \n * @returns \n */\nfunction getAttributesData(tile) {\n const attributeStorageInfo = tile.tileset?.tileset?.attributeStorageInfo;\n const attributeUrls = tile.header?.attributeUrls;\n const tilesetFields = tile.tileset?.tileset?.fields || [];\n\n return {attributeStorageInfo, attributeUrls, tilesetFields};\n}\n\n/**\n * Get attribute value type based on property names\n * @param {Object} attribute\n * @returns {String}\n */\nexport function getAttributeValueType(attribute) {\n if (attribute.hasOwnProperty('objectIds')) {\n return 'Oid32';\n } else if (attribute.hasOwnProperty('attributeValues')) {\n return attribute.attributeValues.valueType;\n }\n return '';\n}\n\n/**\n * Find in attributeStorageInfo attribute name responsible for feature ids list.\n * @param attributeStorageInfo \n * @returns Feature ids attribute name\n */\nfunction getFeatureIdsAttributeName(attributeStorageInfo) {\n const objectIdsAttribute = attributeStorageInfo.find(attribute => attribute.name.includes('OBJECTID'));\n\n return objectIdsAttribute?.name;\n}\n\n/**\n * Generates mapping featureId to feature attributes\n * @param {Array} attributes\n * @param {Object} attributeStorageInfo\n * @param {number} featureId\n * @returns {Object}\n */\nfunction generateAttributesByFeatureId(attributes, attributeStorageInfo, featureId, tilesetFields) {\n const objectIdsAttributeName = getFeatureIdsAttributeName(attributeStorageInfo);\n const objectIds = attributes.find((attribute) => attribute.value[objectIdsAttributeName]);\n\n if (!objectIds) {\n return null;\n }\n\n const attributeIndex = objectIds.value[objectIdsAttributeName].indexOf(featureId);\n\n if (attributeIndex < 0) {\n return null;\n }\n\n return getFeatureAttributesByIndex(attributes, attributeIndex, attributeStorageInfo, tilesetFields);\n}\n\n/**\n * Generates attribute object for feature mapping by feature id\n * @param {Array} attributes\n * @param {Number} featureIdIndex\n * @param {Object} attributeStorageInfo\n * @returns {Object}\n */\nfunction getFeatureAttributesByIndex(attributes, featureIdIndex, attributeStorageInfo, tilesetFields) {\n const attributesObject = {};\n\n for (let index = 0; index < attributeStorageInfo.length; index++) {\n const attributeName = attributeStorageInfo[index].name;\n const codedValues = getAttributeCodedValues(attributeName, tilesetFields);\n const attribute = getAttributeByIndexAndAttributeName(attributes, index, attributeName);\n attributesObject[attributeName] = formatAttributeValue(attribute, featureIdIndex, codedValues);\n }\n\n return attributesObject;\n}\n\n/**\n * Get coded values list from tileset.\n * @param attributeName \n * @param tilesetFields \n */\nfunction getAttributeCodedValues(attributeName, tilesetFields) {\n const attributeField = tilesetFields\n .find(field => field.name === attributeName || field.alias === attributeName);\n\n return attributeField?.domain?.codedValues || [];\n}\n\n/**\n * Return attribute value if it presents in atrributes list\n * @param {array} attributes\n * @param {number} index\n * @param {string} attributesName\n */\nfunction getAttributeByIndexAndAttributeName(attributes, index, attributesName) {\n const attributeObject = attributes[index];\n\n if (attributeObject.status === REJECTED_STATUS) {\n return null;\n }\n\n return attributeObject.value[attributesName];\n}\n\n/**\n * Do formatting of attribute values or return empty string.\n * @param {Array} attribute\n * @param {Number} featureIdIndex\n * @returns {String}\n */\nfunction formatAttributeValue(attribute, featureIdIndex, codedValues) {\n let value = EMPTY_VALUE;\n\n if (attribute && (featureIdIndex in attribute)) {\n // eslint-disable-next-line no-control-regex\n value = String(attribute[featureIdIndex]).replace(/\\u0000|NaN/g, '').trim();\n }\n\n // Check if coded values are existed. If so we use them.\n if (codedValues.length) {\n const codeValue = codedValues.find(codedValue => codedValue.code === Number(value));\n value = codeValue?.name || EMPTY_VALUE;\n }\n\n return value;\n}\n"],"mappings":";;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,kBAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAAsD,SAAAG,QAAAC,MAAA,EAAAC,cAAA,QAAAC,IAAA,GAAAC,MAAA,CAAAD,IAAA,CAAAF,MAAA,OAAAG,MAAA,CAAAC,qBAAA,QAAAC,OAAA,GAAAF,MAAA,CAAAC,qBAAA,CAAAJ,MAAA,GAAAC,cAAA,KAAAI,OAAA,GAAAA,OAAA,CAAAC,MAAA,WAAAC,GAAA,WAAAJ,MAAA,CAAAK,wBAAA,CAAAR,MAAA,EAAAO,GAAA,EAAAE,UAAA,OAAAP,IAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,IAAA,EAAAG,OAAA,YAAAH,IAAA;AAAA,SAAAU,cAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,WAAAF,SAAA,CAAAD,CAAA,IAAAC,SAAA,CAAAD,CAAA,QAAAA,CAAA,OAAAf,OAAA,CAAAI,MAAA,CAAAc,MAAA,OAAAC,OAAA,WAAAC,GAAA,QAAAC,gBAAA,CAAAC,OAAA,EAAAR,MAAA,EAAAM,GAAA,EAAAF,MAAA,CAAAE,GAAA,SAAAhB,MAAA,CAAAmB,yBAAA,GAAAnB,MAAA,CAAAoB,gBAAA,CAAAV,MAAA,EAAAV,MAAA,CAAAmB,yBAAA,CAAAL,MAAA,KAAAlB,OAAA,CAAAI,MAAA,CAAAc,MAAA,GAAAC,OAAA,WAAAC,GAAA,IAA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E,OAAO,CAAAgD,cAAc,aAAdA,cAAc,wBAAAD,qBAAA,GAAdC,cAAc,CAAEG,MAAM,cAAAJ,qBAAA,uBAAtBA,qBAAA,CAAwBJ,WAAW,KAAI,EAAE;AAClD;AAQA,SAASE,mCAAmCA,CAAClD,UAAU,EAAEE,KAAK,EAAEuD,cAAc,EAAE;EAC9E,IAAMC,eAAe,GAAG1D,UAAU,CAACE,KAAK,CAAC;EAEzC,IAAIwD,eAAe,CAACC,MAAM,KAAKlG,eAAe,EAAE;IAC9C,OAAO,IAAI;EACb;EAEA,OAAOiG,eAAe,CAAChB,KAAK,CAACe,cAAc,CAAC;AAC9C;AAQA,SAASN,oBAAoBA,CAACnB,SAAS,EAAEc,cAAc,EAAEE,WAAW,EAAE;EACpE,IAAIN,KAAK,GAAGlF,WAAW;EAEvB,IAAIwE,SAAS,IAAKc,cAAc,IAAId,SAAU,EAAE;IAE9CU,KAAK,GAAGkB,MAAM,CAAC5B,SAAS,CAACc,cAAc,CAAC,CAAC,CAACe,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAACC,IAAI,CAAC,CAAC;EAC7E;EAGA,IAAId,WAAW,CAAClG,MAAM,EAAE;IACtB,IAAMiH,SAAS,GAAGf,WAAW,CAACV,IAAI,CAAC,UAAA0B,UAAU;MAAA,OAAIA,UAAU,CAACC,IAAI,KAAKC,MAAM,CAACxB,KAAK,CAAC;IAAA,EAAC;IACnFA,KAAK,GAAG,CAAAqB,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAEpG,IAAI,KAAIH,WAAW;EACxC;EAEA,OAAOkF,KAAK;AACd"}
|
|
1
|
+
{"version":3,"file":"i3s-attribute-loader.js","names":["_core","require","_parseI3sAttribute","_urlUtils","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty2","default","getOwnPropertyDescriptors","defineProperties","defineProperty","VERSION","EMPTY_VALUE","REJECTED_STATUS","I3SAttributeLoader","name","id","module","version","mimeTypes","parse","_parse","_asyncToGenerator2","_regenerator","mark","_callee","arrayBuffer","options","wrap","_callee$","_context","prev","next","abrupt","parseI3STileAttribute","stop","_x","_x2","extensions","binary","exports","loadFeatureAttributes","_x3","_x4","_loadFeatureAttributes","_callee2","tile","featureId","_getAttributesData","attributeStorageInfo","attributeUrls","tilesetFields","attributes","attributeLoadPromises","index","_options$i3s","url","attributeName","attributeType","loadOptions","promise","_args2","_callee2$","_context2","undefined","getAttributesData","getUrlWithToken","i3s","token","getAttributeValueType","load","Promise","allSettled","sent","t0","generateAttributesByFeatureId","_tile$tileset","_tile$tileset$tileset","_tile$header","_tile$tileset2","_tile$tileset2$tilese","tileset","header","fields","attribute","hasOwnProperty","attributeValues","valueType","getFeatureIdsAttributeName","objectIdsAttribute","find","includes","objectIdsAttributeName","objectIds","value","attributeIndex","indexOf","getFeatureAttributesByIndex","featureIdIndex","attributesObject","codedValues","getAttributeCodedValues","getAttributeByIndexAndAttributeName","formatAttributeValue","_attributeField$domai","attributeField","field","alias","domain","attributesName","attributeObject","status","String","replace","trim","codeValue","codedValue","code","Number"],"sources":["../../src/i3s-attribute-loader.ts"],"sourcesContent":["import type {LoaderOptions, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {load} from '@loaders.gl/core';\nimport type {I3SLoaderOptions} from './i3s-loader';\nimport type {I3STileAttributes} from './lib/parsers/parse-i3s-attribute';\nimport {parseI3STileAttribute} from './lib/parsers/parse-i3s-attribute';\nimport {getUrlWithToken} from './lib/utils/url-utils';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\nconst EMPTY_VALUE = '';\nconst REJECTED_STATUS = 'rejected';\n\n/**\n * Loader for I3S attributes\n */\nexport const I3SAttributeLoader: LoaderWithParser<I3STileAttributes, never, I3SLoaderOptions> = {\n name: 'I3S Attribute',\n id: 'i3s-attribute',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/binary'],\n parse: async (arrayBuffer: ArrayBuffer, options?: LoaderOptions) => parseI3STileAttribute(arrayBuffer, options),\n extensions: ['bin'],\n options: {},\n binary: true\n};\n\n\n// TODO - these seem to use the loader rather than being part of the loader. Move to different file...\n\n/**\n * Load attributes based on feature id\n * @param {Object} tile\n * @param {number} featureId\n * @param {Object} options\n * @returns {Promise}\n */\n// eslint-disable-next-line complexity\nexport async function loadFeatureAttributes(tile, featureId, options = {}) {\n const {attributeStorageInfo, attributeUrls, tilesetFields} = getAttributesData(tile);\n\n if (!attributeStorageInfo || !attributeUrls || featureId < 0) {\n return null;\n }\n\n let attributes: object[] = [];\n const attributeLoadPromises: Promise<object>[] = [];\n\n for (let index = 0; index < attributeStorageInfo.length; index++) {\n // @ts-ignore\n const url = getUrlWithToken(attributeUrls[index], options.i3s?.token);\n const attributeName = attributeStorageInfo[index].name;\n const attributeType = getAttributeValueType(attributeStorageInfo[index]);\n const loadOptions = {...options, attributeName, attributeType};\n const promise = load(url, I3SAttributeLoader, loadOptions);\n\n attributeLoadPromises.push(promise);\n }\n try {\n attributes = await Promise.allSettled(attributeLoadPromises);\n } catch (error) {\n // do nothing\n }\n\n if (!attributes.length) {\n return null;\n }\n\n return generateAttributesByFeatureId(attributes, attributeStorageInfo, featureId, tilesetFields);\n}\n\n/**\n * Gets attributes data from tile.\n * @param tile \n * @returns \n */\nfunction getAttributesData(tile) {\n const attributeStorageInfo = tile.tileset?.tileset?.attributeStorageInfo;\n const attributeUrls = tile.header?.attributeUrls;\n const tilesetFields = tile.tileset?.tileset?.fields || [];\n\n return {attributeStorageInfo, attributeUrls, tilesetFields};\n}\n\n/**\n * Get attribute value type based on property names\n * @param {Object} attribute\n * @returns {String}\n */\nexport function getAttributeValueType(attribute) {\n if (attribute.hasOwnProperty('objectIds')) {\n return 'Oid32';\n } else if (attribute.hasOwnProperty('attributeValues')) {\n return attribute.attributeValues.valueType;\n }\n return '';\n}\n\n/**\n * Find in attributeStorageInfo attribute name responsible for feature ids list.\n * @param attributeStorageInfo \n * @returns Feature ids attribute name\n */\nfunction getFeatureIdsAttributeName(attributeStorageInfo) {\n const objectIdsAttribute = attributeStorageInfo.find(attribute => attribute.name.includes('OBJECTID'));\n\n return objectIdsAttribute?.name;\n}\n\n/**\n * Generates mapping featureId to feature attributes\n * @param {Array} attributes\n * @param {Object} attributeStorageInfo\n * @param {number} featureId\n * @returns {Object}\n */\nfunction generateAttributesByFeatureId(attributes, attributeStorageInfo, featureId, tilesetFields) {\n const objectIdsAttributeName = getFeatureIdsAttributeName(attributeStorageInfo);\n const objectIds = attributes.find((attribute) => attribute.value[objectIdsAttributeName]);\n\n if (!objectIds) {\n return null;\n }\n\n const attributeIndex = objectIds.value[objectIdsAttributeName].indexOf(featureId);\n\n if (attributeIndex < 0) {\n return null;\n }\n\n return getFeatureAttributesByIndex(attributes, attributeIndex, attributeStorageInfo, tilesetFields);\n}\n\n/**\n * Generates attribute object for feature mapping by feature id\n * @param {Array} attributes\n * @param {Number} featureIdIndex\n * @param {Object} attributeStorageInfo\n * @returns {Object}\n */\nfunction getFeatureAttributesByIndex(attributes, featureIdIndex, attributeStorageInfo, tilesetFields) {\n const attributesObject = {};\n\n for (let index = 0; index < attributeStorageInfo.length; index++) {\n const attributeName = attributeStorageInfo[index].name;\n const codedValues = getAttributeCodedValues(attributeName, tilesetFields);\n const attribute = getAttributeByIndexAndAttributeName(attributes, index, attributeName);\n attributesObject[attributeName] = formatAttributeValue(attribute, featureIdIndex, codedValues);\n }\n\n return attributesObject;\n}\n\n/**\n * Get coded values list from tileset.\n * @param attributeName \n * @param tilesetFields \n */\nfunction getAttributeCodedValues(attributeName, tilesetFields) {\n const attributeField = tilesetFields\n .find(field => field.name === attributeName || field.alias === attributeName);\n\n return attributeField?.domain?.codedValues || [];\n}\n\n/**\n * Return attribute value if it presents in atrributes list\n * @param {array} attributes\n * @param {number} index\n * @param {string} attributesName\n */\nfunction getAttributeByIndexAndAttributeName(attributes, index, attributesName) {\n const attributeObject = attributes[index];\n\n if (attributeObject.status === REJECTED_STATUS) {\n return null;\n }\n\n return attributeObject.value[attributesName];\n}\n\n/**\n * Do formatting of attribute values or return empty string.\n * @param {Array} attribute\n * @param {Number} featureIdIndex\n * @returns {String}\n */\nfunction formatAttributeValue(attribute, featureIdIndex, codedValues) {\n let value = EMPTY_VALUE;\n\n if (attribute && (featureIdIndex in attribute)) {\n // eslint-disable-next-line no-control-regex\n value = String(attribute[featureIdIndex]).replace(/\\u0000|NaN/g, '').trim();\n }\n\n // Check if coded values are existed. If so we use them.\n if (codedValues.length) {\n const codeValue = codedValues.find(codedValue => codedValue.code === Number(value));\n value = codeValue?.name || EMPTY_VALUE;\n }\n\n return value;\n}\n"],"mappings":";;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,kBAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAAsD,SAAAG,QAAAC,MAAA,EAAAC,cAAA,QAAAC,IAAA,GAAAC,MAAA,CAAAD,IAAA,CAAAF,MAAA,OAAAG,MAAA,CAAAC,qBAAA,QAAAC,OAAA,GAAAF,MAAA,CAAAC,qBAAA,CAAAJ,MAAA,GAAAC,cAAA,KAAAI,OAAA,GAAAA,OAAA,CAAAC,MAAA,WAAAC,GAAA,WAAAJ,MAAA,CAAAK,wBAAA,CAAAR,MAAA,EAAAO,GAAA,EAAAE,UAAA,OAAAP,IAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,IAAA,EAAAG,OAAA,YAAAH,IAAA;AAAA,SAAAU,cAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,WAAAF,SAAA,CAAAD,CAAA,IAAAC,SAAA,CAAAD,CAAA,QAAAA,CAAA,OAAAf,OAAA,CAAAI,MAAA,CAAAc,MAAA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AAEpG,IAAI,KAAIH,WAAW;EACxC;EAEA,OAAOkF,KAAK;AACd"}
|
|
@@ -8,7 +8,7 @@ exports.I3SBuildingSceneLayerLoader = void 0;
|
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _parseI3sBuildingSceneLayer = require("./lib/parsers/parse-i3s-building-scene-layer");
|
|
11
|
-
var VERSION = typeof "4.0.0-alpha.
|
|
11
|
+
var VERSION = typeof "4.0.0-alpha.24" !== 'undefined' ? "4.0.0-alpha.24" : 'beta';
|
|
12
12
|
var I3SBuildingSceneLayerLoader = {
|
|
13
13
|
name: 'I3S Building Scene Layer',
|
|
14
14
|
id: 'i3s-building-scene-layer',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i3s-building-scene-layer-loader.js","names":["_parseI3sBuildingSceneLayer","require","VERSION","I3SBuildingSceneLayerLoader","name","id","module","version","mimeTypes","parse","extensions","options","exports","_x","_x2","_x3","_parse","apply","arguments","_asyncToGenerator2","default","_regenerator","mark","_callee","data","context","wrap","_callee$","_context","prev","next","url","Error","abrupt","parseBuildingSceneLayer","stop"],"sources":["../../src/i3s-building-scene-layer-loader.ts"],"sourcesContent":["import type {LoaderWithParser, LoaderOptions, LoaderContext} from '@loaders.gl/loader-utils';\nimport type {BuildingSceneLayerTileset} from './types';\n\nimport {parseBuildingSceneLayer} from './lib/parsers/parse-i3s-building-scene-layer';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\n\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'beta';\n/**\n * Loader for I3S - Building Scene Layer\n */\nexport const I3SBuildingSceneLayerLoader: LoaderWithParser = {\n name: 'I3S Building Scene Layer',\n id: 'i3s-building-scene-layer',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/json'],\n parse,\n extensions: ['json'],\n options: {}\n};\n\nasync function parse(\n data: ArrayBuffer,\n options?: LoaderOptions,\n context?: LoaderContext\n): Promise<BuildingSceneLayerTileset> {\n if (!context?.url) {\n throw new Error('Url is not provided');\n }\n\n return parseBuildingSceneLayer(data, context.url);\n}\n"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"i3s-building-scene-layer-loader.js","names":["_parseI3sBuildingSceneLayer","require","VERSION","I3SBuildingSceneLayerLoader","name","id","module","version","mimeTypes","parse","extensions","options","exports","_x","_x2","_x3","_parse","apply","arguments","_asyncToGenerator2","default","_regenerator","mark","_callee","data","context","wrap","_callee$","_context","prev","next","url","Error","abrupt","parseBuildingSceneLayer","stop"],"sources":["../../src/i3s-building-scene-layer-loader.ts"],"sourcesContent":["import type {LoaderWithParser, LoaderOptions, LoaderContext} from '@loaders.gl/loader-utils';\nimport type {I3SLoaderOptions} from './i3s-loader';\nimport type {BuildingSceneLayerTileset} from './types';\n\nimport {parseBuildingSceneLayer} from './lib/parsers/parse-i3s-building-scene-layer';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\n\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'beta';\n/**\n * Loader for I3S - Building Scene Layer\n */\nexport const I3SBuildingSceneLayerLoader: LoaderWithParser<\n BuildingSceneLayerTileset,\n never,\n I3SLoaderOptions\n> = {\n name: 'I3S Building Scene Layer',\n id: 'i3s-building-scene-layer',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/json'],\n parse,\n extensions: ['json'],\n options: {}\n};\n\nasync function parse(\n data: ArrayBuffer,\n options?: LoaderOptions,\n context?: LoaderContext\n): Promise<BuildingSceneLayerTileset> {\n if (!context?.url) {\n throw new Error('Url is not provided');\n }\n\n return parseBuildingSceneLayer(data, context.url);\n}\n"],"mappings":";;;;;;;;;AAIA,IAAAA,2BAAA,GAAAC,OAAA;AAKA,IAAM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@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _parseI3sTileContent = require("./lib/parsers/parse-i3s-tile-content");
|
|
11
|
-
var VERSION = typeof "4.0.0-alpha.
|
|
11
|
+
var VERSION = typeof "4.0.0-alpha.24" !== 'undefined' ? "4.0.0-alpha.24" : 'beta';
|
|
12
12
|
var I3SContentLoader = {
|
|
13
13
|
name: 'I3S Content (Indexed Scene Layers)',
|
|
14
14
|
id: 'i3s-content',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i3s-content-loader.js","names":["_parseI3sTileContent","require","VERSION","I3SContentLoader","name","id","module","worker","version","mimeTypes","parse","extensions","options","exports","_x","_x2","_x3","_parse","apply","arguments","_asyncToGenerator2","default","_regenerator","mark","_callee","data","context","_ref","tile","_tileOptions","tileset","_tilesetOptions","tileOptions","tilesetOptions","wrap","_callee$","_context","prev","next","i3s","abrupt","parseI3STileContent","sent","stop"],"sources":["../../src/i3s-content-loader.ts"],"sourcesContent":["import type {LoaderWithParser, LoaderContext} from '@loaders.gl/loader-utils';\nimport type {I3SLoaderOptions} from './i3s-loader';\nimport {parseI3STileContent} from './lib/parsers/parse-i3s-tile-content';\nimport {I3STileOptions, I3STilesetOptions} from './types';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\n\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'beta';\n/**\n * Loader for I3S - Indexed 3D Scene Layer\n */\nexport const I3SContentLoader: LoaderWithParser = {\n name: 'I3S Content (Indexed Scene Layers)',\n id: 'i3s-content',\n module: 'i3s',\n worker: true,\n version: VERSION,\n mimeTypes: ['application/octet-stream'],\n parse,\n extensions: ['bin'],\n options: {\n 'i3s-content': {}\n }\n};\n\nasync function parse(data, options?: I3SLoaderOptions, context?: LoaderContext) {\n const {tile, _tileOptions, tileset, _tilesetOptions} = options?.i3s || {};\n const tileOptions = _tileOptions || tile;\n const tilesetOptions = _tilesetOptions || tileset;\n if (!tileOptions || !tilesetOptions) {\n return null;\n }\n return await parseI3STileContent(\n data,\n tileOptions as I3STileOptions,\n tilesetOptions as I3STilesetOptions,\n options,\n context\n );\n}\n"],"mappings":";;;;;;;;;AAEA,IAAAA,oBAAA,GAAAC,OAAA;AAMA,IAAMC,OAAO,GAAG,uBAAkB,KAAK,WAAW,sBAAiB,MAAM;
|
|
1
|
+
{"version":3,"file":"i3s-content-loader.js","names":["_parseI3sTileContent","require","VERSION","I3SContentLoader","name","id","module","worker","version","mimeTypes","parse","extensions","options","exports","_x","_x2","_x3","_parse","apply","arguments","_asyncToGenerator2","default","_regenerator","mark","_callee","data","context","_ref","tile","_tileOptions","tileset","_tilesetOptions","tileOptions","tilesetOptions","wrap","_callee$","_context","prev","next","i3s","abrupt","parseI3STileContent","sent","stop"],"sources":["../../src/i3s-content-loader.ts"],"sourcesContent":["import type {LoaderWithParser, LoaderContext} from '@loaders.gl/loader-utils';\nimport type {I3SLoaderOptions} from './i3s-loader';\nimport {parseI3STileContent} from './lib/parsers/parse-i3s-tile-content';\nimport {I3STileContent, I3STileOptions, I3STilesetOptions} from './types';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\n\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'beta';\n\n/**\n * Loader for I3S - Indexed 3D Scene Layer\n */\nexport const I3SContentLoader: LoaderWithParser<I3STileContent | null, never, I3SLoaderOptions> = {\n name: 'I3S Content (Indexed Scene Layers)',\n id: 'i3s-content',\n module: 'i3s',\n worker: true,\n version: VERSION,\n mimeTypes: ['application/octet-stream'],\n parse,\n extensions: ['bin'],\n options: {\n 'i3s-content': {}\n }\n};\n\nasync function parse(data, options?: I3SLoaderOptions, context?: LoaderContext) {\n const {tile, _tileOptions, tileset, _tilesetOptions} = options?.i3s || {};\n const tileOptions = _tileOptions || tile;\n const tilesetOptions = _tilesetOptions || tileset;\n if (!tileOptions || !tilesetOptions) {\n return null;\n }\n return await parseI3STileContent(\n data,\n tileOptions as I3STileOptions,\n tilesetOptions as I3STilesetOptions,\n options,\n context\n );\n}\n"],"mappings":";;;;;;;;;AAEA,IAAAA,oBAAA,GAAAC,OAAA;AAMA,IAAMC,OAAO,GAAG,uBAAkB,KAAK,WAAW,sBAAiB,MAAM;AAKlE,IAAMC,gBAAkF,GAAG;EAChGC,IAAI,EAAE,oCAAoC;EAC1CC,EAAE,EAAE,aAAa;EACjBC,MAAM,EAAE,KAAK;EACbC,MAAM,EAAE,IAAI;EACZC,OAAO,EAAEN,OAAO;EAChBO,SAAS,EAAE,CAAC,0BAA0B,CAAC;EACvCC,KAAK,EAALA,KAAK;EACLC,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBC,OAAO,EAAE;IACP,aAAa,EAAE,CAAC;EAClB;AACF,CAAC;AAACC,OAAA,CAAAV,gBAAA,GAAAA,gBAAA;AAAA,SAEaO,KAAKA,CAAAI,EAAA,EAAAC,GAAA,EAAAC,GAAA;EAAA,OAAAC,MAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA;AAAA,SAAAF,OAAA;EAAAA,MAAA,OAAAG,kBAAA,CAAAC,OAAA,EAAAC,YAAA,CAAAD,OAAA,CAAAE,IAAA,CAApB,SAAAC,QAAqBC,IAAI,EAAEb,OAA0B,EAAEc,OAAuB;IAAA,IAAAC,IAAA,EAAAC,IAAA,EAAAC,YAAA,EAAAC,OAAA,EAAAC,eAAA,EAAAC,WAAA,EAAAC,cAAA;IAAA,OAAAX,YAAA,CAAAD,OAAA,CAAAa,IAAA,UAAAC,SAAAC,QAAA;MAAA,kBAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;QAAA;UAAAX,IAAA,GACrB,CAAAf,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAE2B,GAAG,KAAI,CAAC,CAAC,EAAlEX,IAAI,GAAAD,IAAA,CAAJC,IAAI,EAAEC,YAAY,GAAAF,IAAA,CAAZE,YAAY,EAAEC,OAAO,GAAAH,IAAA,CAAPG,OAAO,EAAEC,eAAe,GAAAJ,IAAA,CAAfI,eAAe;UAC7CC,WAAW,GAAGH,YAAY,IAAID,IAAI;UAClCK,cAAc,GAAGF,eAAe,IAAID,OAAO;UAAA,MAC7C,CAACE,WAAW,IAAI,CAACC,cAAc;YAAAG,QAAA,CAAAE,IAAA;YAAA;UAAA;UAAA,OAAAF,QAAA,CAAAI,MAAA,WAC1B,IAAI;QAAA;UAAAJ,QAAA,CAAAE,IAAA;UAAA,OAEA,IAAAG,wCAAmB,EAC9BhB,IAAI,EACJO,WAAW,EACXC,cAAc,EACdrB,OAAO,EACPc,OACF,CAAC;QAAA;UAAA,OAAAU,QAAA,CAAAI,MAAA,WAAAJ,QAAA,CAAAM,IAAA;QAAA;QAAA;UAAA,OAAAN,QAAA,CAAAO,IAAA;MAAA;IAAA,GAAAnB,OAAA;EAAA,CACF;EAAA,OAAAP,MAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA"}
|
package/dist/es5/i3s-loader.js
CHANGED
|
@@ -12,7 +12,7 @@ var _core = require("@loaders.gl/core");
|
|
|
12
12
|
var _i3sContentLoader = require("./i3s-content-loader");
|
|
13
13
|
var _parseI3s = require("./lib/parsers/parse-i3s");
|
|
14
14
|
var _constants = require("./lib/parsers/constants");
|
|
15
|
-
var VERSION = typeof "4.0.0-alpha.
|
|
15
|
+
var VERSION = typeof "4.0.0-alpha.24" !== 'undefined' ? "4.0.0-alpha.24" : 'latest';
|
|
16
16
|
var TILESET_REGEX = /layers\/[0-9]+$/;
|
|
17
17
|
var TILE_HEADER_REGEX = /nodes\/([0-9-]+|root)$/;
|
|
18
18
|
var SLPK_HEX = '504b0304';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i3s-loader.js","names":["_core","require","_i3sContentLoader","_parseI3s","_constants","VERSION","TILESET_REGEX","TILE_HEADER_REGEX","SLPK_HEX","POINT_CLOUD","I3SLoader","name","id","module","version","mimeTypes","parse","parseI3S","extensions","options","i3s","token","isTileset","isTileHeader","tile","tileset","_tileOptions","_tilesetOptions","useDracoGeometry","useCompressedTextures","decodeTextures","coordinateSystem","COORDINATE_SYSTEM","METER_OFFSETS","colorsByAttribute","exports","_x","_parseI3S","apply","arguments","_asyncToGenerator2","default","_regenerator","mark","_callee","data","context","url","magicNumber","_args","wrap","_callee$","_context","prev","next","length","undefined","getMagicNumber","Error","test","parseTileset","sent","parseTile","parseTileContent","abrupt","stop","_x2","_x3","_parseTileContent","_callee2","arrayBuffer","_callee2$","_context2","I3SContentLoader","_x4","_x5","_x6","_parseTileset","_callee3","tilesetJson","tilesetPostprocessed","_callee3$","_context3","JSON","TextDecoder","decode","layerType","normalizeTilesetData","_x7","_x8","_parseTile","_callee4","_callee4$","_context4","normalizeTileData","ArrayBuffer","_toConsumableArray2","Uint8Array","map","value","toString","padStart","join"],"sources":["../../src/i3s-loader.ts"],"sourcesContent":["import type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport {parse} from '@loaders.gl/core';\nimport {I3SContentLoader} from './i3s-content-loader';\nimport {normalizeTileData, normalizeTilesetData} from './lib/parsers/parse-i3s';\nimport {COORDINATE_SYSTEM} from './lib/parsers/constants';\nimport {I3SParseOptions} from './types';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nconst TILESET_REGEX = /layers\\/[0-9]+$/;\nconst TILE_HEADER_REGEX = /nodes\\/([0-9-]+|root)$/;\nconst SLPK_HEX = '504b0304';\nconst POINT_CLOUD = 'PointCloud';\n\nexport type I3SLoaderOptions = LoaderOptions & {\n i3s?: I3SParseOptions;\n};\n\n/**\n * Loader for I3S - Indexed 3D Scene Layer\n */\nexport const I3SLoader: LoaderWithParser = {\n name: 'I3S (Indexed Scene Layers)',\n id: 'i3s',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/octet-stream'],\n parse: parseI3S,\n extensions: ['bin'],\n options: {\n i3s: {\n token: null,\n isTileset: 'auto',\n isTileHeader: 'auto',\n tile: null,\n tileset: null,\n _tileOptions: null,\n _tilesetOptions: null,\n useDracoGeometry: true,\n useCompressedTextures: true,\n decodeTextures: true,\n coordinateSystem: COORDINATE_SYSTEM.METER_OFFSETS,\n colorsByAttribute: null\n }\n }\n};\n\nasync function parseI3S(data, options: I3SLoaderOptions = {}, context) {\n const url = context.url;\n options.i3s = options.i3s || {};\n const magicNumber = getMagicNumber(data);\n\n // check if file is slpk\n if (magicNumber === SLPK_HEX) {\n throw new Error('Files with .slpk extention currently are not supported by I3SLoader');\n }\n\n // auto detect file type based on url\n let isTileset;\n if (options.i3s.isTileset === 'auto') {\n isTileset = TILESET_REGEX.test(url);\n } else {\n isTileset = options.i3s.isTileset;\n }\n\n let isTileHeader;\n if (options.isTileHeader === 'auto') {\n isTileHeader = TILE_HEADER_REGEX.test(url);\n } else {\n isTileHeader = options.i3s.isTileHeader;\n }\n\n if (isTileset) {\n data = await parseTileset(data, options, context);\n } else if (isTileHeader) {\n data = await parseTile(data, context);\n } else {\n data = await parseTileContent(data, options);\n }\n\n return data;\n}\n\nasync function parseTileContent(arrayBuffer, options: I3SLoaderOptions) {\n return await parse(arrayBuffer, I3SContentLoader, options);\n}\n\nasync function parseTileset(data, options: I3SLoaderOptions, context) {\n const tilesetJson = JSON.parse(new TextDecoder().decode(data));\n\n if (tilesetJson?.layerType === POINT_CLOUD) {\n throw new Error('Point Cloud layers currently are not supported by I3SLoader');\n }\n\n const tilesetPostprocessed = await normalizeTilesetData(tilesetJson, options, context);\n return tilesetPostprocessed;\n}\n\nasync function parseTile(data, context) {\n data = JSON.parse(new TextDecoder().decode(data));\n return normalizeTileData(data, context);\n}\n\nfunction getMagicNumber(data) {\n if (data instanceof ArrayBuffer) {\n // slice binary data (4 bytes from the beginning) and transform it to hexadecimal numeral system\n return [...new Uint8Array(data, 0, 4)]\n .map((value) => value.toString(16).padStart(2, '0'))\n .join('');\n }\n return null;\n}\n"],"mappings":";;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;
|
|
1
|
+
{"version":3,"file":"i3s-loader.js","names":["_core","require","_i3sContentLoader","_parseI3s","_constants","VERSION","TILESET_REGEX","TILE_HEADER_REGEX","SLPK_HEX","POINT_CLOUD","I3SLoader","name","id","module","version","mimeTypes","parse","parseI3S","extensions","options","i3s","token","isTileset","isTileHeader","tile","tileset","_tileOptions","_tilesetOptions","useDracoGeometry","useCompressedTextures","decodeTextures","coordinateSystem","COORDINATE_SYSTEM","METER_OFFSETS","colorsByAttribute","exports","_x","_parseI3S","apply","arguments","_asyncToGenerator2","default","_regenerator","mark","_callee","data","context","url","magicNumber","_args","wrap","_callee$","_context","prev","next","length","undefined","getMagicNumber","Error","test","parseTileset","sent","parseTile","parseTileContent","abrupt","stop","_x2","_x3","_parseTileContent","_callee2","arrayBuffer","_callee2$","_context2","I3SContentLoader","_x4","_x5","_x6","_parseTileset","_callee3","tilesetJson","tilesetPostprocessed","_callee3$","_context3","JSON","TextDecoder","decode","layerType","normalizeTilesetData","_x7","_x8","_parseTile","_callee4","_callee4$","_context4","normalizeTileData","ArrayBuffer","_toConsumableArray2","Uint8Array","map","value","toString","padStart","join"],"sources":["../../src/i3s-loader.ts"],"sourcesContent":["import type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport {parse} from '@loaders.gl/core';\nimport type {I3STilesetHeader} from './types';\nimport {I3SContentLoader} from './i3s-content-loader';\nimport {normalizeTileData, normalizeTilesetData} from './lib/parsers/parse-i3s';\nimport {COORDINATE_SYSTEM} from './lib/parsers/constants';\nimport {I3SParseOptions} from './types';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nconst TILESET_REGEX = /layers\\/[0-9]+$/;\nconst TILE_HEADER_REGEX = /nodes\\/([0-9-]+|root)$/;\nconst SLPK_HEX = '504b0304';\nconst POINT_CLOUD = 'PointCloud';\n\nexport type I3SLoaderOptions = LoaderOptions & {\n i3s?: I3SParseOptions;\n};\n\n/**\n * Loader for I3S - Indexed 3D Scene Layer\n */\nexport const I3SLoader: LoaderWithParser<I3STilesetHeader, never, LoaderOptions> = {\n name: 'I3S (Indexed Scene Layers)',\n id: 'i3s',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/octet-stream'],\n parse: parseI3S,\n extensions: ['bin'],\n options: {\n i3s: {\n token: null,\n isTileset: 'auto',\n isTileHeader: 'auto',\n tile: null,\n tileset: null,\n _tileOptions: null,\n _tilesetOptions: null,\n useDracoGeometry: true,\n useCompressedTextures: true,\n decodeTextures: true,\n coordinateSystem: COORDINATE_SYSTEM.METER_OFFSETS,\n colorsByAttribute: null\n }\n }\n};\n\nasync function parseI3S(data, options: I3SLoaderOptions = {}, context): Promise<I3STilesetHeader> {\n const url = context.url;\n options.i3s = options.i3s || {};\n const magicNumber = getMagicNumber(data);\n\n // check if file is slpk\n if (magicNumber === SLPK_HEX) {\n throw new Error('Files with .slpk extention currently are not supported by I3SLoader');\n }\n\n // auto detect file type based on url\n let isTileset;\n if (options.i3s.isTileset === 'auto') {\n isTileset = TILESET_REGEX.test(url);\n } else {\n isTileset = options.i3s.isTileset;\n }\n\n let isTileHeader;\n if (options.isTileHeader === 'auto') {\n isTileHeader = TILE_HEADER_REGEX.test(url);\n } else {\n isTileHeader = options.i3s.isTileHeader;\n }\n\n if (isTileset) {\n data = await parseTileset(data, options, context);\n } else if (isTileHeader) {\n data = await parseTile(data, context);\n } else {\n data = await parseTileContent(data, options);\n }\n\n return data;\n}\n\nasync function parseTileContent(arrayBuffer, options: I3SLoaderOptions) {\n return await parse(arrayBuffer, I3SContentLoader, options);\n}\n\nasync function parseTileset(data, options: I3SLoaderOptions, context) {\n const tilesetJson = JSON.parse(new TextDecoder().decode(data));\n\n if (tilesetJson?.layerType === POINT_CLOUD) {\n throw new Error('Point Cloud layers currently are not supported by I3SLoader');\n }\n\n const tilesetPostprocessed = await normalizeTilesetData(tilesetJson, options, context);\n return tilesetPostprocessed;\n}\n\nasync function parseTile(data, context) {\n data = JSON.parse(new TextDecoder().decode(data));\n return normalizeTileData(data, context);\n}\n\nfunction getMagicNumber(data) {\n if (data instanceof ArrayBuffer) {\n // slice binary data (4 bytes from the beginning) and transform it to hexadecimal numeral system\n return [...new Uint8Array(data, 0, 4)]\n .map((value) => value.toString(16).padStart(2, '0'))\n .join('');\n }\n return null;\n}\n"],"mappings":";;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAKA,IAAMI,OAAO,GAAG,uBAAkB,KAAK,WAAW,sBAAiB,QAAQ;AAE3E,IAAMC,aAAa,GAAG,iBAAiB;AACvC,IAAMC,iBAAiB,GAAG,wBAAwB;AAClD,IAAMC,QAAQ,GAAG,UAAU;AAC3B,IAAMC,WAAW,GAAG,YAAY;AASzB,IAAMC,SAAmE,GAAG;EACjFC,IAAI,EAAE,4BAA4B;EAClCC,EAAE,EAAE,KAAK;EACTC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAET,OAAO;EAChBU,SAAS,EAAE,CAAC,0BAA0B,CAAC;EACvCC,KAAK,EAAEC,QAAQ;EACfC,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBC,OAAO,EAAE;IACPC,GAAG,EAAE;MACHC,KAAK,EAAE,IAAI;MACXC,SAAS,EAAE,MAAM;MACjBC,YAAY,EAAE,MAAM;MACpBC,IAAI,EAAE,IAAI;MACVC,OAAO,EAAE,IAAI;MACbC,YAAY,EAAE,IAAI;MAClBC,eAAe,EAAE,IAAI;MACrBC,gBAAgB,EAAE,IA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CAAC,EAAE,CAAC,CAAC,EAClCqD,GAAG,CAAC,UAACC,KAAK;MAAA,OAAKA,KAAK,CAACC,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;IAAA,EAAC,CACnDC,IAAI,CAAC,EAAE,CAAC;EACb;EACA,OAAO,IAAI;AACb"}
|
|
@@ -7,7 +7,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.I3SNodePageLoader = void 0;
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
|
-
var VERSION = typeof "4.0.0-alpha.
|
|
10
|
+
var VERSION = typeof "4.0.0-alpha.24" !== 'undefined' ? "4.0.0-alpha.24" : 'latest';
|
|
11
|
+
var I3SNodePageLoader = {
|
|
12
|
+
name: 'I3S Node Page',
|
|
13
|
+
id: 'i3s-node-page',
|
|
14
|
+
module: 'i3s',
|
|
15
|
+
version: VERSION,
|
|
16
|
+
mimeTypes: ['application/json'],
|
|
17
|
+
parse: parseNodePage,
|
|
18
|
+
extensions: ['json'],
|
|
19
|
+
options: {
|
|
20
|
+
i3s: {}
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
exports.I3SNodePageLoader = I3SNodePageLoader;
|
|
11
24
|
function parseNodePage(_x, _x2) {
|
|
12
25
|
return _parseNodePage.apply(this, arguments);
|
|
13
26
|
}
|
|
@@ -25,15 +38,4 @@ function _parseNodePage() {
|
|
|
25
38
|
}));
|
|
26
39
|
return _parseNodePage.apply(this, arguments);
|
|
27
40
|
}
|
|
28
|
-
var I3SNodePageLoader = {
|
|
29
|
-
name: 'I3S Node Page',
|
|
30
|
-
id: 'i3s-node-page',
|
|
31
|
-
module: 'i3s',
|
|
32
|
-
version: VERSION,
|
|
33
|
-
mimeTypes: ['application/json'],
|
|
34
|
-
parse: parseNodePage,
|
|
35
|
-
extensions: ['json'],
|
|
36
|
-
options: {}
|
|
37
|
-
};
|
|
38
|
-
exports.I3SNodePageLoader = I3SNodePageLoader;
|
|
39
41
|
//# sourceMappingURL=i3s-node-page-loader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i3s-node-page-loader.js","names":["VERSION","
|
|
1
|
+
{"version":3,"file":"i3s-node-page-loader.js","names":["VERSION","I3SNodePageLoader","name","id","module","version","mimeTypes","parse","parseNodePage","extensions","options","i3s","exports","_x","_x2","_parseNodePage","apply","arguments","_asyncToGenerator2","default","_regenerator","mark","_callee","data","wrap","_callee$","_context","prev","next","abrupt","JSON","TextDecoder","decode","stop"],"sources":["../../src/i3s-node-page-loader.ts"],"sourcesContent":["import type {LoaderOptions, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {I3SLoaderOptions} from './i3s-loader';\nimport type {NodePage} from './types';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/**\n * Loader for I3S node pages\n */\nexport const I3SNodePageLoader: LoaderWithParser<NodePage, never, I3SLoaderOptions> = {\n name: 'I3S Node Page',\n id: 'i3s-node-page',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/json'],\n parse: parseNodePage,\n extensions: ['json'],\n options: {\n i3s: {}\n }\n};\n\nasync function parseNodePage(data: ArrayBuffer, options?: LoaderOptions): Promise<NodePage> {\n return JSON.parse(new TextDecoder().decode(data)) as NodePage;\n}\n"],"mappings":";;;;;;;;;AAMA,IAAMA,OAAO,GAAG,uBAAkB,KAAK,WAAW,sBAAiB,QAAQ;AAKpE,IAAMC,iBAAsE,GAAG;EACpFC,IAAI,EAAE,eAAe;EACrBC,EAAE,EAAE,eAAe;EACnBC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEL,OAAO;EAChBM,SAAS,EAAE,CAAC,kBAAkB,CAAC;EAC/BC,KAAK,EAAEC,aAAa;EACpBC,UAAU,EAAE,CAAC,MAAM,CAAC;EACpBC,OAAO,EAAE;IACPC,GAAG,EAAE,CAAC;EACR;AACF,CAAC;AAACC,OAAA,CAAAX,iBAAA,GAAAA,iBAAA;AAAA,SAEaO,aAAaA,CAAAK,EAAA,EAAAC,GAAA;EAAA,OAAAC,cAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA;AAAA,SAAAF,eAAA;EAAAA,cAAA,OAAAG,kBAAA,CAAAC,OAAA,EAAAC,YAAA,CAAAD,OAAA,CAAAE,IAAA,CAA5B,SAAAC,QAA6BC,IAAiB,EAAEb,OAAuB;IAAA,OAAAU,YAAA,CAAAD,OAAA,CAAAK,IAAA,UAAAC,SAAAC,QAAA;MAAA,kBAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;QAAA;UAAA,OAAAF,QAAA,CAAAG,MAAA,WAC9DC,IAAI,CAACvB,KAAK,CAAC,IAAIwB,WAAW,CAAC,CAAC,CAACC,MAAM,CAACT,IAAI,CAAC,CAAC;QAAA;QAAA;UAAA,OAAAG,QAAA,CAAAO,IAAA;MAAA;IAAA,GAAAX,OAAA;EAAA,CAClD;EAAA,OAAAP,cAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA"}
|
|
@@ -7,9 +7,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.SLPKLoader = void 0;
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
|
-
var
|
|
10
|
+
var _loaderUtils = require("@loaders.gl/loader-utils");
|
|
11
11
|
var _parseSlpk = require("./lib/parsers/parse-slpk/parse-slpk");
|
|
12
|
-
var VERSION = typeof "4.0.0-alpha.
|
|
12
|
+
var VERSION = typeof "4.0.0-alpha.24" !== 'undefined' ? "4.0.0-alpha.24" : 'latest';
|
|
13
13
|
var SLPKLoader = {
|
|
14
14
|
name: 'I3S SLPK (Scene Layer Package)',
|
|
15
15
|
id: 'slpk',
|
|
@@ -34,7 +34,7 @@ function _parseSLPK() {
|
|
|
34
34
|
case 0:
|
|
35
35
|
options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
|
|
36
36
|
_context.next = 3;
|
|
37
|
-
return (0, _parseSlpk.parseSLPK)(new
|
|
37
|
+
return (0, _parseSlpk.parseSLPK)(new _loaderUtils.DataViewFile(new DataView(data)));
|
|
38
38
|
case 3:
|
|
39
39
|
return _context.abrupt("return", _context.sent.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));
|
|
40
40
|
case 4:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i3s-slpk-loader.js","names":["
|
|
1
|
+
{"version":3,"file":"i3s-slpk-loader.js","names":["_loaderUtils","require","_parseSlpk","VERSION","SLPKLoader","name","id","module","version","mimeTypes","parse","parseSLPK","extensions","options","exports","_x","_parseSLPK","apply","arguments","_asyncToGenerator2","default","_regenerator","mark","_callee","data","_options$slpk$path","_options$slpk","_options$slpk2","_args","wrap","_callee$","_context","prev","next","length","undefined","parseSLPKFromProvider","DataViewFile","DataView","abrupt","sent","getFile","slpk","path","pathMode","stop"],"sources":["../../src/i3s-slpk-loader.ts"],"sourcesContent":["import type {LoaderOptions, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {DataViewFile} from '@loaders.gl/loader-utils';\nimport {parseSLPK as parseSLPKFromProvider} from './lib/parsers/parse-slpk/parse-slpk';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/** options to load data from SLPK */\nexport type SLPKLoaderOptions = LoaderOptions & {\n slpk?: {\n /** path inside the slpk archive */\n path?: string;\n /** mode of the path */\n pathMode?: 'http' | 'raw';\n };\n};\n\n/**\n * Loader for SLPK - Scene Layer Package\n */\nexport const SLPKLoader: LoaderWithParser<ArrayBuffer, never, SLPKLoaderOptions> = {\n name: 'I3S SLPK (Scene Layer Package)',\n id: 'slpk',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/octet-stream'],\n parse: parseSLPK,\n extensions: ['slpk'],\n options: {}\n};\n\n/**\n * returns a single file from the slpk archive\n * @param data slpk archive data\n * @param options options\n * @returns requested file\n */\n\nasync function parseSLPK(data: ArrayBuffer, options: SLPKLoaderOptions = {}) {\n return (await parseSLPKFromProvider(new DataViewFile(new DataView(data)))).getFile(\n options.slpk?.path ?? '',\n options.slpk?.pathMode\n );\n}\n"],"mappings":";;;;;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAIA,IAAME,OAAO,GAAG,uBAAkB,KAAK,WAAW,sBAAiB,QAAQ;AAepE,IAAMC,UAAmE,GAAG;EACjFC,IAAI,EAAE,gCAAgC;EACtCC,EAAE,EAAE,MAAM;EACVC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEL,OAAO;EAChBM,SAAS,EAAE,CAAC,0BAA0B,CAAC;EACvCC,KAAK,EAAEC,SAAS;EAChBC,UAAU,EAAE,CAAC,MAAM,CAAC;EACpBC,OAAO,EAAE,CAAC;AACZ,CAAC;AAACC,OAAA,CAAAV,UAAA,GAAAA,UAAA;AAAA,SASaO,SAASA,CAAAI,EAAA;EAAA,OAAAC,UAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA;AAAA,SAAAF,WAAA;EAAAA,UAAA,OAAAG,kBAAA,CAAAC,OAAA,EAAAC,YAAA,CAAAD,OAAA,CAAAE,IAAA,CAAxB,SAAAC,QAAyBC,IAAiB;IAAA,IAAAC,kBAAA,EAAAC,aAAA,EAAAC,cAAA;IAAA,IAAAd,OAAA;MAAAe,KAAA,GAAAV,SAAA;IAAA,OAAAG,YAAA,CAAAD,OAAA,CAAAS,IAAA,UAAAC,SAAAC,QAAA;MAAA,kBAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;QAAA;UAAEpB,OAA0B,GAAAe,KAAA,CAAAM,MAAA,QAAAN,KAAA,QAAAO,SAAA,GAAAP,KAAA,MAAG,CAAC,CAAC;UAAAG,QAAA,CAAAE,IAAA;UAAA,OAC3D,IAAAG,oBAAqB,EAAC,IAAIC,yBAAY,CAAC,IAAIC,QAAQ,CAACd,IAAI,CAAC,CAAC,CAAC;QAAA;UAAA,OAAAO,QAAA,CAAAQ,MAAA,WAAAR,QAAA,CAAAS,IAAA,CAAEC,OAAO,EAAAhB,kBAAA,IAAAC,aAAA,GAChFb,OAAO,CAAC6B,IAAI,cAAAhB,aAAA,uBAAZA,aAAA,CAAciB,IAAI,cAAAlB,kBAAA,cAAAA,kBAAA,GAAI,EAAE,GAAAE,cAAA,GACxBd,OAAO,CAAC6B,IAAI,cAAAf,cAAA,uBAAZA,cAAA,CAAciB,QAAQ;QAAA;QAAA;UAAA,OAAAb,QAAA,CAAAc,IAAA;MAAA;IAAA,GAAAtB,OAAA;EAAA,CAEzB;EAAA,OAAAP,UAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA"}
|
package/dist/es5/index.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "
|
|
6
|
+
Object.defineProperty(exports, "ArcGISWebSceneLoader", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return _arcgisWebsceneLoader.
|
|
9
|
+
return _arcgisWebsceneLoader.ArcGISWebSceneLoader;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "COORDINATE_SYSTEM", {
|
package/dist/es5/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_constants","require","_i3sLoader","_i3sSlpkLoader","_i3sContentLoader","_i3sAttributeLoader","_i3sBuildingSceneLayerLoader","_i3sNodePageLoader","_arcgisWebsceneLoader","_parseSlpk"],"sources":["../../src/index.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nexport type {\n BoundingVolumes,\n Mbs,\n Obb,\n I3STilesetHeader,\n I3STileContent,\n I3STileHeader,\n SceneLayer3D,\n AttributeStorageInfo,\n Field,\n ESRIField,\n PopupInfo,\n Node3DIndexDocument,\n LodSelection,\n NodeReference,\n Resource,\n MaxScreenThresholdSQ,\n NodeInPage,\n SharedResources,\n Attribute,\n Extent,\n FeatureAttribute,\n FieldInfo,\n I3SMaterialDefinition,\n TextureDefinitionInfo,\n MaterialDefinitionInfo,\n FullExtent,\n StatisticsInfo,\n StatsInfo,\n Histogram,\n ValueCount,\n BuildingSceneSublayer,\n OperationalLayer,\n TextureSetDefinitionFormats\n} from './types';\nexport type {I3SLoaderOptions} from './i3s-loader';\n\nexport {COORDINATE_SYSTEM} from './lib/parsers/constants';\n\nexport {I3SLoader} from './i3s-loader';\nexport {SLPKLoader} from './i3s-slpk-loader';\nexport {I3SContentLoader} from './i3s-content-loader';\nexport {I3SAttributeLoader, loadFeatureAttributes} from './i3s-attribute-loader';\nexport {I3SBuildingSceneLayerLoader} from './i3s-building-scene-layer-loader';\nexport {I3SNodePageLoader} from './i3s-node-page-loader';\nexport {
|
|
1
|
+
{"version":3,"file":"index.js","names":["_constants","require","_i3sLoader","_i3sSlpkLoader","_i3sContentLoader","_i3sAttributeLoader","_i3sBuildingSceneLayerLoader","_i3sNodePageLoader","_arcgisWebsceneLoader","_parseSlpk"],"sources":["../../src/index.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nexport type {\n BoundingVolumes,\n Mbs,\n Obb,\n I3STilesetHeader,\n I3STileContent,\n I3STileHeader,\n SceneLayer3D,\n AttributeStorageInfo,\n Field,\n ESRIField,\n PopupInfo,\n Node3DIndexDocument,\n LodSelection,\n NodeReference,\n Resource,\n MaxScreenThresholdSQ,\n NodeInPage,\n SharedResources,\n Attribute,\n Extent,\n FeatureAttribute,\n FieldInfo,\n I3SMaterialDefinition,\n TextureDefinitionInfo,\n MaterialDefinitionInfo,\n FullExtent,\n StatisticsInfo,\n StatsInfo,\n Histogram,\n ValueCount,\n BuildingSceneSublayer,\n OperationalLayer,\n TextureSetDefinitionFormats\n} from './types';\nexport type {I3SLoaderOptions} from './i3s-loader';\n\nexport {COORDINATE_SYSTEM} from './lib/parsers/constants';\n\nexport {I3SLoader} from './i3s-loader';\nexport {SLPKLoader} from './i3s-slpk-loader';\nexport {I3SContentLoader} from './i3s-content-loader';\nexport {I3SAttributeLoader, loadFeatureAttributes} from './i3s-attribute-loader';\nexport {I3SBuildingSceneLayerLoader} from './i3s-building-scene-layer-loader';\nexport {I3SNodePageLoader} from './i3s-node-page-loader';\nexport {ArcGISWebSceneLoader} from './arcgis-webscene-loader';\nexport {parseSLPK} from './lib/parsers/parse-slpk/parse-slpk';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,mBAAA,GAAAJ,OAAA;AACA,IAAAK,4BAAA,GAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAN,OAAA;AACA,IAAAO,qBAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA"}
|