@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.
@@ -76,13 +76,17 @@
76
76
  function mergeLoaderOptions(baseOptions, newOptions) {
77
77
  return mergeOptionsRecursively(baseOptions || {}, newOptions);
78
78
  }
79
- function mergeOptionsRecursively(baseOptions, newOptions) {
79
+ function mergeOptionsRecursively(baseOptions, newOptions, level = 0) {
80
+ if (level > 3) {
81
+ return newOptions;
82
+ }
80
83
  const options = { ...baseOptions };
81
84
  for (const [key, newValue] of Object.entries(newOptions)) {
82
85
  if (newValue && typeof newValue === "object" && !Array.isArray(newValue)) {
83
86
  options[key] = mergeOptionsRecursively(
84
87
  options[key] || {},
85
- newOptions[key]
88
+ newOptions[key],
89
+ level + 1
86
90
  );
87
91
  } else {
88
92
  options[key] = newOptions[key];
@@ -102,7 +106,7 @@
102
106
  );
103
107
  globalThis._loadersgl_.version = NPM_TAG;
104
108
  } else {
105
- globalThis._loadersgl_.version = "4.1.0-alpha.2";
109
+ globalThis._loadersgl_.version = "4.1.0-alpha.4";
106
110
  }
107
111
  }
108
112
  return globalThis._loadersgl_.version;
@@ -1435,7 +1439,7 @@
1435
1439
  var navigator_ = globalThis.navigator || {};
1436
1440
 
1437
1441
  // ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/utils/globals.js
1438
- var VERSION2 = true ? "4.1.0-alpha.2" : "untranspiled source";
1442
+ var VERSION2 = true ? "4.1.0-alpha.4" : "untranspiled source";
1439
1443
  var isBrowser4 = isBrowser3();
1440
1444
 
1441
1445
  // ../../node_modules/@probe.gl/log/dist/utils/local-storage.js
@@ -5303,7 +5307,7 @@
5303
5307
  _defineProperty(Ellipsoid, "WGS84", new Ellipsoid(WGS84_RADIUS_X, WGS84_RADIUS_Y, WGS84_RADIUS_Z));
5304
5308
 
5305
5309
  // ../images/src/lib/utils/version.ts
5306
- var VERSION3 = true ? "4.1.0-alpha.2" : "latest";
5310
+ var VERSION3 = true ? "4.1.0-alpha.4" : "latest";
5307
5311
 
5308
5312
  // ../images/src/lib/category-api/image-type.ts
5309
5313
  var parseImageNode = globalThis.loaders?.parseImageNode;
@@ -5709,7 +5713,7 @@
5709
5713
  };
5710
5714
 
5711
5715
  // ../draco/src/lib/utils/version.ts
5712
- var VERSION4 = true ? "4.1.0-alpha.2" : "latest";
5716
+ var VERSION4 = true ? "4.1.0-alpha.4" : "latest";
5713
5717
 
5714
5718
  // ../draco/src/draco-loader.ts
5715
5719
  var DracoLoader = {
@@ -6312,7 +6316,7 @@
6312
6316
  }
6313
6317
 
6314
6318
  // ../textures/src/lib/utils/version.ts
6315
- var VERSION5 = true ? "4.1.0-alpha.2" : "latest";
6319
+ var VERSION5 = true ? "4.1.0-alpha.4" : "latest";
6316
6320
 
6317
6321
  // ../textures/src/lib/parsers/basis-module-loader.ts
6318
6322
  var BASIS_EXTERNAL_LIBRARIES = {
@@ -7840,7 +7844,7 @@
7840
7844
  }
7841
7845
 
7842
7846
  // src/i3s-content-loader.ts
