@loaders.gl/i3s 3.0.13 → 3.0.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.
Files changed (36) hide show
  1. package/dist/dist.es5.min.js +1 -1
  2. package/dist/dist.es5.min.js.map +1 -1
  3. package/dist/dist.min.js +1 -1
  4. package/dist/dist.min.js.map +1 -1
  5. package/dist/es5/bundle.js +2 -2
  6. package/dist/es5/bundle.js.map +1 -1
  7. package/dist/es5/i3s-attribute-loader.js +132 -53
  8. package/dist/es5/i3s-attribute-loader.js.map +1 -1
  9. package/dist/es5/i3s-content-loader.js +36 -10
  10. package/dist/es5/i3s-content-loader.js.map +1 -1
  11. package/dist/es5/i3s-loader.js +175 -51
  12. package/dist/es5/i3s-loader.js.map +1 -1
  13. package/dist/es5/i3s-node-page-loader.js +51 -8
  14. package/dist/es5/i3s-node-page-loader.js.map +1 -1
  15. package/dist/es5/index.js +4 -4
  16. package/dist/es5/lib/helpers/i3s-nodepages-tiles.js +313 -163
  17. package/dist/es5/lib/helpers/i3s-nodepages-tiles.js.map +1 -1
  18. package/dist/es5/lib/parsers/constants.js +9 -9
  19. package/dist/es5/lib/parsers/constants.js.map +1 -1
  20. package/dist/es5/lib/parsers/parse-i3s-attribute.js +68 -26
  21. package/dist/es5/lib/parsers/parse-i3s-attribute.js.map +1 -1
  22. package/dist/es5/lib/parsers/parse-i3s-tile-content.js +405 -276
  23. package/dist/es5/lib/parsers/parse-i3s-tile-content.js.map +1 -1
  24. package/dist/es5/lib/parsers/parse-i3s.js +70 -31
  25. package/dist/es5/lib/parsers/parse-i3s.js.map +1 -1
  26. package/dist/es5/lib/utils/convert-i3s-obb-to-mbs.js +8 -4
  27. package/dist/es5/lib/utils/convert-i3s-obb-to-mbs.js.map +1 -1
  28. package/dist/es5/lib/utils/url-utils.js +14 -17
  29. package/dist/es5/lib/utils/url-utils.js.map +1 -1
  30. package/dist/esm/i3s-attribute-loader.js +1 -1
  31. package/dist/esm/i3s-content-loader.js +1 -1
  32. package/dist/esm/i3s-loader.js +1 -1
  33. package/dist/esm/i3s-node-page-loader.js +1 -1
  34. package/dist/i3s-content-worker.js +1 -1
  35. package/dist/i3s-content-worker.js.map +1 -1
  36. package/package.json +9 -9
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
 
3
- const moduleExports = require('./index');
3
+ var moduleExports = require('./index');
4
4
 
5
- const _global = typeof window === 'undefined' ? global : window;
5
+ var _global = typeof window === 'undefined' ? global : window;
6
6
 
7
7
  _global.loaders = _global.loaders || {};
8
8
  module.exports = Object.assign(_global.loaders, moduleExports);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/bundle.ts"],"names":["moduleExports","require","_global","window","global","loaders","module","exports","Object","assign"],"mappings":";;AACA,MAAMA,aAAa,GAAGC,OAAO,CAAC,SAAD,CAA7B;;AACA,MAAMC,OAAO,GAAG,OAAOC,MAAP,KAAkB,WAAlB,GAAgCC,MAAhC,GAAyCD,MAAzD;;AACAD,OAAO,CAACG,OAAR,GAAkBH,OAAO,CAACG,OAAR,IAAmB,EAArC;AACAC,MAAM,CAACC,OAAP,GAAiBC,MAAM,CAACC,MAAP,CAAcP,OAAO,CAACG,OAAtB,EAA+BL,aAA/B,CAAjB","sourcesContent":["// @ts-nocheck\nconst moduleExports = require('./index');\nconst _global = typeof window === 'undefined' ? global : window;\n_global.loaders = _global.loaders || {};\nmodule.exports = Object.assign(_global.loaders, moduleExports);\n"],"file":"bundle.js"}
