@loaders.gl/i3s 4.0.0-alpha.23 → 4.0.0-alpha.25
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 +84 -53
- 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 +1 -1
- 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.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 +1 -1
- 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.js.map +1 -1
- package/dist/esm/types.js.map +1 -1
- package/dist/i3s-content-worker-node.js +40 -40
- package/dist/i3s-content-worker-node.js.map +3 -3
- package/dist/i3s-content-worker.js +46 -22
- 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} +1 -2
- 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/src/lib/parsers/parse-slpk/parse-slpk.d.ts.map +1 -0
- 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 +1 -1
- package/src/index.ts +1 -1
- package/src/lib/parsers/parse-arcgis-webscene.ts +2 -2
- package/src/lib/parsers/parse-i3s.ts +3 -2
- 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 -498
- 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}/parsers/parse-slpk/parse-slpk.d.ts +0 -0
- /package/dist/{lib → src/lib}/parsers/parse-slpk/slpk-archieve.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
|
@@ -753,16 +753,45 @@
|
|
|
753
753
|
}
|
|
754
754
|
});
|
|
755
755
|
|
|
756
|
+
// ../loader-utils/src/lib/option-utils/merge-loader-options.ts
|
|
757
|
+
function mergeLoaderOptions(baseOptions, newOptions) {
|
|
758
|
+
return mergeOptionsRecursively(baseOptions || {}, newOptions);
|
|
759
|
+
}
|
|
760
|
+
function mergeOptionsRecursively(baseOptions, newOptions) {
|
|
761
|
+
const options = { ...baseOptions };
|
|
762
|
+
for (const [key, newValue] of Object.entries(newOptions)) {
|
|
763
|
+
if (newValue && typeof newValue === "object" && !Array.isArray(newValue)) {
|
|
764
|
+
options[key] = mergeOptionsRecursively(options[key] || {}, newOptions[key]);
|
|
765
|
+
} else {
|
|
766
|
+
options[key] = newOptions[key];
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
return options;
|
|
770
|
+
}
|
|
771
|
+
var init_merge_loader_options = __esm({
|
|
772
|
+
"../loader-utils/src/lib/option-utils/merge-loader-options.ts"() {
|
|
773
|
+
}
|
|
774
|
+
});
|
|
775
|
+
|
|
756
776
|
// ../worker-utils/src/lib/env-utils/version.ts
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
DEFAULT_VERSION = "beta";
|
|
761
|
-
VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : DEFAULT_VERSION;
|
|
777
|
+
function getVersion() {
|
|
778
|
+
if (!globalThis._loadersgl_?.version) {
|
|
779
|
+
globalThis._loadersgl_ = globalThis._loadersgl_ || {};
|
|
762
780
|
if (typeof __VERSION__ === "undefined") {
|
|
763
781
|
console.error("loaders.gl: The __VERSION__ variable is not injected using babel plugin. Latest unstable workers would be fetched from the CDN.");
|
|
782
|
+
globalThis._loadersgl_.version = NPM_TAG;
|
|
783
|
+
} else {
|
|
784
|
+
globalThis._loadersgl_.version = __VERSION__;
|
|
764
785
|
}
|
|
765
786
|
}
|
|
787
|
+
return globalThis._loadersgl_.version;
|
|
788
|
+
}
|
|
789
|
+
var NPM_TAG, VERSION;
|
|
790
|
+
var init_version = __esm({
|
|
791
|
+
"../worker-utils/src/lib/env-utils/version.ts"() {
|
|
792
|
+
NPM_TAG = "beta";
|
|
793
|
+
VERSION = getVersion();
|
|
794
|
+
}
|
|
766
795
|
});
|
|
767
796
|
|
|
768
797
|
// ../worker-utils/src/lib/env-utils/assert.ts
|
|
@@ -1227,12 +1256,11 @@
|
|
|
1227
1256
|
assert2(url);
|
|
1228
1257
|
return url;
|
|
1229
1258
|
}
|
|
1230
|
-
var NPM_TAG;
|
|
1231
1259
|
var init_get_worker_url = __esm({
|
|
1232
1260
|
"../worker-utils/src/lib/worker-api/get-worker-url.ts"() {
|
|
1233
1261
|
init_assert2();
|
|
1234
1262
|
init_globals2();
|
|
1235
|
-
|
|
1263
|
+
init_version();
|
|
1236
1264
|
}
|
|
1237
1265
|
});
|
|
1238
1266
|
|
|
@@ -1280,7 +1308,7 @@
|
|
|
1280
1308
|
}
|
|
1281
1309
|
if (options.CDN) {
|
|
1282
1310
|
assert2(options.CDN.startsWith("http"));
|
|
1283
|
-
return `${options.CDN}/${moduleName}@${
|
|
1311
|
+
return `${options.CDN}/${moduleName}@${VERSION}/dist/libs/${libraryName}`;
|
|
1284
1312
|
}
|
|
1285
1313
|
if (isWorker) {
|
|
1286
1314
|
return `../src/libs/${libraryName}`;
|
|
@@ -1336,15 +1364,13 @@
|
|
|
1336
1364
|
}
|
|
1337
1365
|
return await node.readFileAsText(url);
|
|
1338
1366
|
}
|
|
1339
|
-
var node,
|
|
1367
|
+
var node, loadLibraryPromises;
|
|
1340
1368
|
var init_library_utils = __esm({
|
|
1341
1369
|
"../worker-utils/src/lib/library-utils/library-utils.ts"() {
|
|
1342
1370
|
init_globals2();
|
|
1343
1371
|
node = __toModule(require_require_utils());
|
|
1344
1372
|
init_assert2();
|
|
1345
1373
|
init_version();
|
|
1346
|
-
LATEST = "beta";
|
|
1347
|
-
VERSION2 = typeof VERSION !== "undefined" ? VERSION : LATEST;
|
|
1348
1374
|
loadLibraryPromises = {};
|
|
1349
1375
|
}
|
|
1350
1376
|
});
|
|
@@ -1552,15 +1578,15 @@
|
|
|
1552
1578
|
function parseTextSync(text) {
|
|
1553
1579
|
return JSON.parse(text);
|
|
1554
1580
|
}
|
|
1555
|
-
var
|
|
1581
|
+
var VERSION2, JSONLoader;
|
|
1556
1582
|
var init_json_loader = __esm({
|
|
1557
1583
|
"../loader-utils/src/json-loader.ts"() {
|
|
1558
|
-
|
|
1584
|
+
VERSION2 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
1559
1585
|
JSONLoader = {
|
|
1560
1586
|
name: "JSON",
|
|
1561
1587
|
id: "json",
|
|
1562
1588
|
module: "json",
|
|
1563
|
-
version:
|
|
1589
|
+
version: VERSION2,
|
|
1564
1590
|
extensions: ["json", "geojson"],
|
|
1565
1591
|
mimeTypes: ["application/json"],
|
|
1566
1592
|
category: "json",
|
|
@@ -1818,6 +1844,7 @@
|
|
|
1818
1844
|
init_loader_types();
|
|
1819
1845
|
init_assert();
|
|
1820
1846
|
init_globals();
|
|
1847
|
+
init_merge_loader_options();
|
|
1821
1848
|
init_parse_with_worker();
|
|
1822
1849
|
init_array_buffer_utils();
|
|
1823
1850
|
init_async_iteration();
|
|
@@ -2107,11 +2134,11 @@
|
|
|
2107
2134
|
});
|
|
2108
2135
|
|
|
2109
2136
|
// ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/utils/globals.js
|
|
2110
|
-
var
|
|
2137
|
+
var VERSION3, isBrowser4;
|
|
2111
2138
|
var init_globals4 = __esm({
|
|
2112
2139
|
"../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/utils/globals.js"() {
|
|
2113
2140
|
init_is_browser();
|
|
2114
|
-
|
|
2141
|
+
VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
|
|
2115
2142
|
isBrowser4 = isBrowser3();
|
|
2116
2143
|
}
|
|
2117
2144
|
});
|
|
@@ -2448,7 +2475,7 @@
|
|
|
2448
2475
|
id: ""
|
|
2449
2476
|
};
|
|
2450
2477
|
_defineProperty(this, "id", void 0);
|
|
2451
|
-
_defineProperty(this, "VERSION",
|
|
2478
|
+
_defineProperty(this, "VERSION", VERSION3);
|
|
2452
2479
|
_defineProperty(this, "_startTs", getHiResTimestamp());
|
|
2453
2480
|
_defineProperty(this, "_deltaTs", getHiResTimestamp());
|
|
2454
2481
|
_defineProperty(this, "_storage", void 0);
|
|
@@ -2651,7 +2678,7 @@
|
|
|
2651
2678
|
return noop;
|
|
2652
2679
|
}
|
|
2653
2680
|
};
|
|
2654
|
-
_defineProperty(Log, "VERSION",
|
|
2681
|
+
_defineProperty(Log, "VERSION", VERSION3);
|
|
2655
2682
|
}
|
|
2656
2683
|
});
|
|
2657
2684
|
|
|
@@ -3389,6 +3416,7 @@
|
|
|
3389
3416
|
}
|
|
3390
3417
|
async function parseWithLoader(loader, data, options, context) {
|
|
3391
3418
|
validateWorkerVersion(loader);
|
|
3419
|
+
options = mergeLoaderOptions(loader.options, options);
|
|
3392
3420
|
if (isResponse(data)) {
|
|
3393
3421
|
const response = data;
|
|
3394
3422
|
const { ok, redirected, status, statusText, type, url } = response;
|
|
@@ -3419,6 +3447,7 @@
|
|
|
3419
3447
|
init_normalize_loader();
|
|
3420
3448
|
init_is_type();
|
|
3421
3449
|
init_option_utils();
|
|
3450
|
+
init_src2();
|
|
3422
3451
|
init_get_data();
|
|
3423
3452
|
init_loader_context();
|
|
3424
3453
|
init_resource_utils();
|
|
@@ -6782,10 +6811,10 @@
|
|
|
6782
6811
|
});
|
|
6783
6812
|
|
|
6784
6813
|
// ../images/src/lib/utils/version.ts
|
|
6785
|
-
var
|
|
6814
|
+
var VERSION4;
|
|
6786
6815
|
var init_version2 = __esm({
|
|
6787
6816
|
"../images/src/lib/utils/version.ts"() {
|
|
6788
|
-
|
|
6817
|
+
VERSION4 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
6789
6818
|
}
|
|
6790
6819
|
});
|
|
6791
6820
|
|
|
@@ -7234,7 +7263,7 @@
|
|
|
7234
7263
|
id: "image",
|
|
7235
7264
|
module: "images",
|
|
7236
7265
|
name: "Images",
|
|
7237
|
-
version:
|
|
7266
|
+
version: VERSION4,
|
|
7238
7267
|
mimeTypes: MIME_TYPES,
|
|
7239
7268
|
extensions: EXTENSIONS,
|
|
7240
7269
|
parse: parseImage,
|
|
@@ -7252,10 +7281,10 @@
|
|
|
7252
7281
|
});
|
|
7253
7282
|
|
|
7254
7283
|
// ../draco/src/lib/utils/version.ts
|
|
7255
|
-
var
|
|
7284
|
+
var VERSION5;
|
|
7256
7285
|
var init_version3 = __esm({
|
|
7257
7286
|
"../draco/src/lib/utils/version.ts"() {
|
|
7258
|
-
|
|
7287
|
+
VERSION5 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
7259
7288
|
}
|
|
7260
7289
|
});
|
|
7261
7290
|
|
|
@@ -7276,7 +7305,7 @@
|
|
|
7276
7305
|
name: "Draco",
|
|
7277
7306
|
id: "draco",
|
|
7278
7307
|
module: "draco",
|
|
7279
|
-
version:
|
|
7308
|
+
version: VERSION5,
|
|
7280
7309
|
worker: true,
|
|
7281
7310
|
extensions: ["drc"],
|
|
7282
7311
|
mimeTypes: ["application/octet-stream"],
|
|
@@ -7820,7 +7849,7 @@
|
|
|
7820
7849
|
var init_draco_module_loader = __esm({
|
|
7821
7850
|
"../draco/src/lib/draco-module-loader.ts"() {
|
|
7822
7851
|
init_src();
|
|
7823
|
-
DRACO_DECODER_VERSION = "1.5.
|
|
7852
|
+
DRACO_DECODER_VERSION = "1.5.6";
|
|
7824
7853
|
DRACO_ENCODER_VERSION = "1.4.1";
|
|
7825
7854
|
STATIC_DECODER_URL = `https://www.gstatic.com/draco/versioned/decoders/${DRACO_DECODER_VERSION}`;
|
|
7826
7855
|
DRACO_EXTERNAL_LIBRARIES = {
|
|
@@ -7862,10 +7891,10 @@
|
|
|
7862
7891
|
});
|
|
7863
7892
|
|
|
7864
7893
|
// ../textures/src/lib/utils/version.ts
|
|
7865
|
-
var
|
|
7894
|
+
var VERSION6;
|
|
7866
7895
|
var init_version4 = __esm({
|
|
7867
7896
|
"../textures/src/lib/utils/version.ts"() {
|
|
7868
|
-
|
|
7897
|
+
VERSION6 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
|
|
7869
7898
|
}
|
|
7870
7899
|
});
|
|
7871
7900
|
|
|
@@ -8508,7 +8537,7 @@
|
|
|
8508
8537
|
name: "Basis",
|
|
8509
8538
|
id: "basis",
|
|
8510
8539
|
module: "textures",
|
|
8511
|
-
version:
|
|
8540
|
+
version: VERSION6,
|
|
8512
8541
|
worker: true,
|
|
8513
8542
|
extensions: ["basis", "ktx2"],
|
|
8514
8543
|
mimeTypes: ["application/octet-stream", "image/ktx2"],
|
|
@@ -8845,7 +8874,7 @@
|
|
|
8845
8874
|
name: "Texture Containers",
|
|
8846
8875
|
id: "compressed-texture",
|
|
8847
8876
|
module: "textures",
|
|
8848
|
-
version:
|
|
8877
|
+
version: VERSION6,
|
|
8849
8878
|
worker: true,
|
|
8850
8879
|
extensions: [
|
|
8851
8880
|
"ktx",
|
|
@@ -9087,20 +9116,20 @@
|
|
|
9087
9116
|
}
|
|
9088
9117
|
return value;
|
|
9089
9118
|
}
|
|
9090
|
-
var
|
|
9119
|
+
var VERSION7, EMPTY_VALUE, REJECTED_STATUS, I3SAttributeLoader;
|
|
9091
9120
|
var init_i3s_attribute_loader = __esm({
|
|
9092
9121
|
"src/i3s-attribute-loader.ts"() {
|
|
9093
9122
|
init_src3();
|
|
9094
9123
|
init_parse_i3s_attribute();
|
|
9095
9124
|
init_url_utils2();
|
|
9096
|
-
|
|
9125
|
+
VERSION7 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
9097
9126
|
EMPTY_VALUE = "";
|
|
9098
9127
|
REJECTED_STATUS = "rejected";
|
|
9099
9128
|
I3SAttributeLoader = {
|
|
9100
9129
|
name: "I3S Attribute",
|
|
9101
9130
|
id: "i3s-attribute",
|
|
9102
9131
|
module: "i3s",
|
|
9103
|
-
version:
|
|
9132
|
+
version: VERSION7,
|
|
9104
9133
|
mimeTypes: ["application/binary"],
|
|
9105
9134
|
parse: async (arrayBuffer, options) => parseI3STileAttribute(arrayBuffer, options),
|
|
9106
9135
|
extensions: ["bin"],
|
|
@@ -9586,17 +9615,17 @@
|
|
|
9586
9615
|
}
|
|
9587
9616
|
return await parseI3STileContent(data, tileOptions, tilesetOptions, options, context);
|
|
9588
9617
|
}
|
|
9589
|
-
var
|
|
9618
|
+
var VERSION8, I3SContentLoader;
|
|
9590
9619
|
var init_i3s_content_loader = __esm({
|
|
9591
9620
|
"src/i3s-content-loader.ts"() {
|
|
9592
9621
|
init_parse_i3s_tile_content();
|
|
9593
|
-
|
|
9622
|
+
VERSION8 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
|
|
9594
9623
|
I3SContentLoader = {
|
|
9595
9624
|
name: "I3S Content (Indexed Scene Layers)",
|
|
9596
9625
|
id: "i3s-content",
|
|
9597
9626
|
module: "i3s",
|
|
9598
9627
|
worker: true,
|
|
9599
|
-
version:
|
|
9628
|
+
version: VERSION8,
|
|
9600
9629
|
mimeTypes: ["application/octet-stream"],
|
|
9601
9630
|
parse: parse3,
|
|
9602
9631
|
extensions: ["bin"],
|
|
@@ -10200,19 +10229,21 @@
|
|
|
10200
10229
|
async function parseNodePage(data, options) {
|
|
10201
10230
|
return JSON.parse(new TextDecoder().decode(data));
|
|
10202
10231
|
}
|
|
10203
|
-
var
|
|
10232
|
+
var VERSION9, I3SNodePageLoader;
|
|
10204
10233
|
var init_i3s_node_page_loader = __esm({
|
|
10205
10234
|
"src/i3s-node-page-loader.ts"() {
|
|
10206
|
-
|
|
10235
|
+
VERSION9 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
10207
10236
|
I3SNodePageLoader = {
|
|
10208
10237
|
name: "I3S Node Page",
|
|
10209
10238
|
id: "i3s-node-page",
|
|
10210
10239
|
module: "i3s",
|
|
10211
|
-
version:
|
|
10240
|
+
version: VERSION9,
|
|
10212
10241
|
mimeTypes: ["application/json"],
|
|
10213
10242
|
parse: parseNodePage,
|
|
10214
10243
|
extensions: ["json"],
|
|
10215
|
-
options: {
|
|
10244
|
+
options: {
|
|
10245
|
+
i3s: {}
|
|
10246
|
+
}
|
|
10216
10247
|
};
|
|
10217
10248
|
}
|
|
10218
10249
|
});
|
|
@@ -10544,14 +10575,14 @@
|
|
|
10544
10575
|
}
|
|
10545
10576
|
return null;
|
|
10546
10577
|
}
|
|
10547
|
-
var
|
|
10578
|
+
var VERSION10, TILESET_REGEX, TILE_HEADER_REGEX, SLPK_HEX, POINT_CLOUD, I3SLoader;
|
|
10548
10579
|
var init_i3s_loader = __esm({
|
|
10549
10580
|
"src/i3s-loader.ts"() {
|
|
10550
10581
|
init_src3();
|
|
10551
10582
|
init_i3s_content_loader();
|
|
10552
10583
|
init_parse_i3s();
|
|
10553
10584
|
init_constants();
|
|
10554
|
-
|
|
10585
|
+
VERSION10 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
10555
10586
|
TILESET_REGEX = /layers\/[0-9]+$/;
|
|
10556
10587
|
TILE_HEADER_REGEX = /nodes\/([0-9-]+|root)$/;
|
|
10557
10588
|
SLPK_HEX = "504b0304";
|
|
@@ -10560,7 +10591,7 @@
|
|
|
10560
10591
|
name: "I3S (Indexed Scene Layers)",
|
|
10561
10592
|
id: "i3s",
|
|
10562
10593
|
module: "i3s",
|
|
10563
|
-
version:
|
|
10594
|
+
version: VERSION10,
|
|
10564
10595
|
mimeTypes: ["application/octet-stream"],
|
|
10565
10596
|
parse: parseI3S,
|
|
10566
10597
|
extensions: ["bin"],
|
|
@@ -15493,17 +15524,17 @@
|
|
|
15493
15524
|
async function parseSLPK2(data, options = {}) {
|
|
15494
15525
|
return (await parseSLPK(new DataViewFile(new DataView(data)))).getFile(options.slpk?.path ?? "", options.slpk?.pathMode);
|
|
15495
15526
|
}
|
|
15496
|
-
var
|
|
15527
|
+
var VERSION11, SLPKLoader;
|
|
15497
15528
|
var init_i3s_slpk_loader = __esm({
|
|
15498
15529
|
"src/i3s-slpk-loader.ts"() {
|
|
15499
15530
|
init_src2();
|
|
15500
15531
|
init_parse_slpk();
|
|
15501
|
-
|
|
15532
|
+
VERSION11 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
15502
15533
|
SLPKLoader = {
|
|
15503
15534
|
name: "I3S SLPK (Scene Layer Package)",
|
|
15504
15535
|
id: "slpk",
|
|
15505
15536
|
module: "i3s",
|
|
15506
|
-
version:
|
|
15537
|
+
version: VERSION11,
|
|
15507
15538
|
mimeTypes: ["application/octet-stream"],
|
|
15508
15539
|
parse: parseSLPK2,
|
|
15509
15540
|
extensions: ["slpk"],
|
|
@@ -15556,16 +15587,16 @@
|
|
|
15556
15587
|
}
|
|
15557
15588
|
return parseBuildingSceneLayer(data, context.url);
|
|
15558
15589
|
}
|
|
15559
|
-
var
|
|
15590
|
+
var VERSION12, I3SBuildingSceneLayerLoader;
|
|
15560
15591
|
var init_i3s_building_scene_layer_loader = __esm({
|
|
15561
15592
|
"src/i3s-building-scene-layer-loader.ts"() {
|
|
15562
15593
|
init_parse_i3s_building_scene_layer();
|
|
15563
|
-
|
|
15594
|
+
VERSION12 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
|
|
15564
15595
|
I3SBuildingSceneLayerLoader = {
|
|
15565
15596
|
name: "I3S Building Scene Layer",
|
|
15566
15597
|
id: "i3s-building-scene-layer",
|
|
15567
15598
|
module: "i3s",
|
|
15568
|
-
version:
|
|
15599
|
+
version: VERSION12,
|
|
15569
15600
|
mimeTypes: ["application/json"],
|
|
15570
15601
|
parse: parse4,
|
|
15571
15602
|
extensions: ["json"],
|
|
@@ -15646,16 +15677,16 @@
|
|
|
15646
15677
|
async function parse5(data) {
|
|
15647
15678
|
return parseWebscene(data);
|
|
15648
15679
|
}
|
|
15649
|
-
var
|
|
15680
|
+
var VERSION13, ArcGISWebSceneLoader;
|
|
15650
15681
|
var init_arcgis_webscene_loader = __esm({
|
|
15651
15682
|
"src/arcgis-webscene-loader.ts"() {
|
|
15652
15683
|
init_parse_arcgis_webscene();
|
|
15653
|
-
|
|
15654
|
-
|
|
15684
|
+
VERSION13 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
|
|
15685
|
+
ArcGISWebSceneLoader = {
|
|
15655
15686
|
name: "ArcGIS Web Scene Loader",
|
|
15656
15687
|
id: "arcgis-web-scene",
|
|
15657
15688
|
module: "i3s",
|
|
15658
|
-
version:
|
|
15689
|
+
version: VERSION13,
|
|
15659
15690
|
mimeTypes: ["application/json"],
|
|
15660
15691
|
parse: parse5,
|
|
15661
15692
|
extensions: ["json"],
|
|
@@ -15667,7 +15698,7 @@
|
|
|
15667
15698
|
// src/index.ts
|
|
15668
15699
|
var src_exports = {};
|
|
15669
15700
|
__export(src_exports, {
|
|
15670
|
-
|
|
15701
|
+
ArcGISWebSceneLoader: () => ArcGISWebSceneLoader,
|
|
15671
15702
|
COORDINATE_SYSTEM: () => COORDINATE_SYSTEM,
|
|
15672
15703
|
I3SAttributeLoader: () => I3SAttributeLoader,
|
|
15673
15704
|
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.25" !== 'undefined' ? "4.0.0-alpha.25" : '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.25" !== 'undefined' ? "4.0.0-alpha.25" : '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,EAA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AAChB,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,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,IAAAhB,MAAA,CAAAqB,cAAA,CAAAX,MAAA,EAAAM,GAAA,EAAAhB,MAAA,CAAA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,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"}
|
|
@@ -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.25" !== 'undefined' ? "4.0.0-alpha.25" : '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,IAAMC,OAAO,GAAG,uBAAkB,KAAK,WAAW,sBAAiB,MAAM;AAIlE,IAAMC,2BAIZ,GAAG;EACFC,IAAI,EAAE,0BAA0B;EAChCC,EAAE,EAAE,0BAA0B;EAC9BC,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,2BAAA,GAAAA,2BAAA;AAAA,SAEaM,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,QACEC,IAAiB,EACjBb,OAAuB,EACvBc,OAAuB;IAAA,OAAAJ,YAAA,CAAAD,OAAA,CAAAM,IAAA,UAAAC,SAAAC,QAAA;MAAA,kBAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;QAAA;UAAA,IAElBL,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEM,GAAG;YAAAH,QAAA,CAAAE,IAAA;YAAA;UAAA;UAAA,MACT,IAAIE,KAAK,CAAC,qBAAqB,CAAC;QAAA;UAAA,OAAAJ,QAAA,CAAAK,MAAA,WAGjC,IAAAC,mDAAuB,EAACV,IAAI,EAAEC,OAAO,CAACM,GAAG,CAAC;QAAA;QAAA;UAAA,OAAAH,QAAA,CAAAO,IAAA;MAAA;IAAA,GAAAZ,OAAA;EAAA,CAClD;EAAA,OAAAP,MAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA"}
|
|
@@ -8,7 +8,7 @@ exports.I3SContentLoader = void 0;
|
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@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.25" !== 'undefined' ? "4.0.0-alpha.25" : '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,EA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,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.25" !== 'undefined' ? "4.0.0-alpha.25" : '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';
|