7843
- var VERSION6 = true ? "4.1.0-alpha.2" : "latest";
7847
+ var VERSION6 = true ? "4.1.0-alpha.4" : "latest";
7844
7848
  var I3SContentLoader = {
7845
7849
  name: "I3S Content (Indexed Scene Layers)",
7846
7850
  id: "i3s-content",
@@ -3,7 +3,7 @@ import { I3SContentLoader } from "./i3s-content-loader.js";
3
3
  import { normalizeTileData, normalizeTilesetData } from "./lib/parsers/parse-i3s.js";
4
4
  import { COORDINATE_SYSTEM } from "./lib/parsers/constants.js";
5
5
  import { getUrlWithoutParams } from "./lib/utils/url-utils.js";
6
- const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
6
+ const VERSION = typeof "4.1.0-alpha.4" !== 'undefined' ? "4.1.0-alpha.4" : 'latest';
7
7
  const TILESET_REGEX = /layers\/[0-9]+$/;
8
8
  const TILE_HEADER_REGEX = /nodes\/([0-9-]+|root)$/;
9
9
  const SLPK_HEX = '504b0304';
@@ -1 +1 @@
1
- {"version":3,"file":"i3s-loader.js","names":["parse","I3SContentLoader","normalizeTileData","normalizeTilesetData","COORDINATE_SYSTEM","getUrlWithoutParams","VERSION","__VERSION__","TILESET_REGEX","TILE_HEADER_REGEX","SLPK_HEX","POINT_CLOUD","I3SLoader","name","id","module","version","mimeTypes","parseI3S","extensions","options","i3s","token","isTileset","isTileHeader","tile","tileset","_tileOptions","_tilesetOptions","useDracoGeometry","useCompressedTextures","decodeTextures","coordinateSystem","METER_OFFSETS","data","arguments","length","undefined","context","url","magicNumber","getMagicNumber","Error","urlWithoutParams","test","parseTileset","parseTile","parseTileContent","arrayBuffer","tilesetJson","JSON","TextDecoder","decode","layerType","tilesetPostprocessed","ArrayBuffer","Uint8Array","map","value","toString","padStart","join"],"sources":["../src/i3s-loader.ts"],"sourcesContent":["import type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport {parse} from '@loaders.gl/core';\nimport type {I3STilesetHeader} from './types';\nimport {I3SContentLoader} from './i3s-content-loader';\nimport {normalizeTileData, normalizeTilesetData} from './lib/parsers/parse-i3s';\nimport {COORDINATE_SYSTEM} from './lib/parsers/constants';\nimport {I3SParseOptions} from './types';\nimport {getUrlWithoutParams} 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';\n\nconst TILESET_REGEX = /layers\\/[0-9]+$/;\nconst TILE_HEADER_REGEX = /nodes\\/([0-9-]+|root)$/;\nconst SLPK_HEX = '504b0304';\nconst POINT_CLOUD = 'PointCloud';\n\nexport type I3SLoaderOptions = LoaderOptions & {\n i3s?: I3SParseOptions;\n};\n\n/**\n * Loader for I3S - Indexed 3D Scene Layer\n */\nexport const I3SLoader: LoaderWithParser<I3STilesetHeader, never, LoaderOptions> = {\n name: 'I3S (Indexed Scene Layers)',\n id: 'i3s',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/octet-stream'],\n parse: parseI3S,\n extensions: ['bin'],\n options: {\n i3s: {\n token: null,\n isTileset: 'auto',\n isTileHeader: 'auto',\n tile: null,\n tileset: null,\n _tileOptions: null,\n _tilesetOptions: null,\n useDracoGeometry: true,\n useCompressedTextures: true,\n decodeTextures: true,\n coordinateSystem: COORDINATE_SYSTEM.METER_OFFSETS\n }\n }\n};\n\nasync function parseI3S(data, options: I3SLoaderOptions = {}, context): Promise<I3STilesetHeader> {\n const url = context.url;\n options.i3s = options.i3s || {};\n const magicNumber = getMagicNumber(data);\n\n // check if file is slpk\n if (magicNumber === SLPK_HEX) {\n throw new Error('Files with .slpk extention currently are not supported by I3SLoader');\n }\n\n const urlWithoutParams = getUrlWithoutParams(url);\n\n // auto detect file type based on url\n let isTileset;\n if (options.i3s.isTileset === 'auto') {\n isTileset = TILESET_REGEX.test(urlWithoutParams);\n } else {\n isTileset = options.i3s.isTileset;\n }\n\n let isTileHeader;\n if (options.isTileHeader === 'auto') {\n isTileHeader = TILE_HEADER_REGEX.test(urlWithoutParams);\n } else {\n isTileHeader = options.i3s.isTileHeader;\n }\n\n if (isTileset) {\n data = await parseTileset(data, options, context);\n } else if (isTileHeader) {\n data = await parseTile(data, context);\n } else {\n data = await parseTileContent(data, options);\n }\n\n return data;\n}\n\nasync function parseTileContent(arrayBuffer, options: I3SLoaderOptions) {\n return await parse(arrayBuffer, I3SContentLoader, options);\n}\n\nasync function parseTileset(data, options: I3SLoaderOptions, context) {\n const tilesetJson = JSON.parse(new TextDecoder().decode(data));\n\n if (tilesetJson?.layerType === POINT_CLOUD) {\n throw new Error('Point Cloud layers currently are not supported by I3SLoader');\n }\n\n const tilesetPostprocessed = await normalizeTilesetData(tilesetJson, options, context);\n return tilesetPostprocessed;\n}\n\nasync function parseTile(data, context) {\n data = JSON.parse(new TextDecoder().decode(data));\n return normalizeTileData(data, context);\n}\n\nfunction getMagicNumber(data) {\n if (data instanceof ArrayBuffer) {\n // slice binary data (4 bytes from the beginning) and transform it to hexadecimal numeral system\n return [...new Uint8Array(data, 0, 4)]\n .map((value) => value.toString(16).padStart(2, '0'))\n .join('');\n }\n return null;\n}\n"],"mappings":"AACA,SAAQA,KAAK,QAAO,kBAAkB;AAAC,SAE/BC,gBAAgB;AAAA,SAChBC,iBAAiB,EAAEC,oBAAoB;AAAA,SACvCC,iBAAiB;AAAA,SAEjBC,mBAAmB;AAI3B,MAAMC,OAAO,GAAG,OAAOC,WAAW,KAAK,WAAW,GAAGA,WAAW,GAAG,QAAQ;AAE3E,MAAMC,aAAa,GAAG,iBAAiB;AACvC,MAAMC,iBAAiB,GAAG,wBAAwB;AAClD,MAAMC,QAAQ,GAAG,UAAU;AAC3B,MAAMC,WAAW,GAAG,YAAY;AAShC,OAAO,MAAMC,SAAmE,GAAG;EACjFC,IAAI,EAAE,4BAA4B;EAClCC,EAAE,EAAE,KAAK;EACTC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEV,OAAO;EAChBW,SAAS,EAAE,CAAC,0BAA0B,CAAC;EACvCjB,KAAK,EAAEkB,QAAQ;EACfC,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBC,OAAO,EAAE;IACPC,GAAG,EAAE;MACHC,KAAK,EAAE,IAAI;MACXC,SAAS,EAAE,MAAM;MACjBC,YAAY,EAAE,MAAM;MACpBC,IAAI,EAAE,IAAI;MACVC,OAAO,EAAE,IAAI;MACbC,YAAY,EAAE,IAAI;MAClBC,eAAe,EAAE,IAAI;MACrBC,gBAAgB,EAAE,IAAI;MACtBC,qBAAqB,EAAE,IAAI;MAC3BC,cAAc,EAAE,IAAI;MACpBC,gBAAgB,EAAE5B,iBAAiB,CAAC6B;IACtC;EACF;AACF,CAAC;AAED,eAAef,QAAQA,CAACgB,IAAI,EAAsE;EAAA,IAApEd,OAAyB,GAAAe,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAA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WAAW,EAAE/C,gBAAgB,EAAEmB,OAAO,CAAC;AAC5D;AAEA,eAAeyB,YAAYA,CAACX,IAAI,EAAEd,OAAyB,EAAEkB,OAAO,EAAE;EACpE,MAAMW,WAAW,GAAGC,IAAI,CAAClD,KAAK,CAAC,IAAImD,WAAW,CAAC,CAAC,CAACC,MAAM,CAAClB,IAAI,CAAC,CAAC;EAE9D,IAAI,CAAAe,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAEI,SAAS,MAAK1C,WAAW,EAAE;IAC1C,MAAM,IAAI+B,KAAK,CAAC,6DAA6D,CAAC;EAChF;EAEA,MAAMY,oBAAoB,GAAG,MAAMnD,oBAAoB,CAAC8C,WAAW,EAAE7B,OAAO,EAAEkB,OAAO,CAAC;EACtF,OAAOgB,oBAAoB;AAC7B;AAEA,eAAeR,SAASA,CAACZ,IAAI,EAAEI,OAAO,EAAE;EACtCJ,IAAI,GAAGgB,IAAI,CAAClD,KAAK,CAAC,IAAImD,WAAW,CAAC,CAAC,CAACC,MAAM,CAAClB,IAAI,CAAC,CAAC;EACjD,OAAOhC,iBAAiB,CAACgC,IAAI,EAAEI,OAAO,CAAC;AACzC;AAEA,SAASG,cAAcA,CAACP,IAAI,EAAE;EAC5B,IAAIA,IAAI,YAAYqB,WAAW,EAAE;IAE/B,OAAO,CAAC,GAAG,IAAIC,UAAU,CAACtB,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CACnCuB,GAAG,CAAEC,KAAK,IAAKA,KAAK,CAACC,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CACnDC,IAAI,CAAC,EAAE,CAAC;EACb;EACA,OAAO,IAAI;AACb"}
1
+ {"version":3,"file":"i3s-loader.js","names":["parse","I3SContentLoader","normalizeTileData","normalizeTilesetData","COORDINATE_SYSTEM","getUrlWithoutParams","VERSION","TILESET_REGEX","TILE_HEADER_REGEX","SLPK_HEX","POINT_CLOUD","I3SLoader","name","id","module","version","mimeTypes","parseI3S","extensions","options","i3s","token","isTileset","isTileHeader","tile","tileset","_tileOptions","_tilesetOptions","useDracoGeometry","useCompressedTextures","decodeTextures","coordinateSystem","METER_OFFSETS","data","arguments","length","undefined","context","url","magicNumber","getMagicNumber","Error","urlWithoutParams","test","parseTileset","parseTile","parseTileContent","arrayBuffer","tilesetJson","JSON","TextDecoder","decode","layerType","tilesetPostprocessed","ArrayBuffer","Uint8Array","map","value","toString","padStart","join"],"sources":["../src/i3s-loader.ts"],"sourcesContent":["import type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport {parse} from '@loaders.gl/core';\nimport type {I3STilesetHeader} from './types';\nimport {I3SContentLoader} from './i3s-content-loader';\nimport {normalizeTileData, normalizeTilesetData} from './lib/parsers/parse-i3s';\nimport {COORDINATE_SYSTEM} from './lib/parsers/constants';\nimport {I3SParseOptions} from './types';\nimport {getUrlWithoutParams} 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';\n\nconst TILESET_REGEX = /layers\\/[0-9]+$/;\nconst TILE_HEADER_REGEX = /nodes\\/([0-9-]+|root)$/;\nconst SLPK_HEX = '504b0304';\nconst POINT_CLOUD = 'PointCloud';\n\nexport type I3SLoaderOptions = LoaderOptions & {\n i3s?: I3SParseOptions;\n};\n\n/**\n * Loader for I3S - Indexed 3D Scene Layer\n */\nexport const I3SLoader: LoaderWithParser<I3STilesetHeader, never, LoaderOptions> = {\n name: 'I3S (Indexed Scene Layers)',\n id: 'i3s',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/octet-stream'],\n parse: parseI3S,\n extensions: ['bin'],\n options: {\n i3s: {\n token: null,\n isTileset: 'auto',\n isTileHeader: 'auto',\n tile: null,\n tileset: null,\n _tileOptions: null,\n _tilesetOptions: null,\n useDracoGeometry: true,\n useCompressedTextures: true,\n decodeTextures: true,\n coordinateSystem: COORDINATE_SYSTEM.METER_OFFSETS\n }\n }\n};\n\nasync function parseI3S(data, options: I3SLoaderOptions = {}, context): Promise<I3STilesetHeader> {\n const url = context.url;\n options.i3s = options.i3s || {};\n const magicNumber = getMagicNumber(data);\n\n // check if file is slpk\n if (magicNumber === SLPK_HEX) {\n throw new Error('Files with .slpk extention currently are not supported by I3SLoader');\n }\n\n const urlWithoutParams = getUrlWithoutParams(url);\n\n // auto detect file type based on url\n let isTileset;\n if (options.i3s.isTileset === 'auto') {\n isTileset = TILESET_REGEX.test(urlWithoutParams);\n } else {\n isTileset = options.i3s.isTileset;\n }\n\n let isTileHeader;\n if (options.isTileHeader === 'auto') {\n isTileHeader = TILE_HEADER_REGEX.test(urlWithoutParams);\n } else {\n isTileHeader = options.i3s.isTileHeader;\n }\n\n if (isTileset) {\n data = await parseTileset(data, options, context);\n } else if (isTileHeader) {\n data = await parseTile(data, context);\n } else {\n data = await parseTileContent(data, options);\n }\n\n return data;\n}\n\nasync function parseTileContent(arrayBuffer, options: I3SLoaderOptions) {\n return await parse(arrayBuffer, I3SContentLoader, options);\n}\n\nasync function parseTileset(data, options: I3SLoaderOptions, context) {\n const tilesetJson = JSON.parse(new TextDecoder().decode(data));\n\n if (tilesetJson?.layerType === POINT_CLOUD) {\n throw new Error('Point Cloud layers currently are not supported by I3SLoader');\n }\n\n const tilesetPostprocessed = await normalizeTilesetData(tilesetJson, options, context);\n return tilesetPostprocessed;\n}\n\nasync function parseTile(data, context) {\n data = JSON.parse(new TextDecoder().decode(data));\n return normalizeTileData(data, context);\n}\n\nfunction getMagicNumber(data) {\n if (data instanceof ArrayBuffer) {\n // slice binary data (4 bytes from the beginning) and transform it to hexadecimal numeral system\n return [...new Uint8Array(data, 0, 4)]\n .map((value) => value.toString(16).padStart(2, '0'))\n .join('');\n }\n return null;\n}\n"],"mappings":"AACA,SAAQA,KAAK,QAAO,kBAAkB;AAAC,SAE/BC,gBAAgB;AAAA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CAAC;EAE9D,IAAI,CAAAe,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAEI,SAAS,MAAK1C,WAAW,EAAE;IAC1C,MAAM,IAAI+B,KAAK,CAAC,6DAA6D,CAAC;EAChF;EAEA,MAAMY,oBAAoB,GAAG,MAAMlD,oBAAoB,CAAC6C,WAAW,EAAE7B,OAAO,EAAEkB,OAAO,CAAC;EACtF,OAAOgB,oBAAoB;AAC7B;AAEA,eAAeR,SAASA,CAACZ,IAAI,EAAEI,OAAO,EAAE;EACtCJ,IAAI,GAAGgB,IAAI,CAACjD,KAAK,CAAC,IAAIkD,WAAW,CAAC,CAAC,CAACC,MAAM,CAAClB,IAAI,CAAC,CAAC;EACjD,OAAO/B,iBAAiB,CAAC+B,IAAI,EAAEI,OAAO,CAAC;AACzC;AAEA,SAASG,cAAcA,CAACP,IAAI,EAAE;EAC5B,IAAIA,IAAI,YAAYqB,WAAW,EAAE;IAE/B,OAAO,CAAC,GAAG,IAAIC,UAAU,CAACtB,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CACnCuB,GAAG,CAAEC,KAAK,IAAKA,KAAK,CAACC,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CACnDC,IAAI,CAAC,EAAE,CAAC;EACb;EACA,OAAO,IAAI;AACb"}
@@ -1,4 +1,4 @@
1
- const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
1
+ const VERSION = typeof "4.1.0-alpha.4" !== 'undefined' ? "4.1.0-alpha.4" : 'latest';
2
2
  export const I3SNodePageLoader = {
3
3
  name: 'I3S Node Page',
4
4
  id: 'i3s-node-page',
@@ -1 +1 @@
1
- {"version":3,"file":"i3s-node-page-loader.js","names":["VERSION","__VERSION__","I3SNodePageLoader","name","id","module","version","mimeTypes","parse","parseNodePage","extensions","options","i3s","data","JSON","TextDecoder","decode"],"sources":["../src/i3s-node-page-loader.ts"],"sourcesContent":["import type {LoaderOptions, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {I3SLoaderOptions} from './i3s-loader';\nimport type {NodePage} from './types';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/**\n * Loader for I3S node pages\n */\nexport const I3SNodePageLoader: LoaderWithParser<NodePage, never, I3SLoaderOptions> = {\n name: 'I3S Node Page',\n id: 'i3s-node-page',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/json'],\n parse: parseNodePage,\n extensions: ['json'],\n options: {\n i3s: {}\n }\n};\n\nasync function parseNodePage(data: ArrayBuffer, options?: LoaderOptions): Promise<NodePage> {\n return JSON.parse(new TextDecoder().decode(data)) as NodePage;\n}\n"],"mappings":"AAMA,MAAMA,OAAO,GAAG,OAAOC,WAAW,KAAK,WAAW,GAAGA,WAAW,GAAG,QAAQ;AAK3E,OAAO,MAAMC,iBAAsE,GAAG;EACpFC,IAAI,EAAE,eAAe;EACrBC,EAAE,EAAE,eAAe;EACnBC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEN,OAAO;EAChBO,SAAS,EAAE,CAAC,kBAAkB,CAAC;EAC/BC,KAAK,EAAEC,aAAa;EACpBC,UAAU,EAAE,CAAC,MAAM,CAAC;EACpBC,OAAO,EAAE;IACPC,GAAG,EAAE,CAAC;EACR;AACF,CAAC;AAED,eAAeH,aAAaA,CAACI,IAAiB,EAAEF,OAAuB,EAAqB;EAC1F,OAAOG,IAAI,CAACN,KAAK,CAAC,IAAIO,WAAW,CAAC,CAAC,CAACC,MAAM,CAACH,IAAI,CAAC,CAAC;AACnD"}
1
+ {"version":3,"file":"i3s-node-page-loader.js","names":["VERSION","I3SNodePageLoader","name","id","module","version","mimeTypes","parse","parseNodePage","extensions","options","i3s","data","JSON","TextDecoder","decode"],"sources":["../src/i3s-node-page-loader.ts"],"sourcesContent":["import type {LoaderOptions, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {I3SLoaderOptions} from './i3s-loader';\nimport type {NodePage} from './types';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/**\n * Loader for I3S node pages\n */\nexport const I3SNodePageLoader: LoaderWithParser<NodePage, never, I3SLoaderOptions> = {\n name: 'I3S Node Page',\n id: 'i3s-node-page',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/json'],\n parse: parseNodePage,\n extensions: ['json'],\n options: {\n i3s: {}\n }\n};\n\nasync function parseNodePage(data: ArrayBuffer, options?: LoaderOptions): Promise<NodePage> {\n return JSON.parse(new TextDecoder().decode(data)) as NodePage;\n}\n"],"mappings":"AAMA,MAAMA,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,QAAQ;AAK3E,OAAO,MAAMC,iBAAsE,GAAG;EACpFC,IAAI,EAAE,eAAe;EACrBC,EAAE,EAAE,eAAe;EACnBC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEL,OAAO;EAChBM,SAAS,EAAE,CAAC,kBAAkB,CAAC;EAC/BC,KAAK,EAAEC,aAAa;EACpBC,UAAU,EAAE,CAAC,MAAM,CAAC;EACpBC,OAAO,EAAE;IACPC,GAAG,EAAE,CAAC;EACR;AACF,CAAC;AAED,eAAeH,aAAaA,CAACI,IAAiB,EAAEF,OAAuB,EAAqB;EAC1F,OAAOG,IAAI,CAACN,KAAK,CAAC,IAAIO,WAAW,CAAC,CAAC,CAACC,MAAM,CAACH,IAAI,CAAC,CAAC;AACnD"}
@@ -1,6 +1,6 @@
1
1
  import { DataViewFile } from '@loaders.gl/loader-utils';
2
2
  import { parseSLPKArchive } from "./lib/parsers/parse-slpk/parse-slpk.js";
3
- const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
3
+ const VERSION = typeof "4.1.0-alpha.4" !== 'undefined' ? "4.1.0-alpha.4" : 'latest';
4
4
  export const SLPKLoader = {
5
5
  name: 'I3S SLPK (Scene Layer Package)',
6
6
  id: 'slpk',
@@ -1 +1 @@
1
- {"version":3,"file":"i3s-slpk-loader.js","names":["DataViewFile","parseSLPKArchive","VERSION","__VERSION__","SLPKLoader","name","id","module","version","mimeTypes","extensions","options","parse","data","_options$slpk$path","_options$slpk","_options$slpk2","arguments","length","undefined","archive","DataView","getFile","slpk","path","pathMode"],"sources":["../src/i3s-slpk-loader.ts"],"sourcesContent":["import type {LoaderOptions, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {DataViewFile} from '@loaders.gl/loader-utils';\nimport {parseSLPKArchive} from './lib/parsers/parse-slpk/parse-slpk';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/** options to load data from SLPK */\nexport type SLPKLoaderOptions = LoaderOptions & {\n slpk?: {\n /** path inside the slpk archive */\n path?: string;\n /** mode of the path */\n pathMode?: 'http' | 'raw';\n };\n};\n\n/**\n * Loader for SLPK - Scene Layer Package (Archive I3S format)\n * @todo - this reloads the entire archive for every tile, should be optimized\n * @todo - this should be updated to use `parseFile` and ReadableFile\n */\nexport const SLPKLoader: LoaderWithParser<ArrayBuffer, never, SLPKLoaderOptions> = {\n name: 'I3S SLPK (Scene Layer Package)',\n id: 'slpk',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/octet-stream'],\n extensions: ['slpk'],\n options: {},\n parse: async (data: ArrayBuffer, options: SLPKLoaderOptions = {}): Promise<ArrayBuffer> => {\n const archive = await parseSLPKArchive(new DataViewFile(new DataView(data)));\n return archive.getFile(options.slpk?.path ?? '', options.slpk?.pathMode);\n }\n};\n"],"mappings":"AACA,SAAQA,YAAY,QAAO,0BAA0B;AAAC,SAC9CC,gBAAgB;AAIxB,MAAMC,OAAO,GAAG,OAAOC,WAAW,KAAK,WAAW,GAAGA,WAAW,GAAG,QAAQ;AAiB3E,OAAO,MAAMC,UAAmE,GAAG;EACjFC,IAAI,EAAE,gCAAgC;EACtCC,EAAE,EAAE,MAAM;EACVC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEN,OAAO;EAChBO,SAAS,EAAE,CAAC,0BAA0B,CAAC;EACvCC,UAAU,EAAE,CAAC,MAAM,CAAC;EACpBC,OAAO,EAAE,CAAC,CAAC;EACXC,KAAK,EAAE,eAAAA,CAAOC,IAAiB,EAA4D;IAAA,IAAAC,kBAAA,EAAAC,aAAA,EAAAC,cAAA;IAAA,IAA1DL,OAA0B,GAAAM,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;IAC9D,MAAMG,OAAO,GAAG,MAAMnB,gBAAgB,CAAC,IAAID,YAAY,CAAC,IAAIqB,QAAQ,CAACR,IAAI,CAAC,CAAC,CAAC;IAC5E,OAAOO,OAAO,CAACE,OAAO,EAAAR,kBAAA,IAAAC,aAAA,GAACJ,OAAO,CAACY,IAAI,cAAAR,aAAA,uBAAZA,aAAA,CAAcS,IAAI,cAAAV,kBAAA,cAAAA,kBAAA,GAAI,EAAE,GAAAE,cAAA,GAAEL,OAAO,CAACY,IAAI,cAAAP,cAAA,uBAAZA,cAAA,CAAcS,QAAQ,CAAC;EAC1E;AACF,CAAC"}
1
+ {"version":3,"file":"i3s-slpk-loader.js","names":["DataViewFile","parseSLPKArchive","VERSION","SLPKLoader","name","id","module","version","mimeTypes","extensions","options","parse","data","_options$slpk$path","_options$slpk","_options$slpk2","arguments","length","undefined","archive","DataView","getFile","slpk","path","pathMode"],"sources":["../src/i3s-slpk-loader.ts"],"sourcesContent":["import type {LoaderOptions, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {DataViewFile} from '@loaders.gl/loader-utils';\nimport {parseSLPKArchive} from './lib/parsers/parse-slpk/parse-slpk';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/** options to load data from SLPK */\nexport type SLPKLoaderOptions = LoaderOptions & {\n slpk?: {\n /** path inside the slpk archive */\n path?: string;\n /** mode of the path */\n pathMode?: 'http' | 'raw';\n };\n};\n\n/**\n * Loader for SLPK - Scene Layer Package (Archive I3S format)\n * @todo - this reloads the entire archive for every tile, should be optimized\n * @todo - this should be updated to use `parseFile` and ReadableFile\n */\nexport const SLPKLoader: LoaderWithParser<ArrayBuffer, never, SLPKLoaderOptions> = {\n name: 'I3S SLPK (Scene Layer Package)',\n id: 'slpk',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/octet-stream'],\n extensions: ['slpk'],\n options: {},\n parse: async (data: ArrayBuffer, options: SLPKLoaderOptions = {}): Promise<ArrayBuffer> => {\n const archive = await parseSLPKArchive(new DataViewFile(new DataView(data)));\n return archive.getFile(options.slpk?.path ?? '', options.slpk?.pathMode);\n }\n};\n"],"mappings":"AACA,SAAQA,YAAY,QAAO,0BAA0B;AAAC,SAC9CC,gBAAgB;AAIxB,MAAMC,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,QAAQ;AAiB3E,OAAO,MAAMC,UAAmE,GAAG;EACjFC,IAAI,EAAE,gCAAgC;EACtCC,EAAE,EAAE,MAAM;EACVC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEL,OAAO;EAChBM,SAAS,EAAE,CAAC,0BAA0B,CAAC;EACvCC,UAAU,EAAE,CAAC,MAAM,CAAC;EACpBC,OAAO,EAAE,CAAC,CAAC;EACXC,KAAK,EAAE,eAAAA,CAAOC,IAAiB,EAA4D;IAAA,IAAAC,kBAAA,EAAAC,aAAA,EAAAC,cAAA;IAAA,IAA1DL,OAA0B,GAAAM,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;IAC9D,M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B,CAAC;AACzD,OAAO,EAAC,oBAAoB,EAAC,MAAM,0BAA0B,CAAC;AAE9D,YAAY,EAAC,WAAW,EAAC,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAC,gBAAgB,EAAC,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["COORDINATE_SYSTEM","I3SLoader","SLPKLoader","I3SContentLoader","I3SAttributeLoader","loadFeatureAttributes","I3SBuildingSceneLayerLoader","I3SNodePageLoader","ArcGISWebSceneLoader","parseSLPKArchive","customizeColors"],"sources":["../src/index.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\n\nexport type {\n BoundingVolumes,\n Mbs,\n Obb,\n I3STilesetHeader,\n I3STileContent,\n I3STileHeader,\n SceneLayer3D,\n AttributeStorageInfo,\n Field,\n ESRIField,\n PopupInfo,\n Node3DIndexDocument,\n LodSelection,\n NodeReference,\n Resource,\n MaxScreenThresholdSQ,\n NodeInPage,\n SharedResources,\n Attribute,\n Extent,\n FeatureAttribute,\n FieldInfo,\n I3SMaterialDefinition,\n TextureDefinitionInfo,\n MaterialDefinitionInfo,\n FullExtent,\n StatisticsInfo,\n StatsInfo,\n Histogram,\n ValueCount,\n BuildingSceneSublayer,\n OperationalLayer,\n TextureSetDefinitionFormats\n} from './types';\nexport type {I3SLoaderOptions} from './i3s-loader';\n\nexport {COORDINATE_SYSTEM} from './lib/parsers/constants';\n\nexport {I3SLoader} from './i3s-loader';\nexport {SLPKLoader} from './i3s-slpk-loader';\nexport {I3SContentLoader} from './i3s-content-loader';\nexport {I3SAttributeLoader, loadFeatureAttributes} from './i3s-attribute-loader';\nexport {I3SBuildingSceneLayerLoader} from './i3s-building-scene-layer-loader';\nexport {I3SNodePageLoader} from './i3s-node-page-loader';\nexport {ArcGISWebSceneLoader} from './arcgis-webscene-loader';\n\nexport type {SLPKArchive} from './lib/parsers/parse-slpk/slpk-archieve';\nexport {parseSLPKArchive} from './lib/parsers/parse-slpk/parse-slpk';\nexport {customizeColors} from './lib/utils/customize-colors';\n"],"mappings":"SAwCQA,iBAAiB;AAAA,SAEjBC,SAAS;AAAA,SACTC,UAAU;AAAA,SACVC,gBAAgB;AAAA,SAChBC,kBAAkB,EAAEC,qBAAqB;AAAA,SACzCC,2BAA2B;AAAA,SAC3BC,iBAAiB;AAAA,SACjBC,oBAAoB;AAAA,SAGpBC,gBAAgB;AAAA,SAChBC,eAAe"}
1
+ {"version":3,"file":"index.js","names":["COORDINATE_SYSTEM","I3SLoader","SLPKLoader","I3SContentLoader","I3SAttributeLoader","loadFeatureAttributes","I3SBuildingSceneLayerLoader","I3SNodePageLoader","ArcGISWebSceneLoader","parseSLPKArchive","customizeColors"],"sources":["../src/index.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport type {\n BoundingVolumes,\n Mbs,\n Obb,\n I3STilesetHeader,\n I3STileContent,\n I3STileHeader,\n SceneLayer3D,\n AttributeStorageInfo,\n Field,\n ESRIField,\n PopupInfo,\n Node3DIndexDocument,\n LodSelection,\n NodeReference,\n Resource,\n MaxScreenThresholdSQ,\n NodeInPage,\n SharedResources,\n Attribute,\n Extent,\n FeatureAttribute,\n FieldInfo,\n I3SMaterialDefinition,\n TextureDefinitionInfo,\n MaterialDefinitionInfo,\n FullExtent,\n StatisticsInfo,\n StatsInfo,\n Histogram,\n ValueCount,\n BuildingSceneSublayer,\n OperationalLayer,\n TextureSetDefinitionFormats\n} from './types';\nexport type {I3SLoaderOptions} from './i3s-loader';\n\nexport {COORDINATE_SYSTEM} from './lib/parsers/constants';\n\nexport {I3SLoader} from './i3s-loader';\nexport {SLPKLoader} from './i3s-slpk-loader';\nexport {I3SContentLoader} from './i3s-content-loader';\nexport {I3SAttributeLoader, loadFeatureAttributes} from './i3s-attribute-loader';\nexport {I3SBuildingSceneLayerLoader} from './i3s-building-scene-layer-loader';\nexport {I3SNodePageLoader} from './i3s-node-page-loader';\nexport {ArcGISWebSceneLoader} from './arcgis-webscene-loader';\n\nexport type {SLPKArchive} from './lib/parsers/parse-slpk/slpk-archieve';\nexport {parseSLPKArchive} from './lib/parsers/parse-slpk/parse-slpk';\nexport {customizeColors} from './lib/utils/customize-colors';\n"],"mappings":"SAyCQA,iBAAiB;AAAA,SAEjBC,SAAS;AAAA,SACTC,UAAU;AAAA,SACVC,gBAAgB;AAAA,SAChBC,kBAAkB,EAAEC,qBAAqB;AAAA,SACzCC,2BAA2B;AAAA,SAC3BC,iBAAiB;AAAA,SACjBC,oBAAoB;AAAA,SAGpBC,gBAAgB;AAAA,SAChBC,eAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/lib/parsers/constants.ts"],"names":[],"mappings":"AAKA,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,+HAe3D;AAED,eAAO,MAAM,WAAW,EAAE;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAM/C,CAAC;AACF;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAkB/C;AAED,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAC9C,eAAO,MAAM,wBAAwB,UAAU,CAAC;AAChD,eAAO,MAAM,aAAa,YAAY,CAAC;AACvC,eAAO,MAAM,qBAAqB,UAAU,CAAC;AAI7C,oBAAY,iBAAiB;IAC3B;;OAEG;IACH,OAAO,KAAK;IACZ;;;OAGG;IACH,MAAM,IAAI;IACV;;OAEG;IACH,aAAa,IAAI;IACjB;;;;OAIG;IACH,cAAc,IAAI;IAClB;;OAEG;IACH,SAAS,IAAI;CACd"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/lib/parsers/constants.ts"],"names":[],"mappings":"AAMA,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,+HAe3D;AAED,eAAO,MAAM,WAAW,EAAE;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAM/C,CAAC;AACF;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAkB/C;AAED,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAC9C,eAAO,MAAM,wBAAwB,UAAU,CAAC;AAChD,eAAO,MAAM,aAAa,YAAY,CAAC;AACvC,eAAO,MAAM,qBAAqB,UAAU,CAAC;AAI7C,oBAAY,iBAAiB;IAC3B;;OAEG;IACH,OAAO,KAAK;IACZ;;;OAGG;IACH,MAAM,IAAI;IACV;;OAEG;IACH,aAAa,IAAI;IACjB;;;;OAIG;IACH,cAAc,IAAI;IAClB;;OAEG;IACH,SAAS,IAAI;CACd"}
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","names":["GL","getConstructorForDataFormat","dataType","Uint8Array","Uint16Array","Uint32Array","Float32Array","Float64Array","Error","GL_TYPE_MAP","UInt8","UNSIGNED_BYTE","UInt16","UNSIGNED_SHORT","Float32","FLOAT","UInt32","UNSIGNED_INT","UInt64","DOUBLE","sizeOf","STRING_ATTRIBUTE_TYPE","OBJECT_ID_ATTRIBUTE_TYPE","FLOAT_64_TYPE","INT_16_ATTRIBUTE_TYPE","COORDINATE_SYSTEM"],"sources":["../../../src/lib/parsers/constants.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\n\nimport {GL} from '@loaders.gl/math';\n\nexport function getConstructorForDataFormat(dataType: string) {\n switch (dataType) {\n case 'UInt8':\n return Uint8Array;\n case 'UInt16':\n return Uint16Array;\n case 'UInt32':\n return Uint32Array;\n case 'Float32':\n return Float32Array;\n case 'UInt64':\n return Float64Array;\n default:\n throw new Error(`parse i3s tile content: unknown type of data: ${dataType}`);\n }\n}\n\nexport const GL_TYPE_MAP: {[key: string]: number} = {\n UInt8: GL.UNSIGNED_BYTE,\n UInt16: GL.UNSIGNED_SHORT,\n Float32: GL.FLOAT,\n UInt32: GL.UNSIGNED_INT,\n UInt64: GL.DOUBLE\n};\n/**\n * Returns how many bytes a type occupies\n * @param dataType\n * @returns\n */\nexport function sizeOf(dataType: string): number {\n switch (dataType) {\n case 'UInt8':\n return 1;\n case 'UInt16':\n case 'Int16':\n return 2;\n case 'UInt32':\n case 'Int32':\n case 'Float32':\n return 4;\n case 'UInt64':\n case 'Int64':\n case 'Float64':\n return 8;\n default:\n throw new Error(`parse i3s tile content: unknown size of data: ${dataType}`);\n }\n}\n\nexport const STRING_ATTRIBUTE_TYPE = 'String';\nexport const OBJECT_ID_ATTRIBUTE_TYPE = 'Oid32';\nexport const FLOAT_64_TYPE = 'Float64';\nexport const INT_16_ATTRIBUTE_TYPE = 'Int16';\n\n// https://github.com/visgl/deck.gl/blob/9548f43cba2234a1f4877b6b17f6c88eb35b2e08/modules/core/src/lib/constants.js#L27\n// Describes the format of positions\nexport enum COORDINATE_SYSTEM {\n /**\n * `LNGLAT` if rendering into a geospatial viewport, `CARTESIAN` otherwise\n */\n DEFAULT = -1,\n /**\n * Positions are interpreted as [lng, lat, elevation]\n * lng lat are degrees, elevation is meters. distances as meters.\n */\n LNGLAT = 1,\n /**\n * Positions are interpreted as meter offsets, distances as meters\n */\n METER_OFFSETS = 2,\n /**\n * Positions are interpreted as lng lat offsets: [deltaLng, deltaLat, elevation]\n * deltaLng, deltaLat are delta degrees, elevation is meters.\n * distances as meters.\n */\n LNGLAT_OFFSETS = 3,\n /**\n * Non-geospatial\n */\n CARTESIAN = 0\n}\n"],"mappings":"AAGA,SAAQA,EAAE,QAAO,kBAAkB;AAEnC,OAAO,SAASC,2BAA2BA,CAACC,QAAgB,EAAE;EAC5D,QAAQA,QAAQ;IACd,KAAK,OAAO;MACV,OAAOC,UAAU;IACnB,KAAK,QAAQ;MACX,OAAOC,WAAW;IACpB,KAAK,QAAQ;MACX,OAAOC,WAAW;IACpB,KAAK,SAAS;MACZ,OAAOC,YAAY;IACrB,KAAK,QAAQ;MACX,OAAOC,YAAY;IACrB;MACE,MAAM,IAAIC,KAAK,CAAE,iDAAgDN,QAAS,EAAC,CAAC;EAChF;AACF;AAEA,OAAO,MAAMO,WAAoC,GAAG;EAClDC,KAAK,EAAEV,EAAE,CAACW,aAAa;EACvBC,MAAM,EAAEZ,EAAE,CAACa,cAAc;EACzBC,OAAO,EAAEd,EAAE,CAACe,KAAK;EACjBC,MAAM,EAAEhB,EAAE,CAACiB,YAAY;EACvBC,MAAM,EAAElB,EAAE,CAACmB;AACb,CAAC;AAMD,OAAO,SAASC,MAAMA,CAAClB,QAAgB,EAAU;EAC/C,QAAQA,QAAQ;IACd,KAAK,OAAO;MACV,OAAO,CAAC;IACV,KAAK,QAAQ;IACb,KAAK,OAAO;MACV,OAAO,CAAC;IACV,KAAK,QAAQ;IACb,KAAK,OAAO;IACZ,KAAK,SAAS;MACZ,OAAO,CAAC;IACV,KAAK,QAAQ;IACb,KAAK,OAAO;IACZ,KAAK,SAAS;MACZ,OAAO,CAAC;IACV;MACE,MAAM,IAAIM,KAAK,CAAE,iDAAgDN,QAAS,EAAC,CAAC;EAChF;AACF;AAEA,OAAO,MAAMmB,qBAAqB,GAAG,QAAQ;AAC7C,OAAO,MAAMC,wBAAwB,GAAG,OAAO;AAC/C,OAAO,MAAMC,aAAa,GAAG,SAAS;AACtC,OAAO,MAAMC,qBAAqB,GAAG,OAAO;AAI5C,WAAYC,iBAAiB,aAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA"}
1
+ {"version":3,"file":"constants.js","names":["GL","getConstructorForDataFormat","dataType","Uint8Array","Uint16Array","Uint32Array","Float32Array","Float64Array","Error","GL_TYPE_MAP","UInt8","UNSIGNED_BYTE","UInt16","UNSIGNED_SHORT","Float32","FLOAT","UInt32","UNSIGNED_INT","UInt64","DOUBLE","sizeOf","STRING_ATTRIBUTE_TYPE","OBJECT_ID_ATTRIBUTE_TYPE","FLOAT_64_TYPE","INT_16_ATTRIBUTE_TYPE","COORDINATE_SYSTEM"],"sources":["../../../src/lib/parsers/constants.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {GL} from '@loaders.gl/math';\n\nexport function getConstructorForDataFormat(dataType: string) {\n switch (dataType) {\n case 'UInt8':\n return Uint8Array;\n case 'UInt16':\n return Uint16Array;\n case 'UInt32':\n return Uint32Array;\n case 'Float32':\n return Float32Array;\n case 'UInt64':\n return Float64Array;\n default:\n throw new Error(`parse i3s tile content: unknown type of data: ${dataType}`);\n }\n}\n\nexport const GL_TYPE_MAP: {[key: string]: number} = {\n UInt8: GL.UNSIGNED_BYTE,\n UInt16: GL.UNSIGNED_SHORT,\n Float32: GL.FLOAT,\n UInt32: GL.UNSIGNED_INT,\n UInt64: GL.DOUBLE\n};\n/**\n * Returns how many bytes a type occupies\n * @param dataType\n * @returns\n */\nexport function sizeOf(dataType: string): number {\n switch (dataType) {\n case 'UInt8':\n return 1;\n case 'UInt16':\n case 'Int16':\n return 2;\n case 'UInt32':\n case 'Int32':\n case 'Float32':\n return 4;\n case 'UInt64':\n case 'Int64':\n case 'Float64':\n return 8;\n default:\n throw new Error(`parse i3s tile content: unknown size of data: ${dataType}`);\n }\n}\n\nexport const STRING_ATTRIBUTE_TYPE = 'String';\nexport const OBJECT_ID_ATTRIBUTE_TYPE = 'Oid32';\nexport const FLOAT_64_TYPE = 'Float64';\nexport const INT_16_ATTRIBUTE_TYPE = 'Int16';\n\n// https://github.com/visgl/deck.gl/blob/9548f43cba2234a1f4877b6b17f6c88eb35b2e08/modules/core/src/lib/constants.js#L27\n// Describes the format of positions\nexport enum COORDINATE_SYSTEM {\n /**\n * `LNGLAT` if rendering into a geospatial viewport, `CARTESIAN` otherwise\n */\n DEFAULT = -1,\n /**\n * Positions are interpreted as [lng, lat, elevation]\n * lng lat are degrees, elevation is meters. distances as meters.\n */\n LNGLAT = 1,\n /**\n * Positions are interpreted as meter offsets, distances as meters\n */\n METER_OFFSETS = 2,\n /**\n * Positions are interpreted as lng lat offsets: [deltaLng, deltaLat, elevation]\n * deltaLng, deltaLat are delta degrees, elevation is meters.\n * distances as meters.\n */\n LNGLAT_OFFSETS = 3,\n /**\n * Non-geospatial\n */\n CARTESIAN = 0\n}\n"],"mappings":"AAIA,SAAQA,EAAE,QAAO,kBAAkB;AAEnC,OAAO,SAASC,2BAA2BA,CAACC,QAAgB,EAAE;EAC5D,QAAQA,QAAQ;IACd,KAAK,OAAO;MACV,OAAOC,UAAU;IACnB,KAAK,QAAQ;MACX,OAAOC,WAAW;IACpB,KAAK,QAAQ;MACX,OAAOC,WAAW;IACpB,KAAK,SAAS;MACZ,OAAOC,YAAY;IACrB,KAAK,QAAQ;MACX,OAAOC,YAAY;IACrB;MACE,MAAM,IAAIC,KAAK,CAAE,iDAAgDN,QAAS,EAAC,CAAC;EAChF;AACF;AAEA,OAAO,MAAMO,WAAoC,GAAG;EAClDC,KAAK,EAAEV,EAAE,CAACW,aAAa;EACvBC,MAAM,EAAEZ,EAAE,CAACa,cAAc;EACzBC,OAAO,EAAEd,EAAE,CAACe,KAAK;EACjBC,MAAM,EAAEhB,EAAE,CAACiB,YAAY;EACvBC,MAAM,EAAElB,EAAE,CAACmB;AACb,CAAC;AAMD,OAAO,SAASC,MAAMA,CAAClB,QAAgB,EAAU;EAC/C,QAAQA,QAAQ;IACd,KAAK,OAAO;MACV,OAAO,CAAC;IACV,KAAK,QAAQ;IACb,KAAK,OAAO;MACV,OAAO,CAAC;IACV,KAAK,QAAQ;IACb,KAAK,OAAO;IACZ,KAAK,SAAS;MACZ,OAAO,CAAC;IACV,KAAK,QAAQ;IACb,KAAK,OAAO;IACZ,KAAK,SAAS;MACZ,OAAO,CAAC;IACV;MACE,MAAM,IAAIM,KAAK,CAAE,iDAAgDN,QAAS,EAAC,CAAC;EAChF;AACF;AAEA,OAAO,MAAMmB,qBAAqB,GAAG,QAAQ;AAC7C,OAAO,MAAMC,wBAAwB,GAAG,OAAO;AAC/C,OAAO,MAAMC,aAAa,GAAG,SAAS;AACtC,OAAO,MAAMC,qBAAqB,GAAG,OAAO;AAI5C,WAAYC,iBAAiB,aAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"parse-i3s-attribute.d.ts","sourceRoot":"","sources":["../../../src/lib/parsers/parse-i3s-attribute.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAS9C,KAAK,SAAS,GAAG,MAAM,EAAE,GAAG,UAAU,GAAG,IAAI,CAAC;AAC9C,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAE1D;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,KAAA,GAAG,iBAAiB,CAS1F"}
1
+ {"version":3,"file":"parse-i3s-attribute.d.ts","sourceRoot":"","sources":["../../../src/lib/parsers/parse-i3s-attribute.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAS9C,KAAK,SAAS,GAAG,MAAM,EAAE,GAAG,UAAU,GAAG,IAAI,CAAC;AAC9C,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAE1D;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,KAAA,GAAG,iBAAiB,CAS1F"}
@@ -1 +1 @@
1
- {"version":3,"file":"parse-i3s-attribute.js","names":["STRING_ATTRIBUTE_TYPE","OBJECT_ID_ATTRIBUTE_TYPE","FLOAT_64_TYPE","INT_16_ATTRIBUTE_TYPE","parseI3STileAttribute","arrayBuffer","options","attributeName","attributeType","parseAttribute","parseStringsAttribute","parseShortNumberAttribute","parseFloatAttribute","parseInt16ShortNumberAttribute","countOffset","Uint32Array","Int16Array","Float64Array","stringsCountOffset","dataOffset","bytesPerStringSize","stringsArray","stringsCount","DataView","getUint32","stringSizes","stringOffset","stringByteSize","textDecoder","TextDecoder","stringAttribute","Uint8Array","push","decode","error","console","message"],"sources":["../../../src/lib/parsers/parse-i3s-attribute.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\n\nimport {TypedArray} from '@loaders.gl/schema';\n\nimport {\n STRING_ATTRIBUTE_TYPE,\n OBJECT_ID_ATTRIBUTE_TYPE,\n FLOAT_64_TYPE,\n INT_16_ATTRIBUTE_TYPE\n} from './constants';\n\ntype Attribute = string[] | TypedArray | null;\nexport type I3STileAttributes = Record<string, Attribute>;\n\n/**\n * Get particular tile and creates attribute object inside.\n * @param arrayBuffer\n * @param {Object} options\n * @returns {Promise<object>}\n */\nexport function parseI3STileAttribute(arrayBuffer: ArrayBuffer, options): I3STileAttributes {\n const {attributeName, attributeType} = options;\n\n if (!attributeName) {\n return {};\n }\n return {\n [attributeName]: attributeType ? parseAttribute(attributeType, arrayBuffer) : null\n };\n}\n\n/**\n * Parse attributes based on attribute type.\n * @param {String} attributeType\n * @param arrayBuffer\n * @returns\n */\nfunction parseAttribute(attributeType, arrayBuffer: ArrayBuffer): Attribute {\n switch (attributeType) {\n case STRING_ATTRIBUTE_TYPE:\n return parseStringsAttribute(arrayBuffer);\n case OBJECT_ID_ATTRIBUTE_TYPE:\n return parseShortNumberAttribute(arrayBuffer);\n case FLOAT_64_TYPE:\n return parseFloatAttribute(arrayBuffer);\n case INT_16_ATTRIBUTE_TYPE:\n return parseInt16ShortNumberAttribute(arrayBuffer);\n default:\n return parseShortNumberAttribute(arrayBuffer);\n }\n}\n\n/**\n * Parse short number attribute.\n * Short Integer spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.7/attributeStorageInfo.cmn.md\n * @param arrayBuffer\n * @returns\n */\nfunction parseShortNumberAttribute(arrayBuffer: ArrayBuffer): Uint32Array {\n const countOffset = 4;\n return new Uint32Array(arrayBuffer, countOffset);\n}\n\n/**\n * Parse Int16 short number attribute.\n * Parsing of such data is not documented. Added to handle Building Scene Layer Tileset attributes data.\n * @param arrayBuffer\n * @returns\n */\nfunction parseInt16ShortNumberAttribute(arrayBuffer: ArrayBuffer): Int16Array {\n const countOffset = 4;\n return new Int16Array(arrayBuffer, countOffset);\n}\n\n/**\n * Parse float attribute.\n * Double Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.7/attributeStorageInfo.cmn.md\n * @param arrayBuffer\n * @returns\n */\nfunction parseFloatAttribute(arrayBuffer: ArrayBuffer): Float64Array {\n const countOffset = 8;\n return new Float64Array(arrayBuffer, countOffset);\n}\n\n/**\n * Parse string attribute.\n * String spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.7/attributeStorageInfo.cmn.md\n * @param arrayBuffer\n * @returns list of strings\n */\nfunction parseStringsAttribute(arrayBuffer: ArrayBuffer): string[] {\n const stringsCountOffset = 0;\n const dataOffset = 8;\n const bytesPerStringSize = 4;\n const stringsArray: string[] = [];\n\n try {\n // Use DataView to avoid multiple of 4 error on Uint32Array constructor\n const stringsCount = new DataView(\n arrayBuffer,\n stringsCountOffset,\n bytesPerStringSize\n ).getUint32(stringsCountOffset, true);\n const stringSizes = new Uint32Array(arrayBuffer, dataOffset, stringsCount);\n let stringOffset = dataOffset + stringsCount * bytesPerStringSize;\n\n for (const stringByteSize of stringSizes) {\n const textDecoder = new TextDecoder('utf-8');\n const stringAttribute = new Uint8Array(arrayBuffer, stringOffset, stringByteSize);\n stringsArray.push(textDecoder.decode(stringAttribute));\n stringOffset += stringByteSize;\n }\n } catch (error) {\n console.error('Parse string attribute error: ', (error as Error).message); // eslint-disable-line\n }\n\n return stringsArray;\n}\n"],"mappings":"SAMEA,qBAAqB,EACrBC,wBAAwB,EACxBC,aAAa,EACbC,qBAAqB;AAYvB,OAAO,SAASC,qBAAqBA,CAACC,WAAwB,EAAEC,OAAO,EAAqB;EAC1F,MAAM;IAACC,aAAa;IAAEC;EAAa,CAAC,GAAGF,OAAO;EAE9C,IAAI,CAACC,aAAa,EAAE;IAClB,OAAO,CAAC,CAAC;EACX;EACA,OAAO;IACL,CAACA,aAAa,GAAGC,aAAa,GAAGC,cAAc,CAACD,aAAa,EAAEH,WAAW,CAAC,GAAG;EAChF,CAAC;AACH;AAQA,SAASI,cAAcA,CAACD,aAAa,EAAEH,WAAwB,EAAa;EAC1E,QAAQG,aAAa;IACnB,KAAKR,qBAAqB;MACxB,OAAOU,qBAAqB,CAACL,WAAW,CAAC;IAC3C,KAAKJ,wBAAwB;MAC3B,OAAOU,yBAAyB,CAACN,WAAW,CAAC;IAC/C,KAAKH,aAAa;MAChB,OAAOU,mBAAmB,CAACP,WAAW,CAAC;IACzC,KAAKF,qBAAqB;MACxB,OAAOU,8BAA8B,CAACR,WAAW,CAAC;IACpD;MACE,OAAOM,yBAAyB,CAACN,WAAW,CAAC;EACjD;AACF;AAQA,SAASM,yBAAyBA,CAACN,WAAwB,EAAe;EACxE,MAAMS,WAAW,GAAG,CAAC;EACrB,OAAO,IAAIC,WAAW,CAACV,WAAW,EAAES,WAAW,CAAC;AAClD;AAQA,SAASD,8BAA8BA,CAACR,WAAwB,EAAc;EAC5E,MAAMS,WAAW,GAAG,CAAC;EACrB,OAAO,IAAIE,UAAU,CAACX,WAAW,EAAES,WAAW,CAAC;AACjD;AAQA,SAASF,mBAAmBA,CAACP,WAAwB,EAAgB;EACnE,MAAMS,WAAW,GAAG,CAAC;EACrB,OAAO,IAAIG,YAAY,CAACZ,WAAW,EAAES,WAAW,CAAC;AACnD;AAQA,SAASJ,qBAAqBA,CAACL,WAAwB,EAAY;EACjE,MAAMa,kBAAkB,GAAG,CAAC;EAC5B,MAAMC,UAAU,GAAG,CAAC;EACpB,MAAMC,kBAAkB,GAAG,CAAC;EAC5B,MAAMC,YAAsB,GAAG,EAAE;EAEjC,IAAI;IAEF,MAAMC,YAAY,GAAG,IAAIC,QAAQ,CAC/BlB,WAAW,EACXa,kBAAkB,EAClBE,kBACF,CAAC,CAACI,SAAS,CAACN,kBAAkB,EAAE,IAAI,CAAC;IACrC,MAAMO,WAAW,GAAG,IAAIV,WAAW,CAACV,WAAW,EAAEc,UAAU,EAAEG,YAAY,CAAC;IAC1E,IAAII,YAAY,GAAGP,UAAU,GAAGG,YAAY,GAAGF,kBAAkB;IAEjE,KAAK,MAAMO,cAAc,IAAIF,WAAW,EAAE;MACxC,MAAMG,WAAW,GAAG,IAAIC,WAAW,CAAC,OAAO,CAAC;MAC5C,MAAMC,eAAe,GAAG,IAAIC,UAAU,CAAC1B,WAAW,EAAEqB,YAAY,EAAEC,cAAc,CAAC;MACjFN,YAAY,CAACW,IAAI,CAACJ,WAAW,CAACK,MAAM,CAACH,eAAe,CAAC,CAAC;MACtDJ,YAAY,IAAIC,cAAc;IAChC;EACF,CAAC,CAAC,OAAOO,KAAK,EAAE;IACdC,OAAO,CAACD,KAAK,CAAC,gCAAgC,EAAGA,KAAK,CAAWE,OAAO,CAAC;EAC3E;EAEA,OAAOf,YAAY;AACrB"}
1
+ {"version":3,"file":"parse-i3s-attribute.js","names":["STRING_ATTRIBUTE_TYPE","OBJECT_ID_ATTRIBUTE_TYPE","FLOAT_64_TYPE","INT_16_ATTRIBUTE_TYPE","parseI3STileAttribute","arrayBuffer","options","attributeName","attributeType","parseAttribute","parseStringsAttribute","parseShortNumberAttribute","parseFloatAttribute","parseInt16ShortNumberAttribute","countOffset","Uint32Array","Int16Array","Float64Array","stringsCountOffset","dataOffset","bytesPerStringSize","stringsArray","stringsCount","DataView","getUint32","stringSizes","stringOffset","stringByteSize","textDecoder","TextDecoder","stringAttribute","Uint8Array","push","decode","error","console","message"],"sources":["../../../src/lib/parsers/parse-i3s-attribute.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {TypedArray} from '@loaders.gl/schema';\n\nimport {\n STRING_ATTRIBUTE_TYPE,\n OBJECT_ID_ATTRIBUTE_TYPE,\n FLOAT_64_TYPE,\n INT_16_ATTRIBUTE_TYPE\n} from './constants';\n\ntype Attribute = string[] | TypedArray | null;\nexport type I3STileAttributes = Record<string, Attribute>;\n\n/**\n * Get particular tile and creates attribute object inside.\n * @param arrayBuffer\n * @param {Object} options\n * @returns {Promise<object>}\n */\nexport function parseI3STileAttribute(arrayBuffer: ArrayBuffer, options): I3STileAttributes {\n const {attributeName, attributeType} = options;\n\n if (!attributeName) {\n return {};\n }\n return {\n [attributeName]: attributeType ? parseAttribute(attributeType, arrayBuffer) : null\n };\n}\n\n/**\n * Parse attributes based on attribute type.\n * @param {String} attributeType\n * @param arrayBuffer\n * @returns\n */\nfunction parseAttribute(attributeType, arrayBuffer: ArrayBuffer): Attribute {\n switch (attributeType) {\n case STRING_ATTRIBUTE_TYPE:\n return parseStringsAttribute(arrayBuffer);\n case OBJECT_ID_ATTRIBUTE_TYPE:\n return parseShortNumberAttribute(arrayBuffer);\n case FLOAT_64_TYPE:\n return parseFloatAttribute(arrayBuffer);\n case INT_16_ATTRIBUTE_TYPE:\n return parseInt16ShortNumberAttribute(arrayBuffer);\n default:\n return parseShortNumberAttribute(arrayBuffer);\n }\n}\n\n/**\n * Parse short number attribute.\n * Short Integer spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.7/attributeStorageInfo.cmn.md\n * @param arrayBuffer\n * @returns\n */\nfunction parseShortNumberAttribute(arrayBuffer: ArrayBuffer): Uint32Array {\n const countOffset = 4;\n return new Uint32Array(arrayBuffer, countOffset);\n}\n\n/**\n * Parse Int16 short number attribute.\n * Parsing of such data is not documented. Added to handle Building Scene Layer Tileset attributes data.\n * @param arrayBuffer\n * @returns\n */\nfunction parseInt16ShortNumberAttribute(arrayBuffer: ArrayBuffer): Int16Array {\n const countOffset = 4;\n return new Int16Array(arrayBuffer, countOffset);\n}\n\n/**\n * Parse float attribute.\n * Double Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.7/attributeStorageInfo.cmn.md\n * @param arrayBuffer\n * @returns\n */\nfunction parseFloatAttribute(arrayBuffer: ArrayBuffer): Float64Array {\n const countOffset = 8;\n return new Float64Array(arrayBuffer, countOffset);\n}\n\n/**\n * Parse string attribute.\n * String spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.7/attributeStorageInfo.cmn.md\n * @param arrayBuffer\n * @returns list of strings\n */\nfunction parseStringsAttribute(arrayBuffer: ArrayBuffer): string[] {\n const stringsCountOffset = 0;\n const dataOffset = 8;\n const bytesPerStringSize = 4;\n const stringsArray: string[] = [];\n\n try {\n // Use DataView to avoid multiple of 4 error on Uint32Array constructor\n const stringsCount = new DataView(\n arrayBuffer,\n stringsCountOffset,\n bytesPerStringSize\n ).getUint32(stringsCountOffset, true);\n const stringSizes = new Uint32Array(arrayBuffer, dataOffset, stringsCount);\n let stringOffset = dataOffset + stringsCount * bytesPerStringSize;\n\n for (const stringByteSize of stringSizes) {\n const textDecoder = new TextDecoder('utf-8');\n const stringAttribute = new Uint8Array(arrayBuffer, stringOffset, stringByteSize);\n stringsArray.push(textDecoder.decode(stringAttribute));\n stringOffset += stringByteSize;\n }\n } catch (error) {\n console.error('Parse string attribute error: ', (error as Error).message); // eslint-disable-line\n }\n\n return stringsArray;\n}\n"],"mappings":"SAOEA,qBAAqB,EACrBC,wBAAwB,EACxBC,aAAa,EACbC,qBAAqB;AAYvB,OAAO,SAASC,qBAAqBA,CAACC,WAAwB,EAAEC,OAAO,EAAqB;EAC1F,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BlB,WAAW,EACXa,kBAAkB,EAClBE,kBACF,CAAC,CAACI,SAAS,CAACN,kBAAkB,EAAE,IAAI,CAAC;IACrC,MAAMO,WAAW,GAAG,IAAIV,WAAW,CAACV,WAAW,EAAEc,UAAU,EAAEG,YAAY,CAAC;IAC1E,IAAII,YAAY,GAAGP,UAAU,GAAGG,YAAY,GAAGF,kBAAkB;IAEjE,KAAK,MAAMO,cAAc,IAAIF,WAAW,EAAE;MACxC,MAAMG,WAAW,GAAG,IAAIC,WAAW,CAAC,OAAO,CAAC;MAC5C,MAAMC,eAAe,GAAG,IAAIC,UAAU,CAAC1B,WAAW,EAAEqB,YAAY,EAAEC,cAAc,CAAC;MACjFN,YAAY,CAACW,IAAI,CAACJ,WAAW,CAACK,MAAM,CAACH,eAAe,CAAC,CAAC;MACtDJ,YAAY,IAAIC,cAAc;IAChC;EACF,CAAC,CAAC,OAAOO,KAAK,EAAE;IACdC,OAAO,CAACD,KAAK,CAAC,gCAAgC,EAAGA,KAAK,CAAWE,OAAO,CAAC;EAC3E;EAEA,OAAOf,YAAY;AACrB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/i3s",
3
- "version": "4.1.0-alpha.2",
3
+ "version": "4.1.0-alpha.4",
4
4
  "description": "i3s .",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -41,14 +41,14 @@
41
41
  "build-worker-node": "esbuild src/workers/i3s-content-worker-node.ts --outfile=dist/i3s-content-worker-node.js --platform=node --target=node16 --minify --bundle --sourcemap --define:__VERSION__=\\\"$npm_package_version\\\""
42
42
  },
43
43
  "dependencies": {
44
- "@loaders.gl/compression": "4.1.0-alpha.2",
45
- "@loaders.gl/crypto": "4.1.0-alpha.2",
46
- "@loaders.gl/draco": "4.1.0-alpha.2",
47
- "@loaders.gl/images": "4.1.0-alpha.2",
48
- "@loaders.gl/loader-utils": "4.1.0-alpha.2",
49
- "@loaders.gl/schema": "4.1.0-alpha.2",
50
- "@loaders.gl/textures": "4.1.0-alpha.2",
51
- "@loaders.gl/tiles": "4.1.0-alpha.2",
44
+ "@loaders.gl/compression": "4.1.0-alpha.4",
45
+ "@loaders.gl/crypto": "4.1.0-alpha.4",
46
+ "@loaders.gl/draco": "4.1.0-alpha.4",
47
+ "@loaders.gl/images": "4.1.0-alpha.4",
48
+ "@loaders.gl/loader-utils": "4.1.0-alpha.4",
49
+ "@loaders.gl/schema": "4.1.0-alpha.4",
50
+ "@loaders.gl/textures": "4.1.0-alpha.4",
51
+ "@loaders.gl/tiles": "4.1.0-alpha.4",
52
52
  "@math.gl/core": "^4.0.0",
53
53
  "@math.gl/culling": "^4.0.0",
54
54
  "@math.gl/geospatial": "^4.0.0"
@@ -56,5 +56,5 @@
56
56
  "peerDependencies": {
57
57
  "@loaders.gl/core": "^4.0.0"
58
58
  },
59
- "gitHead": "a248382edd20e846c1ccb23c15d089fb9b368dbc"
59
+ "gitHead": "b18ba1d63be704fd021e4470e8ab84175621e62d"
60
60
  }
package/src/index.ts CHANGED
@@ -1,4 +1,5 @@
1
- // loaders.gl, MIT license
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
2
3
  // Copyright (c) vis.gl contributors
3
4
 
4
5
  export type {
@@ -1,4 +1,5 @@
1
- // loaders.gl, MIT license
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
2
3
  // Copyright (c) vis.gl contributors
3
4
 
4
5
  import {GL} from '@loaders.gl/math';
@@ -1,4 +1,5 @@
1
- // loaders.gl, MIT license
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
2
3
  // Copyright (c) vis.gl contributors
3
4
 
4
5
  import {TypedArray} from '@loaders.gl/schema';