1
+ {"version":3,"sources":["../../src/bundle.ts"],"names":["moduleExports","require","_global","window","global","loaders","module","exports","Object","assign"],"mappings":";;AACA,IAAMA,aAAa,GAAGC,OAAO,CAAC,SAAD,CAA7B;;AACA,IAAMC,OAAO,GAAG,OAAOC,MAAP,KAAkB,WAAlB,GAAgCC,MAAhC,GAAyCD,MAAzD;;AACAD,OAAO,CAACG,OAAR,GAAkBH,OAAO,CAACG,OAAR,IAAmB,EAArC;AACAC,MAAM,CAACC,OAAP,GAAiBC,MAAM,CAACC,MAAP,CAAcP,OAAO,CAACG,OAAtB,EAA+BL,aAA/B,CAAjB","sourcesContent":["// @ts-nocheck\nconst moduleExports = require('./index');\nconst _global = typeof window === 'undefined' ? global : window;\n_global.loaders = _global.loaders || {};\nmodule.exports = Object.assign(_global.loaders, moduleExports);\n"],"file":"bundle.js"}
@@ -1,82 +1,159 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
8
  exports.loadFeatureAttributes = loadFeatureAttributes;
7
9
  exports.I3SAttributeLoader = void 0;
8
10
 
11
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
12
+
13
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
14
+
15
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
16
+
9
17
  var _core = require("@loaders.gl/core");
10
18
 
11
19
  var _parseI3sAttribute = require("./lib/parsers/parse-i3s-attribute");
12
20
 
13
21
  var _urlUtils = require("./lib/utils/url-utils");
14
22
 
