@loaders.gl/i3s 3.3.0-alpha.12 → 3.3.0-alpha.14
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 +54 -54
- package/dist/es5/arcgis-webscene-loader.js +1 -1
- package/dist/es5/i3s-attribute-loader.js +1 -1
- package/dist/es5/i3s-building-scene-layer-loader.js +1 -1
- package/dist/es5/i3s-content-loader.js +1 -1
- package/dist/es5/i3s-loader.js +1 -1
- package/dist/es5/i3s-node-page-loader.js +1 -1
- package/dist/esm/arcgis-webscene-loader.js +1 -1
- package/dist/esm/i3s-attribute-loader.js +1 -1
- package/dist/esm/i3s-building-scene-layer-loader.js +1 -1
- package/dist/esm/i3s-content-loader.js +1 -1
- package/dist/esm/i3s-loader.js +1 -1
- package/dist/esm/i3s-node-page-loader.js +1 -1
- package/dist/i3s-content-nodejs-worker.js +54 -54
- package/dist/i3s-content-nodejs-worker.js.map +3 -3
- package/dist/i3s-content-worker.js +38 -45
- package/package.json +8 -8
package/dist/dist.min.js
CHANGED
|
@@ -709,46 +709,7 @@
|
|
|
709
709
|
}
|
|
710
710
|
});
|
|
711
711
|
|
|
712
|
-
// ../loader-utils/src/lib/binary-utils/buffer-utils.ts
|
|
713
|
-
function isBuffer(value) {
|
|
714
|
-
return value && typeof value === "object" && value.isBuffer;
|
|
715
|
-
}
|
|
716
|
-
function bufferToArrayBuffer(buffer) {
|
|
717
|
-
if (isBuffer(buffer)) {
|
|
718
|
-
const typedArray = new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.length);
|
|
719
|
-
return typedArray.slice().buffer;
|
|
720
|
-
}
|
|
721
|
-
return buffer;
|
|
722
|
-
}
|
|
723
|
-
var init_buffer_utils = __esm({
|
|
724
|
-
"../loader-utils/src/lib/binary-utils/buffer-utils.ts"() {
|
|
725
|
-
}
|
|
726
|
-
});
|
|
727
|
-
|
|
728
712
|
// ../loader-utils/src/lib/binary-utils/array-buffer-utils.ts
|
|
729
|
-
function toArrayBuffer(data) {
|
|
730
|
-
if (isBuffer(data)) {
|
|
731
|
-
return bufferToArrayBuffer(data);
|
|
732
|
-
}
|
|
733
|
-
if (data instanceof ArrayBuffer) {
|
|
734
|
-
return data;
|
|
735
|
-
}
|
|
736
|
-
if (ArrayBuffer.isView(data)) {
|
|
737
|
-
if (data.byteOffset === 0 && data.byteLength === data.buffer.byteLength) {
|
|
738
|
-
return data.buffer;
|
|
739
|
-
}
|
|
740
|
-
return data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength);
|
|
741
|
-
}
|
|
742
|
-
if (typeof data === "string") {
|
|
743
|
-
const text = data;
|
|
744
|
-
const uint8Array = new TextEncoder().encode(text);
|
|
745
|
-
return uint8Array.buffer;
|
|
746
|
-
}
|
|
747
|
-
if (data && typeof data === "object" && data._toArrayBuffer) {
|
|
748
|
-
return data._toArrayBuffer();
|
|
749
|
-
}
|
|
750
|
-
throw new Error("toArrayBuffer");
|
|
751
|
-
}
|
|
752
713
|
function compareArrayBuffers(arrayBuffer1, arrayBuffer2, byteLength) {
|
|
753
714
|
byteLength = byteLength || arrayBuffer1.byteLength;
|
|
754
715
|
if (arrayBuffer1.byteLength < byteLength || arrayBuffer2.byteLength < byteLength) {
|
|
@@ -776,7 +737,6 @@
|
|
|
776
737
|
}
|
|
777
738
|
var init_array_buffer_utils = __esm({
|
|
778
739
|
"../loader-utils/src/lib/binary-utils/array-buffer-utils.ts"() {
|
|
779
|
-
init_buffer_utils();
|
|
780
740
|
}
|
|
781
741
|
});
|
|
782
742
|
|
|
@@ -858,6 +818,45 @@
|
|
|
858
818
|
}
|
|
859
819
|
});
|
|
860
820
|
|
|
821
|
+
// (disabled):../loader-utils/src/lib/node/buffer
|
|
822
|
+
var init_buffer = __esm({
|
|
823
|
+
"(disabled):../loader-utils/src/lib/node/buffer"() {
|
|
824
|
+
}
|
|
825
|
+
});
|
|
826
|
+
|
|
827
|
+
// ../loader-utils/src/lib/binary-utils/memory-conversion-utils.ts
|
|
828
|
+
function isBuffer(value) {
|
|
829
|
+
return value && typeof value === "object" && value.isBuffer;
|
|
830
|
+
}
|
|
831
|
+
function toArrayBuffer2(data) {
|
|
832
|
+
if (isBuffer(data)) {
|
|
833
|
+
return node2.toArrayBuffer(data);
|
|
834
|
+
}
|
|
835
|
+
if (data instanceof ArrayBuffer) {
|
|
836
|
+
return data;
|
|
837
|
+
}
|
|
838
|
+
if (ArrayBuffer.isView(data)) {
|
|
839
|
+
if (data.byteOffset === 0 && data.byteLength === data.buffer.byteLength) {
|
|
840
|
+
return data.buffer;
|
|
841
|
+
}
|
|
842
|
+
return data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength);
|
|
843
|
+
}
|
|
844
|
+
if (typeof data === "string") {
|
|
845
|
+
const text = data;
|
|
846
|
+
const uint8Array = new TextEncoder().encode(text);
|
|
847
|
+
return uint8Array.buffer;
|
|
848
|
+
}
|
|
849
|
+
if (data && typeof data === "object" && data._toArrayBuffer) {
|
|
850
|
+
return data._toArrayBuffer();
|
|
851
|
+
}
|
|
852
|
+
throw new Error("toArrayBuffer");
|
|
853
|
+
}
|
|
854
|
+
var init_memory_conversion_utils = __esm({
|
|
855
|
+
"../loader-utils/src/lib/binary-utils/memory-conversion-utils.ts"() {
|
|
856
|
+
init_buffer();
|
|
857
|
+
}
|
|
858
|
+
});
|
|
859
|
+
|
|
861
860
|
// ../loader-utils/src/lib/path-utils/path.ts
|
|
862
861
|
var path_exports = {};
|
|
863
862
|
__export(path_exports, {
|
|
@@ -901,6 +900,7 @@
|
|
|
901
900
|
init_async_iteration();
|
|
902
901
|
init_file_aliases();
|
|
903
902
|
init_json_loader();
|
|
903
|
+
init_memory_conversion_utils();
|
|
904
904
|
init_path();
|
|
905
905
|
}
|
|
906
906
|
});
|
|
@@ -2262,7 +2262,7 @@
|
|
|
2262
2262
|
if (done) {
|
|
2263
2263
|
return;
|
|
2264
2264
|
}
|
|
2265
|
-
yield
|
|
2265
|
+
yield toArrayBuffer2(value);
|
|
2266
2266
|
}
|
|
2267
2267
|
} catch (error) {
|
|
2268
2268
|
reader.releaseLock();
|
|
@@ -2270,7 +2270,7 @@
|
|
|
2270
2270
|
}
|
|
2271
2271
|
async function* makeNodeStreamIterator(stream, options) {
|
|
2272
2272
|
for await (const chunk of stream) {
|
|
2273
|
-
yield
|
|
2273
|
+
yield toArrayBuffer2(chunk);
|
|
2274
2274
|
}
|
|
2275
2275
|
}
|
|
2276
2276
|
var init_make_stream_iterator = __esm({
|
|
@@ -10400,10 +10400,10 @@
|
|
|
10400
10400
|
return this.nodePages[pageIndex].nodes[nodeIndex];
|
|
10401
10401
|
}
|
|
10402
10402
|
async formTileFromNodePages(id) {
|
|
10403
|
-
const
|
|
10403
|
+
const node3 = await this.getNodeById(id);
|
|
10404
10404
|
const children = [];
|
|
10405
10405
|
const childNodesPromises = [];
|
|
10406
|
-
for (const child of
|
|
10406
|
+
for (const child of node3.children || []) {
|
|
10407
10407
|
childNodesPromises.push(this.getNodeById(child));
|
|
10408
10408
|
}
|
|
10409
10409
|
const childNodes = await Promise.all(childNodesPromises);
|
|
@@ -10419,25 +10419,25 @@
|
|
|
10419
10419
|
let textureFormat = "jpg";
|
|
10420
10420
|
let attributeUrls = [];
|
|
10421
10421
|
let isDracoGeometry = false;
|
|
10422
|
-
if (
|
|
10423
|
-
const { url, isDracoGeometry: isDracoGeometryResult } =
|
|
10422
|
+
if (node3 && node3.mesh) {
|
|
10423
|
+
const { url, isDracoGeometry: isDracoGeometryResult } = node3.mesh.geometry && this.getContentUrl(node3.mesh.geometry) || { isDracoGeometry: false };
|
|
10424
10424
|
contentUrl = url;
|
|
10425
10425
|
isDracoGeometry = isDracoGeometryResult;
|
|
10426
|
-
const { textureData, materialDefinition: nodeMaterialDefinition } = this.getInformationFromMaterial(
|
|
10426
|
+
const { textureData, materialDefinition: nodeMaterialDefinition } = this.getInformationFromMaterial(node3.mesh.material);
|
|
10427
10427
|
materialDefinition = nodeMaterialDefinition;
|
|
10428
10428
|
textureFormat = textureData.format || textureFormat;
|
|
10429
10429
|
if (textureData.name) {
|
|
10430
|
-
textureUrl = `${this.tileset.url}/nodes/${
|
|
10430
|
+
textureUrl = `${this.tileset.url}/nodes/${node3.mesh.material.resource}/textures/${textureData.name}`;
|
|
10431
10431
|
}
|
|
10432
10432
|
if (this.tileset.attributeStorageInfo) {
|
|
10433
|
-
attributeUrls = generateTilesetAttributeUrls(this.tileset,
|
|
10433
|
+
attributeUrls = generateTilesetAttributeUrls(this.tileset, node3.mesh.attribute.resource);
|
|
10434
10434
|
}
|
|
10435
10435
|
}
|
|
10436
|
-
const lodSelection = this.getLodSelection(
|
|
10436
|
+
const lodSelection = this.getLodSelection(node3);
|
|
10437
10437
|
return normalizeTileNonUrlData({
|
|
10438
10438
|
id: id.toString(),
|
|
10439
10439
|
lodSelection,
|
|
10440
|
-
obb:
|
|
10440
|
+
obb: node3.obb,
|
|
10441
10441
|
contentUrl,
|
|
10442
10442
|
textureUrl,
|
|
10443
10443
|
attributeUrls,
|
|
@@ -10467,17 +10467,17 @@
|
|
|
10467
10467
|
}
|
|
10468
10468
|
return result;
|
|
10469
10469
|
}
|
|
10470
|
-
getLodSelection(
|
|
10470
|
+
getLodSelection(node3) {
|
|
10471
10471
|
const lodSelection = [];
|
|
10472
10472
|
if (this.lodSelectionMetricType === "maxScreenThresholdSQ") {
|
|
10473
10473
|
lodSelection.push({
|
|
10474
10474
|
metricType: "maxScreenThreshold",
|
|
10475
|
-
maxError: Math.sqrt(
|
|
10475
|
+
maxError: Math.sqrt(node3.lodThreshold / (Math.PI * 0.25))
|
|
10476
10476
|
});
|
|
10477
10477
|
}
|
|
10478
10478
|
lodSelection.push({
|
|
10479
10479
|
metricType: this.lodSelectionMetricType,
|
|
10480
|
-
maxError:
|
|
10480
|
+
maxError: node3.lodThreshold
|
|
10481
10481
|
});
|
|
10482
10482
|
return lodSelection;
|
|
10483
10483
|
}
|
|
@@ -8,7 +8,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 "3.3.0-alpha.
|
|
11
|
+
var VERSION = typeof "3.3.0-alpha.14" !== 'undefined' ? "3.3.0-alpha.14" : 'beta';
|
|
12
12
|
|
|
13
13
|
var ArcGisWebSceneLoader = {
|
|
14
14
|
name: 'ArcGIS Web Scene Loader',
|
|
@@ -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 "3.3.0-alpha.
|
|
18
|
+
var VERSION = typeof "3.3.0-alpha.14" !== 'undefined' ? "3.3.0-alpha.14" : 'latest';
|
|
19
19
|
var EMPTY_VALUE = '';
|
|
20
20
|
var REJECTED_STATUS = 'rejected';
|
|
21
21
|
var I3SAttributeLoader = {
|
|
@@ -9,7 +9,7 @@ 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
11
|
|
|
12
|
-
var VERSION = typeof "3.3.0-alpha.
|
|
12
|
+
var VERSION = typeof "3.3.0-alpha.14" !== 'undefined' ? "3.3.0-alpha.14" : 'beta';
|
|
13
13
|
var I3SBuildingSceneLayerLoader = {
|
|
14
14
|
name: 'I3S Building Scene Layer',
|
|
15
15
|
id: 'i3s-building-scene-layer',
|
|
@@ -10,7 +10,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
10
10
|
var _workerUtils = require("@loaders.gl/worker-utils");
|
|
11
11
|
var _parseI3sTileContent = require("./lib/parsers/parse-i3s-tile-content");
|
|
12
12
|
|
|
13
|
-
var VERSION = typeof "3.3.0-alpha.
|
|
13
|
+
var VERSION = typeof "3.3.0-alpha.14" !== 'undefined' ? "3.3.0-alpha.14" : 'beta';
|
|
14
14
|
var I3SContentLoader = {
|
|
15
15
|
name: 'I3S Content (Indexed Scene Layers)',
|
|
16
16
|
id: _workerUtils.isBrowser ? 'i3s-content' : 'i3s-content-nodejs',
|
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 "3.3.0-alpha.
|
|
15
|
+
var VERSION = typeof "3.3.0-alpha.14" !== 'undefined' ? "3.3.0-alpha.14" : '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';
|
|
@@ -7,7 +7,7 @@ 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 "3.3.0-alpha.
|
|
10
|
+
var VERSION = typeof "3.3.0-alpha.14" !== 'undefined' ? "3.3.0-alpha.14" : 'latest';
|
|
11
11
|
function parseNodePage(_x) {
|
|
12
12
|
return _parseNodePage.apply(this, arguments);
|
|
13
13
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { parseWebscene } from './lib/parsers/parse-arcgis-webscene';
|
|
2
2
|
|
|
3
|
-
const VERSION = typeof "3.3.0-alpha.
|
|
3
|
+
const VERSION = typeof "3.3.0-alpha.14" !== 'undefined' ? "3.3.0-alpha.14" : 'beta';
|
|
4
4
|
|
|
5
5
|
export const ArcGisWebSceneLoader = {
|
|
6
6
|
name: 'ArcGIS Web Scene Loader',
|
|
@@ -2,7 +2,7 @@ import { load } from '@loaders.gl/core';
|
|
|
2
2
|
import { parseI3STileAttribute } from './lib/parsers/parse-i3s-attribute';
|
|
3
3
|
import { getUrlWithToken } from './lib/utils/url-utils';
|
|
4
4
|
|
|
5
|
-
const VERSION = typeof "3.3.0-alpha.
|
|
5
|
+
const VERSION = typeof "3.3.0-alpha.14" !== 'undefined' ? "3.3.0-alpha.14" : 'latest';
|
|
6
6
|
const EMPTY_VALUE = '';
|
|
7
7
|
const REJECTED_STATUS = 'rejected';
|
|
8
8
|
export const I3SAttributeLoader = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { parseBuildingSceneLayer } from './lib/parsers/parse-i3s-building-scene-layer';
|
|
2
2
|
|
|
3
|
-
const VERSION = typeof "3.3.0-alpha.
|
|
3
|
+
const VERSION = typeof "3.3.0-alpha.14" !== 'undefined' ? "3.3.0-alpha.14" : 'beta';
|
|
4
4
|
export const I3SBuildingSceneLayerLoader = {
|
|
5
5
|
name: 'I3S Building Scene Layer',
|
|
6
6
|
id: 'i3s-building-scene-layer',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isBrowser } from '@loaders.gl/worker-utils';
|
|
2
2
|
import { parseI3STileContent } from './lib/parsers/parse-i3s-tile-content';
|
|
3
3
|
|
|
4
|
-
const VERSION = typeof "3.3.0-alpha.
|
|
4
|
+
const VERSION = typeof "3.3.0-alpha.14" !== 'undefined' ? "3.3.0-alpha.14" : 'beta';
|
|
5
5
|
export const I3SContentLoader = {
|
|
6
6
|
name: 'I3S Content (Indexed Scene Layers)',
|
|
7
7
|
id: isBrowser ? 'i3s-content' : 'i3s-content-nodejs',
|
package/dist/esm/i3s-loader.js
CHANGED
|
@@ -2,7 +2,7 @@ import { parse } from '@loaders.gl/core';
|
|
|
2
2
|
import { I3SContentLoader } from './i3s-content-loader';
|
|
3
3
|
import { normalizeTileData, normalizeTilesetData } from './lib/parsers/parse-i3s';
|
|
4
4
|
import { COORDINATE_SYSTEM } from './lib/parsers/constants';
|
|
5
|
-
const VERSION = typeof "3.3.0-alpha.
|
|
5
|
+
const VERSION = typeof "3.3.0-alpha.14" !== 'undefined' ? "3.3.0-alpha.14" : 'latest';
|
|
6
6
|
const TILESET_REGEX = /layers\/[0-9]+$/;
|
|
7
7
|
const TILE_HEADER_REGEX = /nodes\/([0-9-]+|root)$/;
|
|
8
8
|
const SLPK_HEX = '504b0304';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
const VERSION = typeof "3.3.0-alpha.
|
|
2
|
+
const VERSION = typeof "3.3.0-alpha.14" !== 'undefined' ? "3.3.0-alpha.14" : 'latest';
|
|
3
3
|
async function parseNodePage(data) {
|
|
4
4
|
return JSON.parse(new TextDecoder().decode(data));
|
|
5
5
|
}
|