@loaders.gl/i3s 4.1.0-alpha.2 → 4.1.0-alpha.4

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.
@@ -1,5 +1,5 @@
1
1
  import { parseWebscene } from "./lib/parsers/parse-arcgis-webscene.js";
2
- const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
2
+ const VERSION = typeof "4.1.0-alpha.4" !== 'undefined' ? "4.1.0-alpha.4" : 'latest';
3
3
  export const ArcGISWebSceneLoader = {
4
4
  name: 'ArcGIS Web Scene Loader',
5
5
  id: 'arcgis-web-scene',
@@ -1 +1 @@
1
- {"version":3,"file":"arcgis-webscene-loader.js","names":["parseWebscene","VERSION","__VERSION__","ArcGISWebSceneLoader","name","id","module","version","mimeTypes","parse","extensions","options","data"],"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__ : 'latest';\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":"SAGQA,aAAa;AAIrB,MAAMC,OAAO,GAAG,OAAOC,WAAW,KAAK,WAAW,GAAGA,WAAW,GAAG,QAAQ;AAQ3E,OAAO,MAAMC,oBAIZ,GAAG;EACFC,IAAI,EAAE,yBAAyB;EAC/BC,EAAE,EAAE,kBAAkB;EACtBC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEN,OAAO;EAChBO,SAAS,EAAE,CAAC,kBAAkB,CAAC;EAC/BC,KAAK;EACLC,UAAU,EAAE,CAAC,MAAM,CAAC;EACpBC,OAAO,EAAE,CAAC;AACZ,CAAC;AAMD,eAAeF,KAAKA,CAACG,IAAiB,EAA+B;EACnE,OAAOZ,aAAa,CAACY,IAAI,CAAC;AAC5B"}
1
+ {"version":3,"file":"arcgis-webscene-loader.js","names":["parseWebscene","VERSION","ArcGISWebSceneLoader","name","id","module","version","mimeTypes","parse","extensions","options","data"],"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__ : 'latest';\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":"SAGQA,aAAa;AAIrB,MAAMC,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,QAAQ;AAQ3E,OAAO,MAAMC,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;EACLC,UAAU,EAAE,CAAC,MAAM,CAAC;EACpBC,OAAO,EAAE,CAAC;AACZ,CAAC;AAMD,eAAeF,KAAKA,CAACG,IAAiB,EAA+B;EACnE,OAAOX,aAAa,CAACW,IAAI,CAAC;AAC5B"}
package/dist/dist.dev.js CHANGED
@@ -4328,15 +4328,14 @@ var __exports__ = (() => {
4328
4328
  var nodeVersion = matches && parseFloat(matches[1]) || 0;
4329
4329
 
4330
4330
  // ../worker-utils/src/lib/env-utils/version.ts
4331
- var NPM_TAG = "latest";
4332
4331
  function getVersion() {
4333
4332
  if (!globalThis._loadersgl_?.version) {
4334
4333
  globalThis._loadersgl_ = globalThis._loadersgl_ || {};
4335
- if (typeof __VERSION__ === "undefined") {
4334
+ if (false) {
4336
4335
  console.warn("loaders.gl: The __VERSION__ variable is not injected using babel plugin. Latest unstable workers would be fetched from the CDN.");
4337
4336
  globalThis._loadersgl_.version = NPM_TAG;
4338
4337
  } else {
4339
- globalThis._loadersgl_.version = __VERSION__;
4338
+ globalThis._loadersgl_.version = "4.1.0-alpha.4";
4340
4339
  }
4341
4340
  }
4342
4341
  return globalThis._loadersgl_.version;
@@ -9109,7 +9108,7 @@ var __exports__ = (() => {
9109
9108
  _defineProperty(Ellipsoid, "WGS84", new Ellipsoid(WGS84_RADIUS_X, WGS84_RADIUS_Y, WGS84_RADIUS_Z));
9110
9109
 
9111
9110
  // ../images/src/lib/utils/version.ts
9112
- var VERSION2 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
9111
+ var VERSION2 = true ? "4.1.0-alpha.4" : "latest";
9113
9112
 
9114
9113
  // ../images/src/lib/category-api/image-type.ts
9115
9114
  var parseImageNode = globalThis.loaders?.parseImageNode;
@@ -9498,7 +9497,7 @@ var __exports__ = (() => {
9498
9497
  };
9499
9498
 
9500
9499
  // ../draco/src/lib/utils/version.ts
9501
- var VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
9500
+ var VERSION3 = true ? "4.1.0-alpha.4" : "latest";
9502
9501
 
9503
9502
  // ../draco/src/draco-loader.ts
9504
9503
  var DracoLoader = {
@@ -10073,7 +10072,7 @@ var __exports__ = (() => {
10073
10072
  }
10074
10073
 
10075
10074
  // ../textures/src/lib/utils/version.ts
10076
- var VERSION4 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
10075
+ var VERSION4 = true ? "4.1.0-alpha.4" : "latest";
10077
10076
 
10078
10077
  // ../textures/src/lib/parsers/basis-module-loader.ts
10079
10078
  var BASIS_EXTERNAL_LIBRARIES = {
@@ -11477,7 +11476,7 @@ var __exports__ = (() => {
11477
11476
  }
11478
11477
 
11479
11478
  // src/i3s-content-loader.ts
11480
- var VERSION5 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
11479
+ var VERSION5 = true ? "4.1.0-alpha.4" : "latest";
11481
11480
  var I3SContentLoader = {
11482
11481
  name: "I3S Content (Indexed Scene Layers)",
11483
11482
  id: "i3s-content",
@@ -11987,7 +11986,7 @@ var __exports__ = (() => {
11987
11986
  var import_core16 = __toESM(require_core(), 1);
11988
11987
 
11989
11988
  // src/i3s-node-page-loader.ts
11990
- var VERSION6 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
11989
+ var VERSION6 = true ? "4.1.0-alpha.4" : "latest";
11991
11990
  var I3SNodePageLoader = {
11992
11991
  name: "I3S Node Page",
11993
11992
  id: "i3s-node-page",
@@ -12277,7 +12276,7 @@ var __exports__ = (() => {
12277
12276
  }
12278
12277
 
12279
12278
  // src/i3s-loader.ts
12280
- var VERSION7 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
12279
+ var VERSION7 = true ? "4.1.0-alpha.4" : "latest";
12281
12280
  var TILESET_REGEX = /layers\/[0-9]+$/;
12282
12281
  var TILE_HEADER_REGEX = /nodes\/([0-9-]+|root)$/;
12283
12282
  var SLPK_HEX = "504b0304";
@@ -12387,23 +12386,28 @@ var __exports__ = (() => {
12387
12386
  const zipEoCDOffset = await searchFromTheEnd(file, eoCDSignature);
12388
12387
  let cdRecordsNumber = BigInt(await file.getUint16(zipEoCDOffset + CD_RECORDS_NUMBER_OFFSET));
12389
12388
  let cdStartOffset = BigInt(await file.getUint32(zipEoCDOffset + CD_START_OFFSET_OFFSET));
12390
- if (cdStartOffset === BigInt(4294967295) || cdRecordsNumber === BigInt(4294967295)) {
12391
- const zip64EoCDLocatorOffset = zipEoCDOffset - 20n;
12392
- const magicBytes = await file.slice(zip64EoCDLocatorOffset, zip64EoCDLocatorOffset + 4n);
12393
- if (!compareArrayBuffers(magicBytes, zip64EoCDLocatorSignature)) {
12394
- throw new Error("zip64 EoCD locator not found");
12395
- }
12396
- const zip64EoCDOffset = await file.getBigUint64(zip64EoCDLocatorOffset + ZIP64_EOCD_START_OFFSET_OFFSET);
12389
+ let zip64EoCDLocatorOffset = zipEoCDOffset - 20n;
12390
+ let zip64EoCDOffset = 0n;
12391
+ const magicBytes = await file.slice(zip64EoCDLocatorOffset, zip64EoCDLocatorOffset + 4n);
12392
+ if (compareArrayBuffers(magicBytes, zip64EoCDLocatorSignature)) {
12393
+ zip64EoCDOffset = await file.getBigUint64(zip64EoCDLocatorOffset + ZIP64_EOCD_START_OFFSET_OFFSET);
12397
12394
  const endOfCDMagicBytes = await file.slice(zip64EoCDOffset, zip64EoCDOffset + 4n);
12398
12395
  if (!compareArrayBuffers(endOfCDMagicBytes, zip64EoCDSignature.buffer)) {
12399
12396
  throw new Error("zip64 EoCD not found");
12400
12397
  }
12401
12398
  cdRecordsNumber = await file.getBigUint64(zip64EoCDOffset + ZIP64_CD_RECORDS_NUMBER_OFFSET);
12402
12399
  cdStartOffset = await file.getBigUint64(zip64EoCDOffset + ZIP64_CD_START_OFFSET_OFFSET);
12400
+ } else {
12401
+ zip64EoCDLocatorOffset = 0n;
12403
12402
  }
12404
12403
  return {
12405
12404
  cdRecordsNumber,
12406
- cdStartOffset
12405
+ cdStartOffset,
12406
+ offsets: {
12407
+ zip64EoCDOffset,
12408
+ zip64EoCDLocatorOffset,
12409
+ zipEoCDOffset
12410
+ }
12407
12411
  };
12408
12412
  };
12409
12413
 
@@ -12617,6 +12621,52 @@ var __exports__ = (() => {
12617
12621
  compressionMethod
12618
12622
  };
12619
12623
  };
12624
+ var ZIP_HEADER_FIELDS2 = [{
12625
+ offset: 0,
12626
+ size: 4,
12627
+ default: new DataView(signature2.buffer).getUint32(0, true)
12628
+ }, {
12629
+ offset: 4,
12630
+ size: 2,
12631
+ default: 45
12632
+ }, {
12633
+ offset: 6,
12634
+ size: 2,
12635
+ default: 0
12636
+ }, {
12637
+ offset: 8,
12638
+ size: 2,
12639
+ default: 0
12640
+ }, {
12641
+ offset: 10,
12642
+ size: 2,
12643
+ default: 0
12644
+ }, {
12645
+ offset: 12,
12646
+ size: 2,
12647
+ default: 0
12648
+ }, {
12649
+ offset: 14,
12650
+ size: 4,
12651
+ name: "crc32"
12652
+ }, {
12653
+ offset: 18,
12654
+ size: 4,
12655
+ name: "length"
12656
+ }, {
12657
+ offset: 22,
12658
+ size: 4,
12659
+ name: "length"
12660
+ }, {
12661
+ offset: 26,
12662
+ size: 2,
12663
+ name: "fnlength"
12664
+ }, {
12665
+ offset: 28,
12666
+ size: 2,
12667
+ default: 0,
12668
+ name: "extraLength"
12669
+ }];
12620
12670
 
12621
12671
  // ../crypto/src/lib/hash.ts
12622
12672
  var Hash = class {
@@ -13442,7 +13492,7 @@ var __exports__ = (() => {
13442
13492
  }
13443
13493
 
13444
13494
  // src/i3s-slpk-loader.ts
13445
- var VERSION8 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
13495
+ var VERSION8 = true ? "4.1.0-alpha.4" : "latest";
13446
13496
  var SLPKLoader = {
13447
13497
  name: "I3S SLPK (Scene Layer Package)",
13448
13498
  id: "slpk",
@@ -13521,7 +13571,7 @@ var __exports__ = (() => {
13521
13571
  }
13522
13572
 
13523
13573
  // src/i3s-attribute-loader.ts
13524
- var VERSION9 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
13574
+ var VERSION9 = true ? "4.1.0-alpha.4" : "latest";
13525
13575
  var EMPTY_VALUE = "";
13526
13576
  var REJECTED_STATUS = "rejected";
13527
13577
  var I3SAttributeLoader = {
@@ -13674,7 +13724,7 @@ var __exports__ = (() => {
13674
13724
  }
13675
13725
 
13676
13726
  // src/i3s-building-scene-layer-loader.ts
13677
- var VERSION10 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
13727
+ var VERSION10 = true ? "4.1.0-alpha.4" : "latest";
13678
13728
  var I3SBuildingSceneLayerLoader = {
13679
13729
  name: "I3S Building Scene Layer",
13680
13730
  id: "i3s-building-scene-layer",
@@ -13762,7 +13812,7 @@ var __exports__ = (() => {
13762
13812
  }
13763
13813
 
13764
13814
  // src/arcgis-webscene-loader.ts
13765
- var VERSION11 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
13815
+ var VERSION11 = true ? "4.1.0-alpha.4" : "latest";
13766
13816
  var ArcGISWebSceneLoader = {
13767
13817
  name: "ArcGIS Web Scene Loader",
13768
13818
  id: "arcgis-web-scene",
@@ -1,7 +1,7 @@
1
1
  import { load } from '@loaders.gl/core';
2
2
  import { parseI3STileAttribute } from "./lib/parsers/parse-i3s-attribute.js";
3
3
  import { getUrlWithToken } from "./lib/utils/url-utils.js";
4
- const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
4
+ const VERSION = typeof "4.1.0-alpha.4" !== 'undefined' ? "4.1.0-alpha.4" : 'latest';
5
5
  const EMPTY_VALUE = '';
6
6
  const REJECTED_STATUS = 'rejected';
7
7
  export const I3SAttributeLoader = {
@@ -1 +1 @@
1
- {"version":3,"file":"i3s-attribute-loader.js","names":["load","parseI3STileAttribute","getUrlWithToken","VERSION","__VERSION__","EMPTY_VALUE","REJECTED_STATUS","I3SAttributeLoader","name","id","module","version","mimeTypes","parse","arrayBuffer","options","extensions","binary","loadFeatureAttributes","tile","featureId","arguments","length","undefined","attributeStorageInfo","attributeUrls","tilesetFields","getAttributesData","attributes","attributeLoadPromises","index","_options$i3s","url","i3s","token","attributeName","attributeType","getAttributeValueType","loadOptions","promise","push","Promise","allSettled","error","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,SAAQA,IAAI,QAAO,kBAAkB;AAAC,SAG9BC,qBAAqB;AAAA,SACrBC,eAAe;AAIvB,MAAMC,OAAO,GAAG,OAAOC,WAAW,KAAK,WAAW,GAAGA,WAAW,GAAG,QAAQ;AAC3E,MAAMC,WAAW,GAAG,EAAE;AACtB,MAAMC,eAAe,GAAG,UAAU;AAKlC,OAAO,MAAMC,kBAAgF,GAAG;EAC9FC,IAAI,EAAE,eAAe;EACrBC,EAAE,EAAE,eAAe;EACnBC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAER,OAAO;EAChBS,SAAS,EAAE,CAAC,oBAAoB,CAAC;EACjCC,KAAK,EAAE,MAAAA,CAAOC,WAAwB,EAAEC,OAAuB,KAAKd,qBAAqB,CAACa,WAAW,EAAEC,OAAO,CAAC;EAC/GC,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBD,OAAO,EAAE,CAAC,CAAC;EACXE,MAAM,EAAE;AACV,CAAC;AAaD,OAAO,eAAeC,qBAAqBA,CAACC,IAAI,EAAEC,SAAS,EAAgB;EAAA,IAAdL,OAAO,GAAAM,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,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,KAAK,KAAKzC,aAAa,CAAC;EAE/E,OAAO,CAAAuC,cAAc,aAAdA,cAAc,wBAAAD,qBAAA,GAAdC,cAAc,CAAEG,MAAM,cAAAJ,qBAAA,uBAAtBA,qBAAA,CAAwBJ,WAAW,KAAI,EAAE;AAClD;AAQA,SAASE,mCAAmCA,CAAC3C,UAAU,EAAEE,KAAK,EAAEgD,cAAc,EAAE;EAC9E,MAAMC,eAAe,GAAGnD,UAAU,CAACE,KAAK,CAAC;EAEzC,IAAIiD,eAAe,CAACC,MAAM,KAAK1E,eAAe,EAAE;IAC9C,OAAO,IAAI;EACb;EAEA,OAAOyE,eAAe,CAAChB,KAAK,CAACe,cAAc,CAAC;AAC9C;AAQA,SAASN,oBAAoBA,CAACnB,SAAS,EAAEc,cAAc,EAAEE,WAAW,EAAE;EACpE,IAAIN,KAAK,GAAG1D,WAAW;EAEvB,IAAIgD,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,CAAC/C,MAAM,EAAE;IACtB,MAAM8D,SAAS,GAAGf,WAAW,CAACV,IAAI,CAAC0B,UAAU,IAAIA,UAAU,CAACC,IAAI,KAAKC,MAAM,CAACxB,KAAK,CAAC,CAAC;IACnFA,KAAK,GAAG,CAAAqB,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAE5E,IAAI,KAAIH,WAAW;EACxC;EAEA,OAAO0D,KAAK;AACd"}
1
+ {"version":3,"file":"i3s-attribute-loader.js","names":["load","parseI3STileAttribute","getUrlWithToken","VERSION","EMPTY_VALUE","REJECTED_STATUS","I3SAttributeLoader","name","id","module","version","mimeTypes","parse","arrayBuffer","options","extensions","binary","loadFeatureAttributes","tile","featureId","arguments","length","undefined","attributeStorageInfo","attributeUrls","tilesetFields","getAttributesData","attributes","attributeLoadPromises","index","_options$i3s","url","i3s","token","attributeName","attributeType","getAttributeValueType","loadOptions","promise","push","Promise","allSettled","error","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,SAAQA,IAAI,QAAO,kBAAkB;AAAC,SAG9BC,qBAAqB;AAAA,SACrBC,eAAe;AAIvB,MAAMC,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,QAAQ;AAC3E,MAAMC,WAAW,GAAG,EAAE;AACtB,MAAMC,eAAe,GAAG,UAAU;AAKlC,OAAO,MAAMC,kBAAgF,GAAG;EAC9FC,IAAI,EAAE,eAAe;EACrBC,EAAE,EAAE,eAAe;EACnBC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEP,OAAO;EAChBQ,SAAS,EAAE,CAAC,oBAAoB,CAAC;EACjCC,KAAK,EAAE,MAAAA,CAAOC,WAAwB,EAAEC,OAAuB,KAAKb,qBAAqB,CAACY,WAAW,EAAEC,OAAO,CAAC;EAC/GC,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBD,OAAO,EAAE,CAAC,CAAC;EACXE,MAAM,EAAE;AACV,CAAC;AAaD,OAAO,eAAeC,qBAAqBA,CAACC,IAAI,EAAEC,SAAS,EAAgB;EAAA,IAAdL,OAAO,GAAAM,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EACvE,MAAM;IAACG,oBAAoB;IAAEC,aAAa;IAAEC;EAAa,CAAC,GAAGC,iBAAiB,CAACR,IAAI,CAAC;EAEpF,IAAI,CAACK,oBAAoB,IAAI,CAACC,aAAa,IAAIL,SAAS,GAAG,CAAC,EAAE;IAC5D,OAAO,IAAI;EACb;EAEA,IAAIQ,UAAoB,GAAG,EAAE;EAC7B,MAAMC,qBAAwC,GAAG,EAAE;EAEnD,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,KAAK,CAAC;EAEzC,IAAIiD,eAAe,CAACC,MAAM,KAAK1E,eAAe,EAAE;IAC9C,OAAO,IAAI;EACb;EAEA,OAAOyE,eAAe,CAAChB,KAAK,CAACe,cAAc,CAAC;AAC9C;AAQA,SAASN,oBAAoBA,CAACnB,SAAS,EAAEc,cAAc,EAAEE,WAAW,EAAE;EACpE,IAAIN,KAAK,GAAG1D,WAAW;EAEvB,IAAIgD,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,CAAC/C,MAAM,EAAE;IACtB,MAAM8D,SAAS,GAAGf,WAAW,CAACV,IAAI,CAAC0B,UAAU,IAAIA,UAAU,CAACC,IAAI,KAAKC,MAAM,CAACxB,KAAK,CAAC,CAAC;IACnFA,KAAK,GAAG,CAAAqB,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAE5E,IAAI,KAAIH,WAAW;EACxC;EAEA,OAAO0D,KAAK;AACd"}
@@ -1,5 +1,5 @@
1
1
  import { parseBuildingSceneLayer } from "./lib/parsers/parse-i3s-building-scene-layer.js";
2
- const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
2
+ const VERSION = typeof "4.1.0-alpha.4" !== 'undefined' ? "4.1.0-alpha.4" : 'latest';
3
3
  export const I3SBuildingSceneLayerLoader = {
4
4
  name: 'I3S Building Scene Layer',
5
5
  id: 'i3s-building-scene-layer',
@@ -1 +1 @@
1
- {"version":3,"file":"i3s-building-scene-layer-loader.js","names":["parseBuildingSceneLayer","VERSION","__VERSION__","I3SBuildingSceneLayerLoader","name","id","module","version","mimeTypes","parse","extensions","options","data","context","url","Error"],"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__ : 'latest';\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":"SAIQA,uBAAuB;AAK/B,MAAMC,OAAO,GAAG,OAAOC,WAAW,KAAK,WAAW,GAAGA,WAAW,GAAG,QAAQ;AAI3E,OAAO,MAAMC,2BAIZ,GAAG;EACFC,IAAI,EAAE,0BAA0B;EAChCC,EAAE,EAAE,0BAA0B;EAC9BC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEN,OAAO;EAChBO,SAAS,EAAE,CAAC,kBAAkB,CAAC;EAC/BC,KAAK;EACLC,UAAU,EAAE,CAAC,MAAM,CAAC;EACpBC,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,eAAeF,KAAKA,CAClBG,IAAiB,EACjBD,OAAuB,EACvBE,OAAuB,EACa;EACpC,IAAI,EAACA,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEC,GAAG,GAAE;IACjB,MAAM,IAAIC,KAAK,CAAC,qBAAqB,CAAC;EACxC;EAEA,OAAOf,uBAAuB,CAACY,IAAI,EAAEC,OAAO,CAACC,GAAG,CAAC;AACnD"}
1
+ {"version":3,"file":"i3s-building-scene-layer-loader.js","names":["parseBuildingSceneLayer","VERSION","I3SBuildingSceneLayerLoader","name","id","module","version","mimeTypes","parse","extensions","options","data","context","url","Error"],"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__ : 'latest';\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":"SAIQA,uBAAuB;AAK/B,MAAMC,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,QAAQ;AAI3E,OAAO,MAAMC,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;EACLC,UAAU,EAAE,CAAC,MAAM,CAAC;EACpBC,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,eAAeF,KAAKA,CAClBG,IAAiB,EACjBD,OAAuB,EACvBE,OAAuB,EACa;EACpC,IAAI,EAACA,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEC,GAAG,GAAE;IACjB,MAAM,IAAIC,KAAK,CAAC,qBAAqB,CAAC;EACxC;EAEA,OAAOd,uBAAuB,CAACW,IAAI,EAAEC,OAAO,CAACC,GAAG,CAAC;AACnD"}
@@ -1,5 +1,5 @@
1
1
  import { parseI3STileContent } from "./lib/parsers/parse-i3s-tile-content.js";
2
- const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
2
+ const VERSION = typeof "4.1.0-alpha.4" !== 'undefined' ? "4.1.0-alpha.4" : 'latest';
3
3
  export const I3SContentLoader = {
4
4
  name: 'I3S Content (Indexed Scene Layers)',
5
5
  id: 'i3s-content',
@@ -1 +1 @@
1
- {"version":3,"file":"i3s-content-loader.js","names":["parseI3STileContent","VERSION","__VERSION__","I3SContentLoader","name","id","module","worker","version","mimeTypes","parse","extensions","options","data","context","tile","_tileOptions","tileset","_tilesetOptions","i3s","tileOptions","tilesetOptions"],"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__ : 'latest';\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":"SAEQA,mBAAmB;AAM3B,MAAMC,OAAO,GAAG,OAAOC,WAAW,KAAK,WAAW,GAAGA,WAAW,GAAG,QAAQ;AAK3E,OAAO,MAAMC,gBAAkF,GAAG;EAChGC,IAAI,EAAE,oCAAoC;EAC1CC,EAAE,EAAE,aAAa;EACjBC,MAAM,EAAE,KAAK;EACbC,MAAM,EAAE,IAAI;EACZC,OAAO,EAAEP,OAAO;EAChBQ,SAAS,EAAE,CAAC,0BAA0B,CAAC;EACvCC,KAAK;EACLC,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBC,OAAO,EAAE;IACP,aAAa,EAAE,CAAC;EAClB;AACF,CAAC;AAED,eAAeF,KAAKA,CAACG,IAAI,EAAED,OAA0B,EAAEE,OAAuB,EAAE;EAC9E,MAAM;IAACC,IAAI;IAAEC,YAAY;IAAEC,OAAO;IAAEC;EAAe,CAAC,GAAG,CAAAN,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEO,GAAG,KAAI,CAAC,CAAC;EACzE,MAAMC,WAAW,GAAGJ,YAAY,IAAID,IAAI;EACxC,MAAMM,cAAc,GAAGH,eAAe,IAAID,OAAO;EACjD,IAAI,CAACG,WAAW,IAAI,CAACC,cAAc,EAAE;IACnC,OAAO,IAAI;EACb;EACA,OAAO,MAAMrB,mBAAmB,CAC9Ba,IAAI,EACJO,WAAW,EACXC,cAAc,EACdT,OAAO,EACPE,OACF,CAAC;AACH"}
1
+ {"version":3,"file":"i3s-content-loader.js","names":["parseI3STileContent","VERSION","I3SContentLoader","name","id","module","worker","version","mimeTypes","parse","extensions","options","data","context","tile","_tileOptions","tileset","_tilesetOptions","i3s","tileOptions","tilesetOptions"],"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__ : 'latest';\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":"SAEQA,mBAAmB;AAM3B,MAAMC,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,QAAQ;AAK3E,OAAO,MAAMC,gBAAkF,GAAG;EAChGC,IAAI,EAAE,oCAAoC;EAC1CC,EAAE,EAAE,aAAa;EACjBC,MAAM,EAAE,KAAK;EACbC,MAAM,EAAE,IAAI;EACZC,OAAO,EAAEN,OAAO;EAChBO,SAAS,EAAE,CAAC,0BAA0B,CAAC;EACvCC,KAAK;EACLC,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBC,OAAO,EAAE;IACP,aAAa,EAAE,CAAC;EAClB;AACF,CAAC;AAED,eAAeF,KAAKA,CAACG,IAAI,EAAED,OAA0B,EAAEE,OAAuB,EAAE;EAC9E,MAAM;IAACC,IAAI;IAAEC,YAAY;IAAEC,OAAO;IAAEC;EAAe,CAAC,GAAG,CAAAN,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEO,GAAG,KAAI,CAAC,CAAC;EACzE,MAAMC,WAAW,GAAGJ,YAAY,IAAID,IAAI;EACxC,MAAMM,cAAc,GAAGH,eAAe,IAAID,OAAO;EACjD,IAAI,CAACG,WAAW,IAAI,CAACC,cAAc,EAAE;IACnC,OAAO,IAAI;EACb;EACA,OAAO,MAAMpB,mBAAmB,CAC9BY,IAAI,EACJO,WAAW,EACXC,cAAc,EACdT,OAAO,EACPE,OACF,CAAC;AACH"}