15
- const VERSION = typeof "3.0.13" !== 'undefined' ? "3.0.13" : 'latest';
16
- const EMPTY_VALUE = '';
17
- const REJECTED_STATUS = 'rejected';
18
- const I3SAttributeLoader = {
23
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
24
+
25
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
26
+
27
+ var VERSION = typeof "3.0.14" !== 'undefined' ? "3.0.14" : 'latest';
28
+ var EMPTY_VALUE = '';
29
+ var REJECTED_STATUS = 'rejected';
30
+ var I3SAttributeLoader = {
19
31
  name: 'I3S Attribute',
20
32
  id: 'i3s-attribute',
21
33
  module: 'i3s',
22
34
  version: VERSION,
23
35
  mimeTypes: ['application/binary'],
24
- parse,
36
+ parse: parse,
25
37
  extensions: ['bin'],
26
38
  options: {},
27
39
  binary: true
28
40
  };
29
41
  exports.I3SAttributeLoader = I3SAttributeLoader;
30
42
 
31
- async function parse(data, options) {
32
- data = (0, _parseI3sAttribute.parseI3STileAttribute)(data, options);
33
- return data;
43
+ function parse(_x, _x2) {
44
+ return _parse.apply(this, arguments);
34
45
  }
35
46
 
36
- async function loadFeatureAttributes(tile, featureId, options = {}) {
37
- const {
38
- attributeStorageInfo,
39
- attributeUrls
40
- } = getAttributesData(tile);
41
-
42
- if (!attributeStorageInfo || !attributeUrls || !featureId) {
43
- return null;
44
- }
45
-
46
- let attributes = [];
47
- const attributeLoadPromises = [];
48
-
49
- for (let index = 0; index < attributeStorageInfo.length; index++) {
50
- var _options$i3s;
51
-
52
- const url = (0, _urlUtils.getUrlWithToken)(attributeUrls[index], (_options$i3s = options.i3s) === null || _options$i3s === void 0 ? void 0 : _options$i3s.token);
53
- const attributeName = attributeStorageInfo[index].name;
54
- const attributeType = getAttributeValueType(attributeStorageInfo[index]);
55
- const loadOptions = { ...options,
56
- attributeName,
57
- attributeType
58
- };
59
- const promise = (0, _core.load)(url, I3SAttributeLoader, loadOptions);
60
- attributeLoadPromises.push(promise);
61
- }
62
-
63
- try {
64
- attributes = await Promise.allSettled(attributeLoadPromises);
65
- } catch (error) {}
47
+ function _parse() {
48
+ _parse = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(data, options) {
49
+ return _regenerator.default.wrap(function _callee$(_context) {
50
+ while (1) {
51
+ switch (_context.prev = _context.next) {
52
+ case 0:
53
+ data = (0, _parseI3sAttribute.parseI3STileAttribute)(data, options);
54
+ return _context.abrupt("return", data);
55
+
56
+ case 2:
57
+ case "end":
58
+ return _context.stop();
59
+ }
60
+ }
61
+ }, _callee);
62
+ }));
63
+ return _parse.apply(this, arguments);
64
+ }
66
65
 
67
- if (!attributes.length) {
68
- return null;
69
- }
66
+ function loadFeatureAttributes(_x3, _x4) {
67
+ return _loadFeatureAttributes.apply(this, arguments);
68
+ }
70
69
 
71
- return generateAttributesByFeatureId(attributes, attributeStorageInfo, featureId);
70
+ function _loadFeatureAttributes() {
71
+ _loadFeatureAttributes = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2(tile, featureId) {
72
+ var options,
73
+ _getAttributesData,
74
+ attributeStorageInfo,
75
+ attributeUrls,
76
+ attributes,
77
+ attributeLoadPromises,
78
+ index,
79
+ _options$i3s,
80
+ url,
81
+ attributeName,
82
+ attributeType,
83
+ loadOptions,
84
+ promise,
85
+ _args2 = arguments;
86
+
87
+ return _regenerator.default.wrap(function _callee2$(_context2) {
88
+ while (1) {
89
+ switch (_context2.prev = _context2.next) {
90
+ case 0:
91
+ options = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : {};
92
+ _getAttributesData = getAttributesData(tile), attributeStorageInfo = _getAttributesData.attributeStorageInfo, attributeUrls = _getAttributesData.attributeUrls;
93
+
94
+ if (!(!attributeStorageInfo || !attributeUrls || !featureId)) {
95
+ _context2.next = 4;
96
+ break;
97
+ }
98
+
99
+ return _context2.abrupt("return", null);
100
+
101
+ case 4:
102
+ attributes = [];
103
+ attributeLoadPromises = [];
104
+
105
+ for (index = 0; index < attributeStorageInfo.length; index++) {
106
+ url = (0, _urlUtils.getUrlWithToken)(attributeUrls[index], (_options$i3s = options.i3s) === null || _options$i3s === void 0 ? void 0 : _options$i3s.token);
107
+ attributeName = attributeStorageInfo[index].name;
108
+ attributeType = getAttributeValueType(attributeStorageInfo[index]);
109
+ loadOptions = _objectSpread(_objectSpread({}, options), {}, {
110
+ attributeName: attributeName,
111
+ attributeType: attributeType
112
+ });
113
+ promise = (0, _core.load)(url, I3SAttributeLoader, loadOptions);
114
+ attributeLoadPromises.push(promise);
115
+ }
116
+
117
+ _context2.prev = 7;
118
+ _context2.next = 10;
119
+ return Promise.allSettled(attributeLoadPromises);
120
+
121
+ case 10:
122
+ attributes = _context2.sent;
123
+ _context2.next = 15;
124
+ break;
125
+
126
+ case 13:
127
+ _context2.prev = 13;
128
+ _context2.t0 = _context2["catch"](7);
129
+
130
+ case 15:
131
+ if (attributes.length) {
132
+ _context2.next = 17;
133
+ break;
134
+ }
135
+
136
+ return _context2.abrupt("return", null);
137
+
138
+ case 17:
139
+ return _context2.abrupt("return", generateAttributesByFeatureId(attributes, attributeStorageInfo, featureId));
140
+
141
+ case 18:
142
+ case "end":
143
+ return _context2.stop();
144
+ }
145
+ }
146
+ }, _callee2, null, [[7, 13]]);
147
+ }));
148
+ return _loadFeatureAttributes.apply(this, arguments);
72
149
  }
73
150
 
74
151
  function getAttributesData(tile) {
75
- const attributeStorageInfo = tile && tile.tileset && tile.tileset.tileset && tile.tileset.tileset.attributeStorageInfo;
76
- const attributeUrls = tile && tile.header && tile.header.attributeUrls;
152
+ var attributeStorageInfo = tile && tile.tileset && tile.tileset.tileset && tile.tileset.tileset.attributeStorageInfo;
153
+ var attributeUrls = tile && tile.header && tile.header.attributeUrls;
77
154
  return {
78
- attributeStorageInfo,
79
- attributeUrls
155
+ attributeStorageInfo: attributeStorageInfo,
156
+ attributeUrls: attributeUrls
80
157
  };
81
158
  }
82
159
 
@@ -91,13 +168,15 @@ function getAttributeValueType(attribute) {
91
168
  }
92
169
 
93
170
  function generateAttributesByFeatureId(attributes, attributeStorageInfo, featureId) {
94
- const objectIds = attributes.find(attribute => attribute.value.OBJECTID);
171
+ var objectIds = attributes.find(function (attribute) {
172
+ return attribute.value.OBJECTID;
173
+ });
95
174
 
96
175
  if (!objectIds) {
97
176
  return null;
98
177
  }
99
178
 
100
- const attributeIndex = objectIds.value.OBJECTID.indexOf(featureId);
179
+ var attributeIndex = objectIds.value.OBJECTID.indexOf(featureId);
101
180
 
102
181
  if (attributeIndex < 0) {
103
182
  return null;
@@ -107,11 +186,11 @@ function generateAttributesByFeatureId(attributes, attributeStorageInfo, feature
107
186
  }
108
187
 
109
188
  function getFeatureAttributesByIndex(attributes, featureIdIndex, attributeStorageInfo) {
110
- const attributesObject = {};
189
+ var attributesObject = {};
111
190
 
112
- for (let index = 0; index < attributeStorageInfo.length; index++) {
113
- const attributeName = attributeStorageInfo[index].name;
114
- const attribute = getAttributeByIndexAndAttributeName(attributes, index, attributeName);
191
+ for (var index = 0; index < attributeStorageInfo.length; index++) {
192
+ var attributeName = attributeStorageInfo[index].name;
193
+ var attribute = getAttributeByIndexAndAttributeName(attributes, index, attributeName);
115
194
  attributesObject[attributeName] = formatAttributeValue(attribute, featureIdIndex);
116
195
  }
117
196
 
@@ -119,7 +198,7 @@ function getFeatureAttributesByIndex(attributes, featureIdIndex, attributeStorag
119
198
  }
120
199
 
121
200
  function getAttributeByIndexAndAttributeName(attributes, index, attributesName) {
122
- const attributeObject = attributes[index];
201
+ var attributeObject = attributes[index];
123
202
 
124
203
  if (attributeObject.status === REJECTED_STATUS) {
125
204
  return null;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/i3s-attribute-loader.ts"],"names":["VERSION","EMPTY_VALUE","REJECTED_STATUS","I3SAttributeLoader","name","id","module","version","mimeTypes","parse","extensions","options","binary","data","loadFeatureAttributes","tile","featureId","attributeStorageInfo","attributeUrls","getAttributesData","attributes","attributeLoadPromises","index","length","url","i3s","token","attributeName","attributeType","getAttributeValueType","loadOptions","promise","push","Promise","allSettled","error","generateAttributesByFeatureId","tileset","header","attribute","hasOwnProperty","attributeValues","valueType","objectIds","find","value","OBJECTID","attributeIndex","indexOf","getFeatureAttributesByIndex","featureIdIndex","attributesObject","getAttributeByIndexAndAttributeName","formatAttributeValue","attributesName","attributeObject","status","toString","replace","trim"],"mappings":";;;;;;;;AACA;;AACA;;AACA;;AAIA,MAAMA,OAAO,GAAG,oBAAuB,WAAvB,cAAmD,QAAnE;AACA,MAAMC,WAAW,GAAG,EAApB;AACA,MAAMC,eAAe,GAAG,UAAxB;AAIO,MAAMC,kBAAoC,GAAG;AAClDC,EAAAA,IAAI,EAAE,eAD4C;AAElDC,EAAAA,EAAE,EAAE,eAF8C;AAGlDC,EAAAA,MAAM,EAAE,KAH0C;AAIlDC,EAAAA,OAAO,EAAEP,OAJyC;AAKlDQ,EAAAA,SAAS,EAAE,CAAC,oBAAD,CALuC;AAMlDC,EAAAA,KANkD;AAOlDC,EAAAA,UAAU,EAAE,CAAC,KAAD,CAPsC;AAQlDC,EAAAA,OAAO,EAAE,EARyC;AASlDC,EAAAA,MAAM,EAAE;AAT0C,CAA7C;;;AAYP,eAAeH,KAAf,CAAqBI,IAArB,EAA2BF,OAA3B,EAAoC;AAClCE,EAAAA,IAAI,GAAG,8CAAsBA,IAAtB,EAA4BF,OAA5B,CAAP;AACA,SAAOE,IAAP;AACD;;AAUM,eAAeC,qBAAf,CAAqCC,IAArC,EAA2CC,SAA3C,EAAsDL,OAAO,GAAG,EAAhE,EAAoE;AACzE,QAAM;AAACM,IAAAA,oBAAD;AAAuBC,IAAAA;AAAvB,MAAwCC,iBAAiB,CAACJ,IAAD,CAA/D;;AAEA,MAAI,CAACE,oBAAD,IAAyB,CAACC,aAA1B,IAA2C,CAACF,SAAhD,EAA2D;AACzD,WAAO,IAAP;AACD;;AAED,MAAII,UAAoB,GAAG,EAA3B;AACA,QAAMC,qBAAwC,GAAG,EAAjD;;AAEA,OAAK,IAAIC,KAAK,GAAG,CAAjB,EAAoBA,KAAK,GAAGL,oBAAoB,CAACM,MAAjD,EAAyDD,KAAK,EAA9D,EAAkE;AAAA;;AAEhE,UAAME,GAAG,GAAG,+BAAgBN,aAAa,CAACI,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E,KAAD,CAAlC;;AAEA,MAAIiC,eAAe,CAACC,MAAhB,KAA2BtD,eAA/B,EAAgD;AAC9C,WAAO,IAAP;AACD;;AAED,SAAOqD,eAAe,CAACV,KAAhB,CAAsBS,cAAtB,CAAP;AACD;;AAQD,SAASD,oBAAT,CAA8Bd,SAA9B,EAAyCW,cAAzC,EAAyD;AACvD,SAAOX,SAAS,IAAIA,SAAS,CAACW,cAAD,CAAtB,GACHX,SAAS,CAACW,cAAD,CAAT,CACCO,QADD,GAGCC,OAHD,CAGS,SAHT,EAGoB,EAHpB,EAICC,IAJD,EADG,GAMH1D,WANJ;AAOD","sourcesContent":["import type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {load} from '@loaders.gl/core';\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 * Loader for I3S attributes\n */\nexport const I3SAttributeLoader: LoaderWithParser = {\n name: 'I3S Attribute',\n id: 'i3s-attribute',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/binary'],\n parse,\n extensions: ['bin'],\n options: {},\n binary: true\n};\n\nasync function parse(data, options) {\n data = parseI3STileAttribute(data, options);\n return data;\n}\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} = getAttributesData(tile);\n\n if (!attributeStorageInfo || !attributeUrls || !featureId) {\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);\n}\n\nfunction getAttributesData(tile) {\n const attributeStorageInfo =\n tile && tile.tileset && tile.tileset.tileset && tile.tileset.tileset.attributeStorageInfo;\n const attributeUrls = tile && tile.header && tile.header.attributeUrls;\n\n return {attributeStorageInfo, attributeUrls};\n}\n\n/**\n * Get attribute value type based on property names\n * @param {Object} attribute\n * @returns {String}\n */\nfunction 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 * 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) {\n const objectIds = attributes.find((attribute) => attribute.value.OBJECTID);\n\n if (!objectIds) {\n return null;\n }\n\n const attributeIndex = objectIds.value.OBJECTID.indexOf(featureId);\n\n if (attributeIndex < 0) {\n return null;\n }\n\n return getFeatureAttributesByIndex(attributes, attributeIndex, attributeStorageInfo);\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) {\n const attributesObject = {};\n\n for (let index = 0; index < attributeStorageInfo.length; index++) {\n const attributeName = attributeStorageInfo[index].name;\n const attribute = getAttributeByIndexAndAttributeName(attributes, index, attributeName);\n attributesObject[attributeName] = formatAttributeValue(attribute, featureIdIndex);\n }\n\n return attributesObject;\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) {\n return attribute && attribute[featureIdIndex]\n ? attribute[featureIdIndex]\n .toString()\n // eslint-disable-next-line no-control-regex\n .replace(/\\u0000/g, '')\n .trim()\n : EMPTY_VALUE;\n}\n"],"file":"i3s-attribute-loader.js"}
1
+ {"version":3,"sources":["../../src/i3s-attribute-loader.ts"],"names":["VERSION","EMPTY_VALUE","REJECTED_STATUS","I3SAttributeLoader","name","id","module","version","mimeTypes","parse","extensions","options","binary","data","loadFeatureAttributes","tile","featureId","getAttributesData","attributeStorageInfo","attributeUrls","attributes","attributeLoadPromises","index","length","url","i3s","token","attributeName","attributeType","getAttributeValueType","loadOptions","promise","push","Promise","allSettled","generateAttributesByFeatureId","tileset","header","attribute","hasOwnProperty","attributeValues","valueType","objectIds","find","value","OBJECTID","attributeIndex","indexOf","getFeatureAttributesByIndex","featureIdIndex","attributesObject","getAttributeByIndexAndAttributeName","formatAttributeValue","attributesName","attributeObject","status","toString","replace","trim"],"mappings":";;;;;;;;;;;;;;;;AACA;;AACA;;AACA;;;;;;AAIA,IAAMA,OAAO,GAAG,oBAAuB,WAAvB,cAAmD,QAAnE;AACA,IAAMC,WAAW,GAAG,EAApB;AACA,IAAMC,eAAe,GAAG,UAAxB;AAIO,IAAMC,kBAAoC,GAAG;AAClDC,EAAAA,IAAI,EAAE,eAD4C;AAElDC,EAAAA,EAAE,EAAE,eAF8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KAAzD,EAAgE+B,cAAhE,EAAgF;AAC9E,MAAMC,eAAe,GAAGlC,UAAU,CAACE,KAAD,CAAlC;;AAEA,MAAIgC,eAAe,CAACC,MAAhB,KAA2BrD,eAA/B,EAAgD;AAC9C,WAAO,IAAP;AACD;;AAED,SAAOoD,eAAe,CAACV,KAAhB,CAAsBS,cAAtB,CAAP;AACD;;AAQD,SAASD,oBAAT,CAA8Bd,SAA9B,EAAyCW,cAAzC,EAAyD;AACvD,SAAOX,SAAS,IAAIA,SAAS,CAACW,cAAD,CAAtB,GACHX,SAAS,CAACW,cAAD,CAAT,CACCO,QADD,GAGCC,OAHD,CAGS,SAHT,EAGoB,EAHpB,EAICC,IAJD,EADG,GAMHzD,WANJ;AAOD","sourcesContent":["import type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {load} from '@loaders.gl/core';\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 * Loader for I3S attributes\n */\nexport const I3SAttributeLoader: LoaderWithParser = {\n name: 'I3S Attribute',\n id: 'i3s-attribute',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/binary'],\n parse,\n extensions: ['bin'],\n options: {},\n binary: true\n};\n\nasync function parse(data, options) {\n data = parseI3STileAttribute(data, options);\n return data;\n}\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} = getAttributesData(tile);\n\n if (!attributeStorageInfo || !attributeUrls || !featureId) {\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);\n}\n\nfunction getAttributesData(tile) {\n const attributeStorageInfo =\n tile && tile.tileset && tile.tileset.tileset && tile.tileset.tileset.attributeStorageInfo;\n const attributeUrls = tile && tile.header && tile.header.attributeUrls;\n\n return {attributeStorageInfo, attributeUrls};\n}\n\n/**\n * Get attribute value type based on property names\n * @param {Object} attribute\n * @returns {String}\n */\nfunction 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 * 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) {\n const objectIds = attributes.find((attribute) => attribute.value.OBJECTID);\n\n if (!objectIds) {\n return null;\n }\n\n const attributeIndex = objectIds.value.OBJECTID.indexOf(featureId);\n\n if (attributeIndex < 0) {\n return null;\n }\n\n return getFeatureAttributesByIndex(attributes, attributeIndex, attributeStorageInfo);\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) {\n const attributesObject = {};\n\n for (let index = 0; index < attributeStorageInfo.length; index++) {\n const attributeName = attributeStorageInfo[index].name;\n const attribute = getAttributeByIndexAndAttributeName(attributes, index, attributeName);\n attributesObject[attributeName] = formatAttributeValue(attribute, featureIdIndex);\n }\n\n return attributesObject;\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) {\n return attribute && attribute[featureIdIndex]\n ? attribute[featureIdIndex]\n .toString()\n // eslint-disable-next-line no-control-regex\n .replace(/\\u0000/g, '')\n .trim()\n : EMPTY_VALUE;\n}\n"],"file":"i3s-attribute-loader.js"}
@@ -1,21 +1,27 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
8
  exports.I3SContentLoader = void 0;
7
9
 
10
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
+
12
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
13
+
8
14
  var _parseI3sTileContent = require("./lib/parsers/parse-i3s-tile-content");
9
15
 
10
- const VERSION = typeof "3.0.13" !== 'undefined' ? "3.0.13" : 'latest';
11
- const I3SContentLoader = {
16
+ var VERSION = typeof "3.0.14" !== 'undefined' ? "3.0.14" : 'latest';
17
+ var I3SContentLoader = {
12
18
  name: 'I3S Content (Indexed Scene Layers)',
13
19
  id: 'i3s-content',
14
20
  module: 'i3s',
15
21
  worker: true,
16
22
  version: VERSION,
17
23
  mimeTypes: ['application/octet-stream'],
18
- parse,
24
+ parse: parse,
19
25
  extensions: ['bin'],
20
26
  options: {
21
27
  'i3s-content': {}
@@ -23,12 +29,32 @@ const I3SContentLoader = {
23
29
  };
24
30
  exports.I3SContentLoader = I3SContentLoader;
25
31
 
26
- async function parse(data, options, context) {
27
- const {
28
- tile,
29
- tileset
30
- } = (options === null || options === void 0 ? void 0 : options.i3s) || {};
31
- await (0, _parseI3sTileContent.parseI3STileContent)(data, tile, tileset, options, context);
32
- return tile.content;
32
+ function parse(_x, _x2, _x3) {
33
+ return _parse.apply(this, arguments);
34
+ }
35
+
36
+ function _parse() {
37
+ _parse = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(data, options, context) {
38
+ var _ref, tile, tileset;
39
+
40
+ return _regenerator.default.wrap(function _callee$(_context) {
41
+ while (1) {
42
+ switch (_context.prev = _context.next) {
43
+ case 0:
44
+ _ref = (options === null || options === void 0 ? void 0 : options.i3s) || {}, tile = _ref.tile, tileset = _ref.tileset;
45
+ _context.next = 3;
46
+ return (0, _parseI3sTileContent.parseI3STileContent)(data, tile, tileset, options, context);
47
+
48
+ case 3:
49
+ return _context.abrupt("return", tile.content);
50
+
51
+ case 4:
52
+ case "end":
53
+ return _context.stop();
54
+ }
55
+ }
56
+ }, _callee);
57
+ }));
58
+ return _parse.apply(this, arguments);
33
59
  }
34
60
  //# sourceMappingURL=i3s-content-loader.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/i3s-content-loader.ts"],"names":["VERSION","I3SContentLoader","name","id","module","worker","version","mimeTypes","parse","extensions","options","data","context","tile","tileset","i3s","content"],"mappings":";;;;;;;AACA;;AAKA,MAAMA,OAAO,GAAG,oBAAuB,WAAvB,cAAmD,QAAnE;AAIO,MAAMC,gBAAkC,GAAG;AAChDC,EAAAA,IAAI,EAAE,oCAD0C;AAEhDC,EAAAA,EAAE,EAAE,aAF4C;AAGhDC,EAAAA,MAAM,EAAE,KAHwC;AAIhDC,EAAAA,MAAM,EAAE,IAJwC;AAKhDC,EAAAA,OAAO,EAAEN,OALuC;AAMhDO,EAAAA,SAAS,EAAE,CAAC,0BAAD,CANqC;AAOhDC,EAAAA,KAPgD;AAQhDC,EAAAA,UAAU,EAAE,CAAC,KAAD,CARoC;AAShDC,EAAAA,OAAO,EAAE;AACP,mBAAe;AADR;AATuC,CAA3C;;;AAcP,eAAeF,KAAf,CAAqBG,IAArB,EAA2BD,OAA3B,EAAoDE,OAApD,EAA6E;AAC3E,QAAM;AAACC,IAAAA,IAAD;AAAOC,IAAAA;AAAP,MAAkB,CAAAJ,OAAO,SAAP,IAAAA,OAAO,WAAP,YAAAA,OAAO,CAAEK,GAAT,KAAgB,EAAxC;AACA,QAAM,8CAAoBJ,IAApB,EAA0BE,IAA1B,EAAgCC,OAAhC,EAAyCJ,OAAzC,EAAkDE,OAAlD,CAAN;AACA,SAAOC,IAAI,CAACG,OAAZ;AACD","sourcesContent":["import type {LoaderWithParser, LoaderOptions, LoaderContext} from '@loaders.gl/loader-utils';\nimport {parseI3STileContent} from './lib/parsers/parse-i3s-tile-content';\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__ : 'latest';\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?: LoaderOptions, context?: LoaderContext) {\n const {tile, tileset} = options?.i3s || {};\n await parseI3STileContent(data, tile, tileset, options, context);\n return tile.content;\n}\n"],"file":"i3s-content-loader.js"}
1
+ {"version":3,"sources":["../../src/i3s-content-loader.ts"],"names":["VERSION","I3SContentLoader","name","id","module","worker","version","mimeTypes","parse","extensions","options","data","context","i3s","tile","tileset","content"],"mappings":";;;;;;;;;;;;;AACA;;AAKA,IAAMA,OAAO,GAAG,oBAAuB,WAAvB,cAAmD,QAAnE;AAIO,IAAMC,gBAAkC,GAAG;AAChDC,EAAAA,IAAI,EAAE,oCAD0C;AAEhDC,EAAAA,EAAE,EAAE,aAF4C;AAGhDC,EAAAA,MAAM,EAAE,KAHwC;AAIhDC,EAAAA,MAAM,EAAE,IAJwC;AAKhDC,EAAAA,OAAO,EAAEN,OALuC;AAMhDO,EAAAA,SAAS,EAAE,CAAC,0BAAD,CANqC;AAOhDC,EAAAA,KAAK,EAALA,KAPgD;AAQhDC,EAAAA,UAAU,EAAE,CAAC,KAAD,CARoC;AAShDC,EAAAA,OAAO,EAAE;AACP,mBAAe;AADR;AATuC,CAA3C;;;SAcQF,K;;;;;qEAAf,iBAAqBG,IAArB,EAA2BD,OAA3B,EAAoDE,OAApD;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA,mBAC0B,CAAAF,OAAO,SAAP,IAAAA,OAAO,WAAP,YAAAA,OAAO,CAAEG,GAAT,KAAgB,EAD1C,EACSC,IADT,QACSA,IADT,EACeC,OADf,QACeA,OADf;AAAA;AAAA,mBAEQ,8CAAoBJ,IAApB,EAA0BG,IAA1B,EAAgCC,OAAhC,EAAyCL,OAAzC,EAAkDE,OAAlD,CAFR;;AAAA;AAAA,6CAGSE,IAAI,CAACE,OAHd;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,G","sourcesContent":["import type {LoaderWithParser, LoaderOptions, LoaderContext} from '@loaders.gl/loader-utils';\nimport {parseI3STileContent} from './lib/parsers/parse-i3s-tile-content';\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__ : 'latest';\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?: LoaderOptions, context?: LoaderContext) {\n const {tile, tileset} = options?.i3s || {};\n await parseI3STileContent(data, tile, tileset, options, context);\n return tile.content;\n}\n"],"file":"i3s-content-loader.js"}