@loaders.gl/i3s 4.0.0-alpha.23 → 4.0.0-alpha.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist.min.js +84 -53
- package/dist/es5/arcgis-webscene-loader.js +4 -4
- package/dist/es5/arcgis-webscene-loader.js.map +1 -1
- package/dist/es5/i3s-attribute-loader.js +1 -1
- package/dist/es5/i3s-attribute-loader.js.map +1 -1
- package/dist/es5/i3s-building-scene-layer-loader.js +1 -1
- package/dist/es5/i3s-building-scene-layer-loader.js.map +1 -1
- package/dist/es5/i3s-content-loader.js +1 -1
- package/dist/es5/i3s-content-loader.js.map +1 -1
- package/dist/es5/i3s-loader.js +1 -1
- package/dist/es5/i3s-loader.js.map +1 -1
- package/dist/es5/i3s-node-page-loader.js +14 -12
- package/dist/es5/i3s-node-page-loader.js.map +1 -1
- package/dist/es5/i3s-slpk-loader.js +1 -1
- package/dist/es5/i3s-slpk-loader.js.map +1 -1
- package/dist/es5/index.js +2 -2
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/lib/parsers/parse-arcgis-webscene.js.map +1 -1
- package/dist/es5/lib/parsers/parse-i3s.js.map +1 -1
- package/dist/es5/types.js.map +1 -1
- package/dist/esm/arcgis-webscene-loader.js +2 -2
- package/dist/esm/arcgis-webscene-loader.js.map +1 -1
- package/dist/esm/i3s-attribute-loader.js +1 -1
- package/dist/esm/i3s-attribute-loader.js.map +1 -1
- package/dist/esm/i3s-building-scene-layer-loader.js +1 -1
- package/dist/esm/i3s-building-scene-layer-loader.js.map +1 -1
- package/dist/esm/i3s-content-loader.js +1 -1
- package/dist/esm/i3s-content-loader.js.map +1 -1
- package/dist/esm/i3s-loader.js +1 -1
- package/dist/esm/i3s-loader.js.map +1 -1
- package/dist/esm/i3s-node-page-loader.js +7 -5
- package/dist/esm/i3s-node-page-loader.js.map +1 -1
- package/dist/esm/i3s-slpk-loader.js +1 -1
- package/dist/esm/i3s-slpk-loader.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/parsers/parse-arcgis-webscene.js.map +1 -1
- package/dist/esm/lib/parsers/parse-i3s.js.map +1 -1
- package/dist/esm/types.js.map +1 -1
- package/dist/i3s-content-worker-node.js +40 -40
- package/dist/i3s-content-worker-node.js.map +3 -3
- package/dist/i3s-content-worker.js +46 -22
- package/dist/src/arcgis-webscene-loader.d.ts +9 -0
- package/dist/src/arcgis-webscene-loader.d.ts.map +1 -0
- package/dist/src/bundle.d.ts.map +1 -0
- package/dist/{i3s-attribute-loader.d.ts → src/i3s-attribute-loader.d.ts} +3 -2
- package/dist/src/i3s-attribute-loader.d.ts.map +1 -0
- package/dist/src/i3s-building-scene-layer-loader.d.ts +8 -0
- package/dist/src/i3s-building-scene-layer-loader.d.ts.map +1 -0
- package/dist/src/i3s-content-loader.d.ts +8 -0
- package/dist/src/i3s-content-loader.d.ts.map +1 -0
- package/dist/{i3s-loader.d.ts → src/i3s-loader.d.ts} +2 -1
- package/dist/src/i3s-loader.d.ts.map +1 -0
- package/dist/src/i3s-node-page-loader.d.ts +8 -0
- package/dist/src/i3s-node-page-loader.d.ts.map +1 -0
- package/dist/{i3s-slpk-loader.d.ts → src/i3s-slpk-loader.d.ts} +1 -2
- package/dist/src/i3s-slpk-loader.d.ts.map +1 -0
- package/dist/{index.d.ts → src/index.d.ts} +1 -1
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/lib/helpers/i3s-nodepages-tiles.d.ts.map +1 -0
- package/dist/src/lib/parsers/constants.d.ts.map +1 -0
- package/dist/src/lib/parsers/parse-arcgis-webscene.d.ts +7 -0
- package/dist/src/lib/parsers/parse-arcgis-webscene.d.ts.map +1 -0
- package/dist/src/lib/parsers/parse-i3s-attribute.d.ts.map +1 -0
- package/dist/src/lib/parsers/parse-i3s-building-scene-layer.d.ts.map +1 -0
- package/dist/src/lib/parsers/parse-i3s-tile-content.d.ts.map +1 -0
- package/dist/{lib → src/lib}/parsers/parse-i3s.d.ts +1 -1
- package/dist/src/lib/parsers/parse-i3s.d.ts.map +1 -0
- package/dist/src/lib/parsers/parse-slpk/parse-slpk.d.ts.map +1 -0
- package/dist/src/lib/parsers/parse-slpk/slpk-archieve.d.ts.map +1 -0
- package/dist/src/lib/utils/convert-i3s-obb-to-mbs.d.ts.map +1 -0
- package/dist/src/lib/utils/customize-/321/201olors.d.ts.map +1 -0
- package/dist/src/lib/utils/url-utils.d.ts.map +1 -0
- package/dist/{types.d.ts → src/types.d.ts} +16 -16
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/workers/i3s-content-worker-node.d.ts.map +1 -0
- package/dist/src/workers/i3s-content-worker.d.ts.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +9 -9
- package/src/arcgis-webscene-loader.ts +12 -6
- package/src/i3s-attribute-loader.ts +2 -1
- package/src/i3s-building-scene-layer-loader.ts +6 -1
- package/src/i3s-content-loader.ts +3 -2
- package/src/i3s-loader.ts +3 -2
- package/src/i3s-node-page-loader.ts +9 -6
- package/src/i3s-slpk-loader.ts +1 -1
- package/src/index.ts +1 -1
- package/src/lib/parsers/parse-arcgis-webscene.ts +2 -2
- package/src/lib/parsers/parse-i3s.ts +3 -2
- package/src/types.ts +16 -16
- package/dist/arcgis-webscene-loader.d.ts +0 -7
- package/dist/arcgis-webscene-loader.d.ts.map +0 -1
- package/dist/arcgis-webscene-loader.js +0 -28
- package/dist/bundle.d.ts.map +0 -1
- package/dist/bundle.js +0 -5
- package/dist/i3s-attribute-loader.d.ts.map +0 -1
- package/dist/i3s-attribute-loader.js +0 -175
- package/dist/i3s-building-scene-layer-loader.d.ts +0 -6
- package/dist/i3s-building-scene-layer-loader.d.ts.map +0 -1
- package/dist/i3s-building-scene-layer-loader.js +0 -26
- package/dist/i3s-content-loader.d.ts +0 -6
- package/dist/i3s-content-loader.d.ts.map +0 -1
- package/dist/i3s-content-loader.js +0 -32
- package/dist/i3s-loader.d.ts.map +0 -1
- package/dist/i3s-loader.js +0 -100
- package/dist/i3s-node-page-loader.d.ts +0 -7
- package/dist/i3s-node-page-loader.d.ts.map +0 -1
- package/dist/i3s-node-page-loader.js +0 -22
- package/dist/i3s-slpk-loader.d.ts.map +0 -1
- package/dist/i3s-slpk-loader.js +0 -30
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -23
- package/dist/lib/helpers/i3s-nodepages-tiles.d.ts.map +0 -1
- package/dist/lib/helpers/i3s-nodepages-tiles.js +0 -244
- package/dist/lib/parsers/constants.d.ts.map +0 -1
- package/dist/lib/parsers/constants.js +0 -88
- package/dist/lib/parsers/parse-arcgis-webscene.d.ts +0 -7
- package/dist/lib/parsers/parse-arcgis-webscene.d.ts.map +0 -1
- package/dist/lib/parsers/parse-arcgis-webscene.js +0 -88
- package/dist/lib/parsers/parse-i3s-attribute.d.ts.map +0 -1
- package/dist/lib/parsers/parse-i3s-attribute.js +0 -99
- package/dist/lib/parsers/parse-i3s-building-scene-layer.d.ts.map +0 -1
- package/dist/lib/parsers/parse-i3s-building-scene-layer.js +0 -46
- package/dist/lib/parsers/parse-i3s-tile-content.d.ts.map +0 -1
- package/dist/lib/parsers/parse-i3s-tile-content.js +0 -498
- package/dist/lib/parsers/parse-i3s.d.ts.map +0 -1
- package/dist/lib/parsers/parse-i3s.js +0 -105
- package/dist/lib/parsers/parse-slpk/parse-slpk.d.ts.map +0 -1
- package/dist/lib/parsers/parse-slpk/parse-slpk.js +0 -33
- package/dist/lib/parsers/parse-slpk/slpk-archieve.d.ts.map +0 -1
- package/dist/lib/parsers/parse-slpk/slpk-archieve.js +0 -131
- package/dist/lib/utils/convert-i3s-obb-to-mbs.d.ts.map +0 -1
- package/dist/lib/utils/convert-i3s-obb-to-mbs.js +0 -20
- package/dist/lib/utils/customize-/321/201olors.d.ts.map +0 -1
- package/dist/lib/utils/customize-/321/201olors.js +0 -104
- package/dist/lib/utils/url-utils.d.ts.map +0 -1
- package/dist/lib/utils/url-utils.js +0 -45
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -8
- package/dist/workers/i3s-content-worker-node.d.ts.map +0 -1
- package/dist/workers/i3s-content-worker-node.js +0 -7
- package/dist/workers/i3s-content-worker.d.ts.map +0 -1
- package/dist/workers/i3s-content-worker.js +0 -5
- /package/dist/{bundle.d.ts → src/bundle.d.ts} +0 -0
- /package/dist/{lib → src/lib}/helpers/i3s-nodepages-tiles.d.ts +0 -0
- /package/dist/{lib → src/lib}/parsers/constants.d.ts +0 -0
- /package/dist/{lib → src/lib}/parsers/parse-i3s-attribute.d.ts +0 -0
- /package/dist/{lib → src/lib}/parsers/parse-i3s-building-scene-layer.d.ts +0 -0
- /package/dist/{lib → src/lib}/parsers/parse-i3s-tile-content.d.ts +0 -0
- /package/dist/{lib → src/lib}/parsers/parse-slpk/parse-slpk.d.ts +0 -0
- /package/dist/{lib → src/lib}/parsers/parse-slpk/slpk-archieve.d.ts +0 -0
- /package/dist/{lib → src/lib}/utils/convert-i3s-obb-to-mbs.d.ts +0 -0
- /package/dist/{lib → src/lib}/utils/customize-/321/201olors.d.ts" +0 -0
- /package/dist/{lib → src/lib}/utils/url-utils.d.ts +0 -0
- /package/dist/{workers → src/workers}/i3s-content-worker-node.d.ts +0 -0
- /package/dist/{workers → src/workers}/i3s-content-worker.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
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 {I3STileAttributes} from './lib/parsers/parse-i3s-attribute';\nimport {parseI3STileAttribute} from './lib/parsers/parse-i3s-attribute';\nimport {getUrlWithToken} from './lib/utils/url-utils';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\nconst EMPTY_VALUE = '';\nconst REJECTED_STATUS = 'rejected';\n\n/**\n * Loader for I3S attributes\n */\nexport const I3SAttributeLoader: LoaderWithParser<I3STileAttributes, never, LoaderOptions> = {\n name: 'I3S Attribute',\n id: 'i3s-attribute',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/binary'],\n parse: async (arrayBuffer: ArrayBuffer, options?: LoaderOptions) => parseI3STileAttribute(arrayBuffer, options),\n extensions: ['bin'],\n options: {},\n binary: true\n};\n\n\n// TODO - these seem to use the loader rather than being part of the loader. Move to different file...\n\n/**\n * Load attributes based on feature id\n * @param {Object} tile\n * @param {number} featureId\n * @param {Object} options\n * @returns {Promise}\n */\n// eslint-disable-next-line complexity\nexport async function loadFeatureAttributes(tile, featureId, options = {}) {\n const {attributeStorageInfo, attributeUrls, tilesetFields} = getAttributesData(tile);\n\n if (!attributeStorageInfo || !attributeUrls || featureId < 0) {\n return null;\n }\n\n let attributes: object[] = [];\n const attributeLoadPromises: Promise<object>[] = [];\n\n for (let index = 0; index < attributeStorageInfo.length; index++) {\n // @ts-ignore\n const url = getUrlWithToken(attributeUrls[index], options.i3s?.token);\n const attributeName = attributeStorageInfo[index].name;\n const attributeType = getAttributeValueType(attributeStorageInfo[index]);\n const loadOptions = {...options, attributeName, attributeType};\n const promise = load(url, I3SAttributeLoader, loadOptions);\n\n attributeLoadPromises.push(promise);\n }\n try {\n attributes = await Promise.allSettled(attributeLoadPromises);\n } catch (error) {\n // do nothing\n }\n\n if (!attributes.length) {\n return null;\n }\n\n return generateAttributesByFeatureId(attributes, attributeStorageInfo, featureId, tilesetFields);\n}\n\n/**\n * Gets attributes data from tile.\n * @param tile \n * @returns \n */\nfunction getAttributesData(tile) {\n const attributeStorageInfo = tile.tileset?.tileset?.attributeStorageInfo;\n const attributeUrls = tile.header?.attributeUrls;\n const tilesetFields = tile.tileset?.tileset?.fields || [];\n\n return {attributeStorageInfo, attributeUrls, tilesetFields};\n}\n\n/**\n * Get attribute value type based on property names\n * @param {Object} attribute\n * @returns {String}\n */\nexport function getAttributeValueType(attribute) {\n if (attribute.hasOwnProperty('objectIds')) {\n return 'Oid32';\n } else if (attribute.hasOwnProperty('attributeValues')) {\n return attribute.attributeValues.valueType;\n }\n return '';\n}\n\n/**\n * Find in attributeStorageInfo attribute name responsible for feature ids list.\n * @param attributeStorageInfo \n * @returns Feature ids attribute name\n */\nfunction getFeatureIdsAttributeName(attributeStorageInfo) {\n const objectIdsAttribute = attributeStorageInfo.find(attribute => attribute.name.includes('OBJECTID'));\n\n return objectIdsAttribute?.name;\n}\n\n/**\n * Generates mapping featureId to feature attributes\n * @param {Array} attributes\n * @param {Object} attributeStorageInfo\n * @param {number} featureId\n * @returns {Object}\n */\nfunction generateAttributesByFeatureId(attributes, attributeStorageInfo, featureId, tilesetFields) {\n const objectIdsAttributeName = getFeatureIdsAttributeName(attributeStorageInfo);\n const objectIds = attributes.find((attribute) => attribute.value[objectIdsAttributeName]);\n\n if (!objectIds) {\n return null;\n }\n\n const attributeIndex = objectIds.value[objectIdsAttributeName].indexOf(featureId);\n\n if (attributeIndex < 0) {\n return null;\n }\n\n return getFeatureAttributesByIndex(attributes, attributeIndex, attributeStorageInfo, tilesetFields);\n}\n\n/**\n * Generates attribute object for feature mapping by feature id\n * @param {Array} attributes\n * @param {Number} featureIdIndex\n * @param {Object} attributeStorageInfo\n * @returns {Object}\n */\nfunction getFeatureAttributesByIndex(attributes, featureIdIndex, attributeStorageInfo, tilesetFields) {\n const attributesObject = {};\n\n for (let index = 0; index < attributeStorageInfo.length; index++) {\n const attributeName = attributeStorageInfo[index].name;\n const codedValues = getAttributeCodedValues(attributeName, tilesetFields);\n const attribute = getAttributeByIndexAndAttributeName(attributes, index, attributeName);\n attributesObject[attributeName] = formatAttributeValue(attribute, featureIdIndex, codedValues);\n }\n\n return attributesObject;\n}\n\n/**\n * Get coded values list from tileset.\n * @param attributeName \n * @param tilesetFields \n */\nfunction getAttributeCodedValues(attributeName, tilesetFields) {\n const attributeField = tilesetFields\n .find(field => field.name === attributeName || field.alias === attributeName);\n\n return attributeField?.domain?.codedValues || [];\n}\n\n/**\n * Return attribute value if it presents in atrributes list\n * @param {array} attributes\n * @param {number} index\n * @param {string} attributesName\n */\nfunction getAttributeByIndexAndAttributeName(attributes, index, attributesName) {\n const attributeObject = attributes[index];\n\n if (attributeObject.status === REJECTED_STATUS) {\n return null;\n }\n\n return attributeObject.value[attributesName];\n}\n\n/**\n * Do formatting of attribute values or return empty string.\n * @param {Array} attribute\n * @param {Number} featureIdIndex\n * @returns {String}\n */\nfunction formatAttributeValue(attribute, featureIdIndex, codedValues) {\n let value = EMPTY_VALUE;\n\n if (attribute && (featureIdIndex in attribute)) {\n // eslint-disable-next-line no-control-regex\n value = String(attribute[featureIdIndex]).replace(/\\u0000|NaN/g, '').trim();\n }\n\n // Check if coded values are existed. If so we use them.\n if (codedValues.length) {\n const codeValue = codedValues.find(codedValue => codedValue.code === Number(value));\n value = codeValue?.name || EMPTY_VALUE;\n }\n\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A,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;AAGrC,SAAQC,qBAAqB,QAAO,mCAAmC;AACvE,SAAQC,eAAe,QAAO,uBAAuB;AAIrD,MAAMC,OAAO,GAAG,uBAAkB,KAAK,WAAW,sBAAiB,QAAQ;AAC3E,MAAMC,WAAW,GAAG,EAAE;AACtB,MAAMC,eAAe,GAAG,UAAU;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,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';
|
|
2
|
-
const VERSION = typeof "4.0.0-alpha.
|
|
2
|
+
const VERSION = typeof "4.0.0-alpha.25" !== 'undefined' ? "4.0.0-alpha.25" : 'beta';
|
|
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","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 {BuildingSceneLayerTileset} from './types';\n\nimport {parseBuildingSceneLayer} from './lib/parsers/parse-i3s-building-scene-layer';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\n\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'beta';\n/**\n * Loader for I3S - Building Scene Layer\n */\nexport const I3SBuildingSceneLayerLoader: LoaderWithParser = {\n name: 'I3S Building Scene Layer',\n id: 'i3s-building-scene-layer',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/json'],\n parse,\n extensions: ['json'],\n options: {}\n};\n\nasync function parse(\n data: ArrayBuffer,\n options?: LoaderOptions,\n context?: LoaderContext\n): Promise<BuildingSceneLayerTileset> {\n if (!context?.url) {\n throw new Error('Url is not provided');\n }\n\n return parseBuildingSceneLayer(data, context.url);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"i3s-building-scene-layer-loader.js","names":["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__ : 'beta';\n/**\n * Loader for I3S - Building Scene Layer\n */\nexport const I3SBuildingSceneLayerLoader: LoaderWithParser<\n BuildingSceneLayerTileset,\n never,\n I3SLoaderOptions\n> = {\n name: 'I3S Building Scene Layer',\n id: 'i3s-building-scene-layer',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/json'],\n parse,\n extensions: ['json'],\n options: {}\n};\n\nasync function parse(\n data: ArrayBuffer,\n options?: LoaderOptions,\n context?: LoaderContext\n): Promise<BuildingSceneLayerTileset> {\n if (!context?.url) {\n throw new Error('Url is not provided');\n }\n\n return parseBuildingSceneLayer(data, context.url);\n}\n"],"mappings":"AAIA,SAAQA,uBAAuB,QAAO,8CAA8C;AAKpF,MAAMC,OAAO,GAAG,uBAAkB,KAAK,WAAW,sBAAiB,MAAM;AAIzE,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';
|
|
2
|
-
const VERSION = typeof "4.0.0-alpha.
|
|
2
|
+
const VERSION = typeof "4.0.0-alpha.25" !== 'undefined' ? "4.0.0-alpha.25" : 'beta';
|
|
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","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 {I3STileOptions, I3STilesetOptions} from './types';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\n\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'beta';\n/**\n * Loader for I3S - Indexed 3D Scene Layer\n */\nexport const I3SContentLoader: LoaderWithParser = {\n name: 'I3S Content (Indexed Scene Layers)',\n id: 'i3s-content',\n module: 'i3s',\n worker: true,\n version: VERSION,\n mimeTypes: ['application/octet-stream'],\n parse,\n extensions: ['bin'],\n options: {\n 'i3s-content': {}\n }\n};\n\nasync function parse(data, options?: I3SLoaderOptions, context?: LoaderContext) {\n const {tile, _tileOptions, tileset, _tilesetOptions} = options?.i3s || {};\n const tileOptions = _tileOptions || tile;\n const tilesetOptions = _tilesetOptions || tileset;\n if (!tileOptions || !tilesetOptions) {\n return null;\n }\n return await parseI3STileContent(\n data,\n tileOptions as I3STileOptions,\n tilesetOptions as I3STilesetOptions,\n options,\n context\n );\n}\n"],"mappings":"AAEA,SAAQA,mBAAmB,QAAO,sCAAsC;AAMxE,MAAMC,OAAO,GAAG,uBAAkB,KAAK,WAAW,sBAAiB,MAAM;
|
|
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__ : 'beta';\n\n/**\n * Loader for I3S - Indexed 3D Scene Layer\n */\nexport const I3SContentLoader: LoaderWithParser<I3STileContent | null, never, I3SLoaderOptions> = {\n name: 'I3S Content (Indexed Scene Layers)',\n id: 'i3s-content',\n module: 'i3s',\n worker: true,\n version: VERSION,\n mimeTypes: ['application/octet-stream'],\n parse,\n extensions: ['bin'],\n options: {\n 'i3s-content': {}\n }\n};\n\nasync function parse(data, options?: I3SLoaderOptions, context?: LoaderContext) {\n const {tile, _tileOptions, tileset, _tilesetOptions} = options?.i3s || {};\n const tileOptions = _tileOptions || tile;\n const tilesetOptions = _tilesetOptions || tileset;\n if (!tileOptions || !tilesetOptions) {\n return null;\n }\n return await parseI3STileContent(\n data,\n tileOptions as I3STileOptions,\n tilesetOptions as I3STilesetOptions,\n options,\n context\n );\n}\n"],"mappings":"AAEA,SAAQA,mBAAmB,QAAO,sCAAsC;AAMxE,MAAMC,OAAO,GAAG,uBAAkB,KAAK,WAAW,sBAAiB,MAAM;AAKzE,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"}
|
package/dist/esm/i3s-loader.js
CHANGED
|
@@ -2,7 +2,7 @@ import { parse } from '@loaders.gl/core';
|
|
|
2
2
|
import { I3SContentLoader } from './i3s-content-loader';
|
|
3
3
|
import { normalizeTileData, normalizeTilesetData } from './lib/parsers/parse-i3s';
|
|
4
4
|
import { COORDINATE_SYSTEM } from './lib/parsers/constants';
|
|
5
|
-
const VERSION = typeof "4.0.0-alpha.
|
|
5
|
+
const VERSION = typeof "4.0.0-alpha.25" !== 'undefined' ? "4.0.0-alpha.25" : 'latest';
|
|
6
6
|
const TILESET_REGEX = /layers\/[0-9]+$/;
|
|
7
7
|
const TILE_HEADER_REGEX = /nodes\/([0-9-]+|root)$/;
|
|
8
8
|
const SLPK_HEX = '504b0304';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i3s-loader.js","names":["parse","I3SContentLoader","normalizeTileData","normalizeTilesetData","COORDINATE_SYSTEM","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","colorsByAttribute","data","arguments","length","undefined","context","url","magicNumber","getMagicNumber","Error","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 {I3SContentLoader} from './i3s-content-loader';\nimport {normalizeTileData, normalizeTilesetData} from './lib/parsers/parse-i3s';\nimport {COORDINATE_SYSTEM} from './lib/parsers/constants';\nimport {I3SParseOptions} 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\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 = {\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 colorsByAttribute: null\n }\n }\n};\n\nasync function parseI3S(data, options: I3SLoaderOptions = {}, context) {\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 // auto detect file type based on url\n let isTileset;\n if (options.i3s.isTileset === 'auto') {\n isTileset = TILESET_REGEX.test(url);\n } else {\n isTileset = options.i3s.isTileset;\n }\n\n let isTileHeader;\n if (options.isTileHeader === 'auto') {\n isTileHeader = TILE_HEADER_REGEX.test(url);\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;
|
|
1
|
+
{"version":3,"file":"i3s-loader.js","names":["parse","I3SContentLoader","normalizeTileData","normalizeTilesetData","COORDINATE_SYSTEM","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","colorsByAttribute","data","arguments","length","undefined","context","url","magicNumber","getMagicNumber","Error","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';\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 colorsByAttribute: null\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 // auto detect file type based on url\n let isTileset;\n if (options.i3s.isTileset === 'auto') {\n isTileset = TILESET_REGEX.test(url);\n } else {\n isTileset = options.i3s.isTileset;\n }\n\n let isTileHeader;\n if (options.isTileHeader === 'auto') {\n isTileHeader = TILE_HEADER_REGEX.test(url);\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;AAEtC,SAAQC,gBAAgB,QAAO,sBAAsB;AACrD,SAAQC,iBAAiB,EAAEC,oBAAoB,QAAO,yBAAyB;AAC/E,SAAQC,iBAAiB,QAAO,yBAAyB;AAKzD,MAAMC,OAAO,GAAG,uBAAkB,KAAK,WAAW,sBAAiB,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,EAAET,OAAO;EAChBU,SAAS,EAAE,CAAC,0BAA0B,CAAC;EACvCf,KAAK,EAAEgB,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;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,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CACnDC,IAAI,CAAC,EAAE,CAAC;EACb;EACA,OAAO,IAAI;AACb"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
const VERSION = typeof "4.0.0-alpha.
|
|
2
|
-
async function parseNodePage(data, options) {
|
|
3
|
-
return JSON.parse(new TextDecoder().decode(data));
|
|
4
|
-
}
|
|
1
|
+
const VERSION = typeof "4.0.0-alpha.25" !== 'undefined' ? "4.0.0-alpha.25" : 'latest';
|
|
5
2
|
export const I3SNodePageLoader = {
|
|
6
3
|
name: 'I3S Node Page',
|
|
7
4
|
id: 'i3s-node-page',
|
|
@@ -10,6 +7,11 @@ export const I3SNodePageLoader = {
|
|
|
10
7
|
mimeTypes: ['application/json'],
|
|
11
8
|
parse: parseNodePage,
|
|
12
9
|
extensions: ['json'],
|
|
13
|
-
options: {
|
|
10
|
+
options: {
|
|
11
|
+
i3s: {}
|
|
12
|
+
}
|
|
14
13
|
};
|
|
14
|
+
async function parseNodePage(data, options) {
|
|
15
|
+
return JSON.parse(new TextDecoder().decode(data));
|
|
16
|
+
}
|
|
15
17
|
//# sourceMappingURL=i3s-node-page-loader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i3s-node-page-loader.js","names":["VERSION","
|
|
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,uBAAkB,KAAK,WAAW,sBAAiB,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 { parseSLPK as parseSLPKFromProvider } from './lib/parsers/parse-slpk/parse-slpk';
|
|
3
|
-
const VERSION = typeof "4.0.0-alpha.
|
|
3
|
+
const VERSION = typeof "4.0.0-alpha.25" !== 'undefined' ? "4.0.0-alpha.25" : '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","parseSLPK","parseSLPKFromProvider","VERSION","SLPKLoader","name","id","module","version","mimeTypes","parse","extensions","options","data","_options$slpk$path","_options$slpk","_options$slpk2","arguments","length","undefined","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 {parseSLPK as parseSLPKFromProvider} 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\n */\nexport const SLPKLoader: LoaderWithParser<
|
|
1
|
+
{"version":3,"file":"i3s-slpk-loader.js","names":["DataViewFile","parseSLPK","parseSLPKFromProvider","VERSION","SLPKLoader","name","id","module","version","mimeTypes","parse","extensions","options","data","_options$slpk$path","_options$slpk","_options$slpk2","arguments","length","undefined","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 {parseSLPK as parseSLPKFromProvider} 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\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 parse: parseSLPK,\n extensions: ['slpk'],\n options: {}\n};\n\n/**\n * returns a single file from the slpk archive\n * @param data slpk archive data\n * @param options options\n * @returns requested file\n */\n\nasync function parseSLPK(data: ArrayBuffer, options: SLPKLoaderOptions = {}) {\n return (await parseSLPKFromProvider(new DataViewFile(new DataView(data)))).getFile(\n options.slpk?.path ?? '',\n options.slpk?.pathMode\n );\n}\n"],"mappings":"AACA,SAAQA,YAAY,QAAO,0BAA0B;AACrD,SAAQC,SAAS,IAAIC,qBAAqB,QAAO,qCAAqC;AAItF,MAAMC,OAAO,GAAG,uBAAkB,KAAK,WAAW,sBAAiB,QAAQ;AAe3E,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,KAAK,EAAET,SAAS;EAChBU,UAAU,EAAE,CAAC,MAAM,CAAC;EACpBC,OAAO,EAAE,CAAC;AACZ,CAAC;AASD,eAAeX,SAASA,CAACY,IAAiB,EAAmC;EAAA,IAAAC,kBAAA,EAAAC,aAAA,EAAAC,cAAA;EAAA,IAAjCJ,OAA0B,GAAAK,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EACzE,OAAO,CAAC,MAAMf,qBAAqB,CAAC,IAAIF,YAAY,CAAC,IAAIoB,QAAQ,CAACP,IAAI,CAAC,CAAC,CAAC,EAAEQ,OAAO,EAAAP,kBAAA,IAAAC,aAAA,GAChFH,OAAO,CAACU,IAAI,cAAAP,aAAA,uBAAZA,aAAA,CAAcQ,IAAI,cAAAT,kBAAA,cAAAA,kBAAA,GAAI,EAAE,GAAAE,cAAA,GACxBJ,OAAO,CAACU,IAAI,cAAAN,cAAA,uBAAZA,cAAA,CAAcQ,QAChB,CAAC;AACH"}
|
package/dist/esm/index.js
CHANGED
|
@@ -5,6 +5,6 @@ export { I3SContentLoader } from './i3s-content-loader';
|
|
|
5
5
|
export { I3SAttributeLoader, loadFeatureAttributes } from './i3s-attribute-loader';
|
|
6
6
|
export { I3SBuildingSceneLayerLoader } from './i3s-building-scene-layer-loader';
|
|
7
7
|
export { I3SNodePageLoader } from './i3s-node-page-loader';
|
|
8
|
-
export {
|
|
8
|
+
export { ArcGISWebSceneLoader } from './arcgis-webscene-loader';
|
|
9
9
|
export { parseSLPK } from './lib/parsers/parse-slpk/parse-slpk';
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["COORDINATE_SYSTEM","I3SLoader","SLPKLoader","I3SContentLoader","I3SAttributeLoader","loadFeatureAttributes","I3SBuildingSceneLayerLoader","I3SNodePageLoader","
|
|
1
|
+
{"version":3,"file":"index.js","names":["COORDINATE_SYSTEM","I3SLoader","SLPKLoader","I3SContentLoader","I3SAttributeLoader","loadFeatureAttributes","I3SBuildingSceneLayerLoader","I3SNodePageLoader","ArcGISWebSceneLoader","parseSLPK"],"sources":["../../src/index.ts"],"sourcesContent":["// loaders.gl, MIT license\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';\nexport {parseSLPK} from './lib/parsers/parse-slpk/parse-slpk';\n"],"mappings":"AAuCA,SAAQA,iBAAiB,QAAO,yBAAyB;AAEzD,SAAQC,SAAS,QAAO,cAAc;AACtC,SAAQC,UAAU,QAAO,mBAAmB;AAC5C,SAAQC,gBAAgB,QAAO,sBAAsB;AACrD,SAAQC,kBAAkB,EAAEC,qBAAqB,QAAO,wBAAwB;AAChF,SAAQC,2BAA2B,QAAO,mCAAmC;AAC7E,SAAQC,iBAAiB,QAAO,wBAAwB;AACxD,SAAQC,oBAAoB,QAAO,0BAA0B;AAC7D,SAAQC,SAAS,QAAO,qCAAqC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-arcgis-webscene.js","names":["JSONLoader","load","SUPPORTED_WKID","ARCGIS_SCENE_SERVER_LAYER_TYPE","BUILDING_SCENE_LAYER","INTEGRATED_MESH_LAYER","GROUP_LAYER","SUPPORTED_LAYERS_TYPES","NO_AVAILABLE_SUPPORTED_LAYERS_ERROR","NOT_SUPPORTED_CRS_ERROR","parseWebscene","data","layer0","JSON","parse","TextDecoder","decode","operationalLayers","layers","unsupportedLayers","parseOperationalLayers","length","Error","header","layersList","needToCheckCRS","index","_layer$layers","layer","isLayerSupported","includes","layerType","checkSupportedIndexCRS","push","childLayers","childUnsupportedLayers","_layerJson$spatialRef","layerJson","url","wkid","spatialReference","error"],"sources":["../../../../src/lib/parsers/parse-arcgis-webscene.ts"],"sourcesContent":["import {JSONLoader, load} from '@loaders.gl/core';\nimport type {
|
|
1
|
+
{"version":3,"file":"parse-arcgis-webscene.js","names":["JSONLoader","load","SUPPORTED_WKID","ARCGIS_SCENE_SERVER_LAYER_TYPE","BUILDING_SCENE_LAYER","INTEGRATED_MESH_LAYER","GROUP_LAYER","SUPPORTED_LAYERS_TYPES","NO_AVAILABLE_SUPPORTED_LAYERS_ERROR","NOT_SUPPORTED_CRS_ERROR","parseWebscene","data","layer0","JSON","parse","TextDecoder","decode","operationalLayers","layers","unsupportedLayers","parseOperationalLayers","length","Error","header","layersList","needToCheckCRS","index","_layer$layers","layer","isLayerSupported","includes","layerType","checkSupportedIndexCRS","push","childLayers","childUnsupportedLayers","_layerJson$spatialRef","layerJson","url","wkid","spatialReference","error"],"sources":["../../../../src/lib/parsers/parse-arcgis-webscene.ts"],"sourcesContent":["import {JSONLoader, load} from '@loaders.gl/core';\nimport type {ArcGISWebSceneData, OperationalLayer} from '../../types';\n\n/**\n * WKID, or Well-Known ID, of the CRS. Specify either WKID or WKT of the CRS.\n * Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/spatialReference.cmn.md\n */\nconst SUPPORTED_WKID = 4326;\n\nconst ARCGIS_SCENE_SERVER_LAYER_TYPE = 'ArcGISSceneServiceLayer';\nconst BUILDING_SCENE_LAYER = 'BuildingSceneLayer';\nconst INTEGRATED_MESH_LAYER = 'IntegratedMeshLayer';\nconst GROUP_LAYER = 'GroupLayer';\n\n/**\n * Supported layers list\n * Possible operational layers in WebScene: https://developers.arcgis.com/web-scene-specification/objects/operationalLayers/\n */\nconst SUPPORTED_LAYERS_TYPES = [\n ARCGIS_SCENE_SERVER_LAYER_TYPE,\n INTEGRATED_MESH_LAYER,\n BUILDING_SCENE_LAYER,\n GROUP_LAYER\n];\n\nconst NO_AVAILABLE_SUPPORTED_LAYERS_ERROR = 'NO_AVAILABLE_SUPPORTED_LAYERS_ERROR';\nconst NOT_SUPPORTED_CRS_ERROR = 'NOT_SUPPORTED_CRS_ERROR';\n\n/**\n * Parses ArcGIS WebScene\n * @param data\n */\nexport async function parseWebscene(data: ArrayBuffer): Promise<ArcGISWebSceneData> {\n const layer0 = JSON.parse(new TextDecoder().decode(data));\n const {operationalLayers} = layer0;\n const {layers, unsupportedLayers} = await parseOperationalLayers(operationalLayers, true);\n\n if (!layers.length) {\n throw new Error(NO_AVAILABLE_SUPPORTED_LAYERS_ERROR);\n }\n\n return {\n header: layer0,\n layers,\n unsupportedLayers\n };\n}\n\n/**\n * Recursively parses WebScene operational layers.\n * @param layersList\n */\nasync function parseOperationalLayers(\n layersList: OperationalLayer[],\n needToCheckCRS: boolean\n): Promise<{layers: OperationalLayer[]; unsupportedLayers: OperationalLayer[]}> {\n const layers: OperationalLayer[] = [];\n let unsupportedLayers: OperationalLayer[] = [];\n\n for (let index = 0; index < layersList.length; index++) {\n const layer = layersList[index];\n const isLayerSupported = SUPPORTED_LAYERS_TYPES.includes(layer.layerType);\n\n if (isLayerSupported) {\n if (needToCheckCRS && layer.layerType !== GROUP_LAYER) {\n await checkSupportedIndexCRS(layer);\n needToCheckCRS = false;\n }\n\n layers.push(layer);\n } else {\n unsupportedLayers.push(layer);\n }\n\n if (layer.layers?.length) {\n const {layers: childLayers, unsupportedLayers: childUnsupportedLayers} =\n await parseOperationalLayers(layer.layers, needToCheckCRS);\n layer.layers = childLayers;\n unsupportedLayers = [...unsupportedLayers, ...childUnsupportedLayers];\n }\n }\n\n return {layers, unsupportedLayers};\n}\n\n/**\n * Check if layer has supported CRS\n * @param layer\n */\nasync function checkSupportedIndexCRS(layer: OperationalLayer) {\n try {\n const layerJson = await load(layer.url, JSONLoader);\n // @ts-expect-error\n const wkid = layerJson?.spatialReference?.wkid;\n\n if (wkid !== SUPPORTED_WKID) {\n throw new Error(NOT_SUPPORTED_CRS_ERROR);\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
|
-
{"version":3,"file":"parse-i3s.js","names":["OrientedBoundingBox","Ellipsoid","load","TILE_TYPE","TILE_REFINEMENT","TILESET_TYPE","I3SNodePagesTiles","generateTileAttributeUrls","getUrlWithToken","I3SLoader","normalizeTileData","tile","context","url","contentUrl","geometryData","concat","href","textureUrl","textureData","attributeUrls","attributeData","children","normalizeTileNonUrlData","textureFormat","isDracoGeometry","_tile$lodSelection","_tile$lodSelection2","boundingVolume","mbs","sphere","WGS84","cartographicToCartesian","slice","obb","box","center","halfSize","quaternion","fromCenterHalfSizeQuaternion","boundingSphere","getBoundingSphere","radius","lodMetricType","lodSelection","metricType","lodMetricValue","maxError","type","MESH","refine","REPLACE","normalizeTilesetData","tileset","options","nodePagesTile","root","nodePages","formTileFromNodePages","_options$i3s","rootNodeUrl","i3s","token","loadContent","isTileHeader","isTileset","loader","basePath","I3S"],"sources":["../../../../src/lib/parsers/parse-i3s.ts"],"sourcesContent":["import {OrientedBoundingBox} from '@math.gl/culling';\nimport {Ellipsoid} from '@math.gl/geospatial';\nimport {load} from '@loaders.gl/core';\nimport {TILE_TYPE, TILE_REFINEMENT, TILESET_TYPE} from '@loaders.gl/tiles';\nimport I3SNodePagesTiles from '../helpers/i3s-nodepages-tiles';\nimport {generateTileAttributeUrls, getUrlWithToken} from '../utils/url-utils';\nimport {\n I3STilesetHeader,\n I3STileHeader,\n Mbs,\n I3SMinimalNodeData,\n Node3DIndexDocument,\n SceneLayer3D\n} from '../../types';\nimport type {LoaderOptions, LoaderContext} from '@loaders.gl/loader-utils';\nimport { I3SLoader } from '../../i3s-loader';\n\nexport function normalizeTileData(tile : Node3DIndexDocument, context: LoaderContext): I3STileHeader {\n const url: string = context.url || '';\n let contentUrl: string | undefined;\n if (tile.geometryData) {\n contentUrl = `${url}/${tile.geometryData[0].href}`;\n }\n\n let textureUrl: string | undefined;\n if (tile.textureData) {\n textureUrl = `${url}/${tile.textureData[0].href}`;\n }\n\n let attributeUrls: string[] | undefined;\n if (tile.attributeData) {\n attributeUrls = generateTileAttributeUrls(url, tile);\n }\n\n const children = tile.children || [];\n\n return normalizeTileNonUrlData({\n ...tile,\n children,\n url,\n contentUrl,\n textureUrl,\n textureFormat: 'jpg', // `jpg` format will cause `ImageLoader` usage that will be able to handle `png` as well\n attributeUrls,\n isDracoGeometry: false\n });\n}\n\nexport function normalizeTileNonUrlData(tile : I3SMinimalNodeData): I3STileHeader {\n const boundingVolume: {box?: number[]; sphere?: number[]} = {};\n let mbs: Mbs = [0, 0, 0, 1];\n if (tile.mbs) {\n mbs = tile.mbs;\n boundingVolume.sphere = [\n ...Ellipsoid.WGS84.cartographicToCartesian(tile.mbs.slice(0, 3)), // cartesian center of sphere\n tile.mbs[3] // radius of sphere\n ] as Mbs;\n } else if (tile.obb) {\n boundingVolume.box = [\n ...Ellipsoid.WGS84.cartographicToCartesian(tile.obb.center), // cartesian center of box\n ...tile.obb.halfSize, // halfSize\n ...tile.obb.quaternion // quaternion\n ];\n const obb = new OrientedBoundingBox().fromCenterHalfSizeQuaternion(\n boundingVolume.box.slice(0, 3),\n tile.obb.halfSize,\n tile.obb.quaternion\n );\n const boundingSphere = obb.getBoundingSphere();\n boundingVolume.sphere = [...boundingSphere.center , boundingSphere.radius] as Mbs;\n mbs = [...tile.obb.center, boundingSphere.radius] as Mbs;\n }\n\n const lodMetricType = tile.lodSelection?.[0].metricType;\n const lodMetricValue = tile.lodSelection?.[0].maxError;\n const type = TILE_TYPE.MESH;\n /**\n * I3S specification supports only REPLACE\n */\n const refine = TILE_REFINEMENT.REPLACE;\n\n return {...tile, mbs, boundingVolume, lodMetricType, lodMetricValue, type, refine};\n}\n\nexport async function normalizeTilesetData(tileset : SceneLayer3D, options : LoaderOptions, context: LoaderContext): Promise<I3STilesetHeader> {\n const url = context.url;\n let nodePagesTile: I3SNodePagesTiles | undefined;\n let root: I3STileHeader;\n if (tileset.nodePages) {\n nodePagesTile = new I3SNodePagesTiles(tileset, url, options);\n root = await nodePagesTile.formTileFromNodePages(0);\n } else {\n // @ts-expect-error options is not properly typed\n const rootNodeUrl = getUrlWithToken(`${tileset.url}/nodes/root`, options.i3s?.token);\n // eslint-disable-next-line no-use-before-define\n root = await load(rootNodeUrl, I3SLoader, {\n ...options,\n i3s: {\n // @ts-expect-error options is not properly typed\n ...options.i3s,\n loadContent: false, isTileHeader: true, isTileset: false}\n });\n }\n\n return {\n ...tileset,\n loader: I3SLoader,\n url,\n basePath: url,\n type: TILESET_TYPE.I3S,\n nodePagesTile,\n root,\n lodMetricType: root.lodMetricType,\n lodMetricValue: root.lodMetricValue\n }\n}\n"],"mappings":"AAAA,SAAQA,mBAAmB,QAAO,kBAAkB;AACpD,SAAQC,SAAS,QAAO,qBAAqB;AAC7C,SAAQC,IAAI,QAAO,kBAAkB;AACrC,SAAQC,SAAS,EAAEC,eAAe,EAAEC,YAAY,QAAO,mBAAmB;AAC1E,OAAOC,iBAAiB,MAAM,gCAAgC;AAC9D,SAAQC,yBAAyB,EAAEC,eAAe,QAAO,oBAAoB;AAU7E,SAASC,SAAS,QAAQ,kBAAkB;AAE5C,OAAO,SAASC,iBAAiBA,CAACC,IAA0B,EAAEC,OAAsB,EAAiB;EACnG,MAAMC,GAAW,GAAGD,OAAO,CAACC,GAAG,IAAI,EAAE;EACrC,IAAIC,UAA8B;EAClC,IAAIH,IAAI,CAACI,YAAY,EAAE;IACrBD,UAAU,MAAAE,MAAA,CAAMH,GAAG,OAAAG,MAAA,CAAIL,IAAI,CAACI,YAAY,CAAC,CAAC,CAAC,CAACE,IAAI,CAAE;EACpD;EAEA,IAAIC,UAA8B;EAClC,IAAIP,IAAI,CAACQ,WAAW,EAAE;IACpBD,UAAU,MAAAF,MAAA,CAAMH,GAAG,OAAAG,MAAA,CAAIL,IAAI,CAACQ,WAAW,CAAC,CAAC,CAAC,CAACF,IAAI,CAAE;EACnD;EAEA,IAAIG,aAAmC;EACvC,IAAIT,IAAI,CAACU,aAAa,EAAE;IACtBD,aAAa,GAAGb,yBAAyB,CAACM,GAAG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GAAG,CAACI,UACX,CAAC;IACD,MAAME,cAAc,GAAGN,GAAG,CAACO,iBAAiB,CAAC,CAAC;IAC9Cb,cAAc,CAACE,MAAM,GAAG,CAAC,GAAGU,cAAc,CAACJ,MAAM,EAAGI,cAAc,CAACE,MAAM,CAAQ;IACjFb,GAAG,GAAG,CAAC,GAAGlB,IAAI,CAACuB,GAAG,CAACE,MAAM,EAAEI,cAAc,CAACE,MAAM,CAAQ;EAC1D;EAEA,MAAMC,aAAa,IAAAjB,kBAAA,GAAGf,IAAI,CAACiC,YAAY,cAAAlB,kBAAA,uBAAjBA,kBAAA,CAAoB,CAAC,CAAC,CAACmB,UAAU;EACvD,MAAMC,cAAc,IAAAnB,mBAAA,GAAGhB,IAAI,CAACiC,YAAY,cAAAjB,mBAAA,uBAAjBA,mBAAA,CAAoB,CAAC,CAAC,CAACoB,QAAQ;EACtD,MAAMC,IAAI,GAAG7C,SAAS,CAAC8C,IAAI;EAI3B,MAAMC,MAAM,GAAG9C,eAAe,CAAC+C,OAAO;EAEtC,OAAO;IAAC,GAAGxC,IAAI;IAAEkB,GAAG;IAAED,cAAc;IAAEe,aAAa;IAAEG,cAAc;IAAEE,IAAI;IAAEE;EAAM,CAAC;AACpF;AAEA,OAAO,eAAeE,oBAAoBA,CAACC,OAAsB,EAAEC,OAAuB,EAAE1C,OAAsB,
|
|
1
|
+
{"version":3,"file":"parse-i3s.js","names":["OrientedBoundingBox","Ellipsoid","load","TILE_TYPE","TILE_REFINEMENT","TILESET_TYPE","I3SNodePagesTiles","generateTileAttributeUrls","getUrlWithToken","I3SLoader","normalizeTileData","tile","context","url","contentUrl","geometryData","concat","href","textureUrl","textureData","attributeUrls","attributeData","children","normalizeTileNonUrlData","textureFormat","isDracoGeometry","_tile$lodSelection","_tile$lodSelection2","boundingVolume","mbs","sphere","WGS84","cartographicToCartesian","slice","obb","box","center","halfSize","quaternion","fromCenterHalfSizeQuaternion","boundingSphere","getBoundingSphere","radius","lodMetricType","lodSelection","metricType","lodMetricValue","maxError","type","MESH","refine","REPLACE","normalizeTilesetData","tileset","options","nodePagesTile","root","nodePages","formTileFromNodePages","_options$i3s","rootNodeUrl","i3s","token","loadContent","isTileHeader","isTileset","loader","basePath","I3S"],"sources":["../../../../src/lib/parsers/parse-i3s.ts"],"sourcesContent":["import {OrientedBoundingBox} from '@math.gl/culling';\nimport {Ellipsoid} from '@math.gl/geospatial';\nimport {load} from '@loaders.gl/core';\nimport {TILE_TYPE, TILE_REFINEMENT, TILESET_TYPE} from '@loaders.gl/tiles';\nimport I3SNodePagesTiles from '../helpers/i3s-nodepages-tiles';\nimport {generateTileAttributeUrls, getUrlWithToken} from '../utils/url-utils';\nimport {\n I3STilesetHeader,\n I3STileHeader,\n Mbs,\n I3SMinimalNodeData,\n Node3DIndexDocument,\n SceneLayer3D\n} from '../../types';\nimport type {LoaderOptions, LoaderContext} from '@loaders.gl/loader-utils';\nimport { I3SLoader } from '../../i3s-loader';\n\nexport function normalizeTileData(tile : Node3DIndexDocument, context: LoaderContext): I3STileHeader {\n const url: string = context.url || '';\n let contentUrl: string | undefined;\n if (tile.geometryData) {\n contentUrl = `${url}/${tile.geometryData[0].href}`;\n }\n\n let textureUrl: string | undefined;\n if (tile.textureData) {\n textureUrl = `${url}/${tile.textureData[0].href}`;\n }\n\n let attributeUrls: string[] | undefined;\n if (tile.attributeData) {\n attributeUrls = generateTileAttributeUrls(url, tile);\n }\n\n const children = tile.children || [];\n\n return normalizeTileNonUrlData({\n ...tile,\n children,\n url,\n contentUrl,\n textureUrl,\n textureFormat: 'jpg', // `jpg` format will cause `ImageLoader` usage that will be able to handle `png` as well\n attributeUrls,\n isDracoGeometry: false\n });\n}\n\nexport function normalizeTileNonUrlData(tile : I3SMinimalNodeData): I3STileHeader {\n const boundingVolume: {box?: number[]; sphere?: number[]} = {};\n let mbs: Mbs = [0, 0, 0, 1];\n if (tile.mbs) {\n mbs = tile.mbs;\n boundingVolume.sphere = [\n ...Ellipsoid.WGS84.cartographicToCartesian(tile.mbs.slice(0, 3)), // cartesian center of sphere\n tile.mbs[3] // radius of sphere\n ] as Mbs;\n } else if (tile.obb) {\n boundingVolume.box = [\n ...Ellipsoid.WGS84.cartographicToCartesian(tile.obb.center), // cartesian center of box\n ...tile.obb.halfSize, // halfSize\n ...tile.obb.quaternion // quaternion\n ];\n const obb = new OrientedBoundingBox().fromCenterHalfSizeQuaternion(\n boundingVolume.box.slice(0, 3),\n tile.obb.halfSize,\n tile.obb.quaternion\n );\n const boundingSphere = obb.getBoundingSphere();\n boundingVolume.sphere = [...boundingSphere.center , boundingSphere.radius] as Mbs;\n mbs = [...tile.obb.center, boundingSphere.radius] as Mbs;\n }\n\n const lodMetricType = tile.lodSelection?.[0].metricType;\n const lodMetricValue = tile.lodSelection?.[0].maxError;\n const type = TILE_TYPE.MESH;\n /**\n * I3S specification supports only REPLACE\n */\n const refine = TILE_REFINEMENT.REPLACE;\n\n return {...tile, mbs, boundingVolume, lodMetricType, lodMetricValue, type, refine};\n}\n\nexport async function normalizeTilesetData(tileset : SceneLayer3D, options : LoaderOptions, context: LoaderContext): Promise<I3STileHeader | I3STilesetHeader> {\n const url = context.url;\n let nodePagesTile: I3SNodePagesTiles | undefined;\n let root: I3STileHeader | I3STilesetHeader;\n if (tileset.nodePages) {\n nodePagesTile = new I3SNodePagesTiles(tileset, url, options);\n root = await nodePagesTile.formTileFromNodePages(0);\n } else {\n // @ts-expect-error options is not properly typed\n const rootNodeUrl = getUrlWithToken(`${tileset.url}/nodes/root`, options.i3s?.token);\n // eslint-disable-next-line no-use-before-define\n root = await load(rootNodeUrl, I3SLoader, {\n ...options,\n i3s: {\n // @ts-expect-error options is not properly typed\n ...options.i3s,\n loadContent: false, isTileHeader: true, isTileset: false}\n });\n }\n\n return {\n ...tileset,\n loader: I3SLoader,\n url,\n basePath: url,\n type: TILESET_TYPE.I3S,\n nodePagesTile,\n // @ts-expect-error\n root,\n lodMetricType: root.lodMetricType,\n lodMetricValue: root.lodMetricValue\n }\n}\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ACVa,MAAM,EAAEzD,SAAS;IACjBI,GAAG;IACHsD,QAAQ,EAAEtD,GAAG;IACbmC,IAAI,EAAE3C,YAAY,CAAC+D,GAAG;IACtBb,aAAa;IAEbC,IAAI;IACJb,aAAa,EAAEa,IAAI,CAACb,aAAa;IACjCG,cAAc,EAAEU,IAAI,CAACV;EACvB,CAAC;AACH"}
|
package/dist/esm/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["HeaderAttributeProperty"],"sources":["../../src/types.ts"],"sourcesContent":["import type {Matrix4, Quaternion, Vector3} from '@math.gl/core';\nimport type {TypedArray, MeshAttribute, TextureLevel} from '@loaders.gl/schema';\nimport {TILESET_TYPE, TILE_REFINEMENT, TILE_TYPE, Tile3D, Tileset3D} from '@loaders.gl/tiles';\nimport I3SNodePagesTiles from './lib/helpers/i3s-nodepages-tiles';\nimport {LoaderWithParser} from '@loaders.gl/loader-utils';\n\nexport type COLOR = [number, number, number, number];\n\n/**\n * Extension of SceneLayer3D JSON with postprocessed loader data\n */\nexport interface I3STilesetHeader extends SceneLayer3D {\n /** Not in spec, but is necessary for woking */\n url?: string;\n /** Base path that non-absolute paths in tileset are relative to. */\n basePath?: string;\n /** root node metadata */\n root: I3STileHeader;\n /** instance of the NodePages to tiles loader */\n nodePagesTile?: I3SNodePagesTiles;\n /** Type of the tileset */\n type: TILESET_TYPE.I3S;\n /** LOD metric type per I3S spec*/\n lodMetricType?: string;\n /** LOD metric value */\n lodMetricValue?: number;\n /** Loader that has to be used to load content */\n loader: LoaderWithParser;\n}\n/** https://github.com/Esri/i3s-spec/blob/master/docs/1.8/nodePage.cmn.md */\nexport type NodePage = {\n /** Array of nodes. */\n nodes: NodeInPage[];\n};\n/**\n * Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/mesh.cmn.md\n */\ntype NodeMesh = {\n /**\n * The material definition.\n */\n material: MeshMaterial;\n /** The geometry definition. */\n geometry: MeshGeometry;\n /** The attribute set definition. */\n attribute: meshAttribute;\n};\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/meshMaterial.cmn.md */\nexport type MeshMaterial = {\n /** The index in layer.materialDefinitions array. */\n definition: number;\n /** Resource id for the material textures. i.e: layers/0/nodes/{material.resource}/textures/{tex_name}. Is required if material declares any textures. */\n resource?: number;\n /** Estimated number of texel for the highest resolution base color texture. */\n texelCountHint?: number;\n};\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/meshGeometry.cmn.md */\nexport type MeshGeometry = {\n /** The index in layer.geometryDefinitions array */\n definition: number;\n /** The resource locator to be used to query geometry resources: layers/0/nodes/{this.resource}/geometries/{layer.geometryDefinitions[this.definition].geometryBuffers[0 or 1]}. */\n resource: number;\n /** Number of vertices in the geometry buffer of this mesh for the umcompressed mesh buffer. Please note that Draco compressed meshes may have less vertices due to de-duplication (actual number of vertices is part of the Draco binary blob). Default=0 */\n vertexCount?: number;\n /** Number of features for this mesh. Default=0. (Must omit or set to 0 if mesh doesn't use features.) */\n featureCount?: number;\n};\n/** https://github.com/Esri/i3s-spec/blob/master/docs/1.8/meshAttribute.cmn.md */\ntype meshAttribute = {\n /** The resource identifier to be used to locate attribute resources of this mesh. i.e. layers/0/nodes/<resource id>/attributes/... */\n resource: number;\n};\n\n/**\n * Texture format\n * @see https://github.com/Esri/i3s-spec/blob/master/docs/1.7/textureSetDefinitionFormat.cmn.md\n */\nexport type I3STextureFormat = 'jpg' | 'png' | 'ktx-etc2' | 'dds' | 'ktx2';\n\n/** Postprocessed I3S Node */\nexport type I3STileHeader = I3SMinimalNodeData & {\n /** MBS per I3S spec */\n mbs: Mbs;\n /** Material definition from the layer metadata per I3S spec */\n materialDefinition?: I3SMaterialDefinition;\n /** Bounding volume converted to 3DTiles format. It is generic for `tile` module */\n boundingVolume: {box?: number[]; sphere?: number[]};\n /** LOD metric selected for usage */\n lodMetricType?: string;\n /** LOD metric value */\n lodMetricValue?: number;\n /** Tile content type */\n type: TILE_TYPE.MESH;\n /** Tile refinement type. I3S supports only `REPLACE` */\n refine: TILE_REFINEMENT.REPLACE;\n};\n\n/**\n * Minimal I3S node data is needed for loading\n * These data can come from 3DNodeIndexDocument (I3S spec) or from `I3SNodePagesTiles` instance\n * @see https://github.com/Esri/i3s-spec/blob/master/docs/1.7/3DNodeIndexDocument.cmn.md\n */\nexport type I3SMinimalNodeData = {\n /** Node ID */\n id: string;\n /** Node base path */\n url?: string;\n /** LOD selection metrics */\n lodSelection?: LodSelection[];\n // OBB per I3S spec\n obb?: Obb;\n /** MBS per I3S spec */\n mbs?: Mbs;\n /** Geometry content URL */\n contentUrl?: string;\n /** Texture image URL */\n textureUrl?: string;\n /** Feature attributes URLs */\n attributeUrls?: string[];\n /** Material definition from I3S layer metadata */\n materialDefinition?: I3SMaterialDefinition;\n /** Texture format per I3S spec */\n textureFormat: I3STextureFormat;\n /** Loader options for texture loader. The loader might be `CompressedTextureLoader` for `dds`, BasisLoader for `ktx2` or ImageLoader for `jpg`and `png` */\n textureLoaderOptions?: {[key: string]: any};\n /** Child Nodes references */\n children: NodeReference[];\n /** Is the node has Draco compressed geometry */\n isDracoGeometry: boolean;\n};\n\nexport type I3SParseOptions = {\n /** ArcGIS access token */\n token?: string;\n /** Is 3DSceneLayer json expected in response */\n isTileset?: string;\n /** Is 3DNodeIndexDocument json expected in response */\n isTileHeader?: string;\n /** Tile3D instance. This property used only to load tile content */\n /** Tile-specific options */\n _tileOptions?: I3STileOptions;\n /** Tileset-specific options */\n _tilesetOptions?: I3STilesetOptions;\n /** Load Draco Compressed geometry if available */\n useDracoGeometry?: boolean;\n /** Load compressed textures if available */\n useCompressedTextures?: boolean;\n /** Set false if don't need to parse textures */\n decodeTextures?: boolean;\n /** deck.gl compatible coordinate system.\n * https://github.com/visgl/deck.gl/blob/master/docs/developer-guide/coordinate-systems.md\n * Supported coordinate systems: METER_OFFSETS, LNGLAT_OFFSETS\n */\n coordinateSystem?: number;\n /** Options to colorize 3DObjects by attribute value */\n colorsByAttribute?: {\n /** Feature attribute name */\n attributeName: string;\n /** Minimum attribute value */\n minValue: number;\n /** Maximum attribute value */\n maxValue: number;\n /** Minimum color. 3DObject will be colorized with gradient from `minColor to `maxColor` */\n minColor: COLOR;\n /** Maximum color. 3DObject will be colorized with gradient from `minColor to `maxColor` */\n maxColor: COLOR;\n /** Colorization mode. `replace` - replace vertex colors with a new colors, `multiply` - multiply vertex colors with new colors */\n mode: 'multiply' | 'replace';\n };\n\n /** @deprecated */\n tile?: Tile3D | I3STileOptions;\n /** Tileset3D instance. This property used only to load tile content */\n /** @deprecated */\n tileset?: Tileset3D | I3STilesetOptions;\n};\n\nexport type I3STileOptions = {\n isDracoGeometry: boolean;\n textureUrl?: string;\n textureFormat?: I3STextureFormat;\n textureLoaderOptions?: any;\n materialDefinition?: I3SMaterialDefinition;\n attributeUrls: string[];\n mbs: Mbs;\n};\n\nexport type I3STilesetOptions = {\n store: Store;\n attributeStorageInfo: AttributeStorageInfo[];\n fields: Field[];\n};\n\n// TODO Replace \"[key: string]: any\" with actual defenition\nexport type I3STileContent = {\n attributes: I3SMeshAttributes;\n indices: TypedArray | null;\n featureIds: number[] | TypedArray;\n vertexCount: number;\n modelMatrix: Matrix4;\n coordinateSystem: number;\n byteLength: number;\n texture: TileContentTexture;\n [key: string]: any;\n};\n\nexport type TileContentTexture =\n | ArrayBuffer\n | {\n compressed: boolean;\n mipmaps: boolean;\n width: number;\n height: number;\n data: TextureLevel[];\n }\n | null;\n\nexport type BoundingVolumes = {\n mbs: Mbs;\n obb: Obb;\n};\n\n/**\n * Oriented bounding box per I3S spec\n * @see https://github.com/Esri/i3s-spec/blob/master/docs/1.7/obb.cmn.md\n */\nexport type Obb = {\n center: number[] | Vector3;\n halfSize: number[] | Vector3;\n quaternion: number[] | Quaternion;\n};\n\n/**\n * Minimum bounding sphere per I3S spec\n * @see https://github.com/Esri/i3s-spec/blob/master/docs/1.7/3DNodeIndexDocument.cmn.md#properties\n */\nexport type Mbs = [number, number, number, number];\n\n/** SceneLayer3D based on I3S specification - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/3DSceneLayer.cmn.md */\nexport type SceneLayer3D = {\n /** Unique numeric ID of the layer. */\n id: number;\n /** The relative URL to the 3DSceneLayerResource. Only present as part of the SceneServiceInfo resource. */\n href?: string;\n /** The user-visible layer type */\n layerType: '3DObject' | 'IntegratedMesh';\n /** The spatialReference of the layer including the vertical coordinate reference system (CRS). Well Known Text (WKT) for CRS is included to support custom CRS. */\n spatialReference?: SpatialReference;\n /** Enables consuming clients to quickly determine whether this layer is compatible (with respect to its horizontal and vertical coordinate system) with existing content. */\n heightModelInfo?: HeightModelInfo;\n /** The ID of the last update session in which any resource belonging to this layer has been updated. */\n version: string;\n /** The name of this layer. */\n name?: string;\n /** The time of the last update. */\n serviceUpdateTimeStamp?: {lastUpdate: number};\n /** The display alias to be used for this layer. */\n alias?: string;\n /** Description string for this layer. */\n description?: string;\n /** Copyright and usage information for the data in this layer. */\n copyrightText?: string;\n /** Capabilities supported by this layer. */\n capabilities: string[];\n /** ZFactor to define conversion factor for elevation unit. */\n ZFactor?: number;\n /** Indicates if any styling information represented as drawingInfo is captured as part of the binary mesh representation. */\n cachedDrawingInfo?: CachedDrawingInfo;\n /** An object containing drawing information. */\n drawingInfo?: DrawingInfo;\n /** An object containing elevation drawing information. If absent, any content of the scene layer is drawn at its z coordinate. */\n elevationInfo?: ElevationInfo;\n /** PopupInfo of the scene layer. */\n popupInfo?: PopupInfo;\n /** Indicates if client application will show the popup information. Default is FALSE. */\n disablePopup: boolean;\n /**\n * The store object describes the exact physical storage of a layer and\n * enables the client to detect when multiple layers are served from\n * the same store.\n */\n store: Store;\n /** A collection of objects that describe each attribute field regarding its field name, datatype, and a user friendly name {name,type,alias}. */\n fields?: Field[];\n /** Provides the schema and layout used for storing attribute content in binary format in I3S. */\n attributeStorageInfo?: AttributeStorageInfo[];\n /** Contains the statistical information for a layer. */\n statisticsInfo?: StatisticsInfo[];\n /** The paged-access index description. */\n nodePages?: NodePageDefinition;\n /** List of materials classes used in this layer. */\n materialDefinitions?: I3SMaterialDefinition[];\n /** Defines the set of textures that can be referenced by meshes. */\n textureSetDefinitions?: TextureSetDefinition[];\n /** Define the layouts of mesh geometry and its attributes */\n geometryDefinitions?: GeometryDefinition[];\n /** 3D extent. */\n fullExtent?: FullExtent;\n};\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/cachedDrawingInfo.cmn.md */\nexport type CachedDrawingInfo = {\n /** If true, the drawingInfo is captured as part of the binary scene layer representation. */\n color: boolean;\n};\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/drawingInfo.cmn.md */\nexport type DrawingInfo = {\n /** An object defining the symbology for the layer. See more information about supported renderer types in ArcGIS clients. */\n renderer: any;\n /** Scale symbols for the layer. */\n scaleSymbols: boolean;\n};\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/elevationInfo.cmn.md */\nexport type ElevationInfo = {\n mode: 'relativeToGround' | 'absoluteHeight' | 'onTheGround' | 'relativeToScene';\n /** Offset is always added to the result of the above logic except for onTheGround where offset is ignored. */\n offset: number;\n /** A string value indicating the unit for the values in elevationInfo */\n unit: string;\n};\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/statisticsInfo.cmn.md */\nexport type StatisticsInfo = {\n /** Key indicating the resource of the statistics. */\n key: string;\n /** Name of the field of the statistical information. */\n name: string;\n /** The URL to the statistics information. */\n href: string;\n};\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/nodePageDefinition.cmn.md */\nexport type NodePageDefinition = {\n /** Number of nodes per page for this layer. Must be a power-of-two less than 4096 */\n nodesPerPage: number;\n /** Index of the root node. Default = 0. */\n rootIndex?: number;\n /** Defines the meaning of nodes[].lodThreshold for this layer. */\n lodSelectionMetricType: 'maxScreenThresholdSQ';\n};\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/materialDefinitions.cmn.md */\nexport type I3SMaterialDefinition = {\n /** A set of parameter values that are used to define the metallic-roughness material model from Physically-Based Rendering (PBR) methodology. When not specified, all the default values of pbrMetallicRoughness apply. */\n pbrMetallicRoughness: I3SPbrMetallicRoughness;\n /** The normal texture map. */\n normalTexture?: I3SMaterialTexture;\n /** The occlusion texture map. */\n occlusionTexture?: I3SMaterialTexture;\n /** The emissive texture map. */\n emissiveTexture?: I3SMaterialTexture;\n /** The emissive color of the material. */\n emissiveFactor?: [number, number, number];\n /** Defines the meaning of the alpha-channel/alpha-mask. */\n alphaMode: 'opaque' | 'mask' | 'blend';\n /** The alpha cutoff value of the material. */\n alphaCutoff?: number;\n /** Specifies whether the material is double sided. */\n doubleSided?: boolean;\n /** Winding order is counterclockwise. */\n cullFace?: 'none' | 'front' | 'back';\n};\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/pbrMetallicRoughness.cmn.md */\nexport type I3SPbrMetallicRoughness = {\n /** The material's base color factor. default=[1,1,1,1] */\n baseColorFactor?: [number, number, number, number];\n /** The base color texture. */\n baseColorTexture?: I3SMaterialTexture;\n /** the metalness of the material. default=1.0 */\n metallicFactor: number;\n /** the roughness of the material. default=1.0 */\n roughnessFactor: number;\n /** the metallic-roughness texture. */\n metallicRoughnessTexture?: I3SMaterialTexture;\n};\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/materialTexture.cmn.md */\nexport type I3SMaterialTexture = {\n /** The index in layer.textureSetDefinitions. */\n textureSetDefinitionId: number;\n /** The set index of texture's TEXCOORD attribute used for texture coordinate mapping. Default is 0. Deprecated. */\n texCoord?: number;\n /** The normal texture: scalar multiplier applied to each normal vector of the normal texture. For occlusion texture,scalar multiplier controlling the amount of occlusion applied. Default=1 */\n factor?: number;\n};\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/attributeStorageInfo.cmn.md */\nexport type AttributeStorageInfo = {\n key: string;\n name: string;\n header: {property: string; valueType: string}[];\n ordering?: string[];\n attributeValues?: AttributeValue;\n attributeByteCounts?: AttributeValue;\n objectIds?: AttributeValue;\n};\n\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/field.cmn.md */\nexport type Field = {\n name: string;\n type: ESRIField;\n alias?: string;\n domain?: Domain;\n};\n\nexport type ESRIField =\n | 'esriFieldTypeDate'\n | 'esriFieldTypeSingle'\n | 'esriFieldTypeDouble'\n | 'esriFieldTypeGUID'\n | 'esriFieldTypeGlobalID'\n | 'esriFieldTypeInteger'\n | 'esriFieldTypeOID'\n | 'esriFieldTypeSmallInteger'\n | 'esriFieldTypeString';\n\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/popupInfo.cmn.md */\nexport type PopupInfo = {\n title?: string;\n description?: string;\n expressionInfos?: any[];\n fieldInfos?: FieldInfo[];\n mediaInfos?: any[];\n popupElements?: {text?: string; type?: string; fieldInfos?: FieldInfo[]}[];\n};\n\n/**\n * Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.7/3DNodeIndexDocument.cmn.md\n */\nexport type Node3DIndexDocument = {\n id: string;\n version?: string;\n level?: number;\n mbs?: Mbs;\n obb?: Obb;\n lodSelection?: LodSelection[];\n children?: NodeReference[];\n neighbors?: NodeReference[];\n parentNode?: NodeReference;\n sharedResource?: Resource;\n featureData?: Resource[];\n geometryData?: Resource[];\n textureData?: Resource[];\n attributeData?: Resource[];\n created?: string;\n expires?: string;\n};\n\n/**\n * LOD selection metrics per I3S spec\n * @see https://github.com/Esri/i3s-spec/blob/master/docs/1.7/lodSelection.cmn.md\n */\nexport type LodSelection = {\n /** */\n metricType?: string;\n maxError: number;\n};\n\n/**\n * Node reference per I3S spec\n * @see https://github.com/Esri/i3s-spec/blob/master/docs/1.7/nodeReference.cmn.md\n */\nexport type NodeReference = {\n /** Tree Key ID of the referenced node represented as string. */\n id: string;\n /** Version (store update session ID) of the referenced node. */\n version?: string;\n /** An array of four doubles, corresponding to x, y, z and radius of the minimum bounding sphere of a node. */\n mbs?: Mbs;\n /** Describes oriented bounding box. */\n obb?: Obb;\n /** Number of values per element. */\n href?: string;\n /** Number of features in the referenced node and its descendants, down to the leaf nodes. */\n featureCount?: number;\n};\n\nexport type Resource = {\n href: string;\n layerContent?: string[];\n featureRange?: number[];\n multiTextureBundle?: string;\n vertexElements?: number[];\n faceElements?: number[];\n nodePath?: string;\n};\n\nexport type MaxScreenThresholdSQ = {\n maxError: number;\n};\n\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/node.cmn.md */\nexport type NodeInPage = {\n /**\n * The index in the node array. May be different than material, geometry and attribute resource id. See mesh for more information.\n */\n index: number;\n /**\n * The index of the parent node in the node array.\n */\n parentIndex?: number;\n /**\n * When to switch LoD. See https://github.com/Esri/i3s-spec/blob/master/docs/1.8/nodePageDefinition.cmn.md for more information.\n */\n lodThreshold?: number;\n /**\n * Oriented bounding box for this node.\n */\n obb: Obb;\n /**\n * index of the children nodes indices.\n */\n children?: number[];\n /**\n * The mesh for this node. WARNING: only SINGLE mesh is supported at version 1.7 (i.e. length must be 0 or 1).\n */\n mesh?: NodeMesh;\n};\n\n/**\n * https://github.com/Esri/i3s-spec/blob/master/docs/1.8/materialDefinitionInfo.cmn.md\n */\nexport type MaterialDefinitionInfo = {\n /** A name for the material as assigned in the creating application. */\n name?: string;\n /** Indicates the material type, chosen from the supported values. */\n type?: 'standard' | 'water' | 'billboard' | 'leafcard' | 'reference';\n /** The href that resolves to the shared resource bundle in which the material definition is contained. */\n $ref?: string;\n /** Parameter defined for the material.\n * https://github.com/Esri/i3s-spec/blob/master/docs/1.8/materialParams.cmn.md\n */\n params: {\n /** Indicates transparency of this material; 0 = opaque, 1 = fully transparent. */\n transparency?: number;\n /** Indicates reflectivity of this material. */\n reflectivity?: number;\n /** Indicates shininess of this material. */\n shininess?: number;\n /** Ambient color of this material. Ambient color is the color of an object where it is in shadow.\n * This color is what the object reflects when illuminated by ambient light rather than direct light. */\n ambient?: number[];\n /** Diffuse color of this material. Diffuse color is the most instinctive meaning of the color of an object.\n * It is that essential color that the object reveals under pure white light. It is perceived as the color\n * of the object itself rather than a reflection of the light. */\n diffuse?: number[];\n /** Specular color of this material. Specular color is the color of the light of a specular reflection\n * (specular reflection is the type of reflection that is characteristic of light reflected from a shiny\n * surface). */\n specular?: number[];\n /** Rendering mode. */\n renderMode: 'textured' | 'solid' | 'untextured' | 'wireframe';\n /** TRUE if features with this material should cast shadows. */\n castShadows?: boolean;\n /** TRUE if features with this material should receive shadows */\n receiveShadows?: boolean;\n /** Indicates the material culling options {back, front, none}. */\n cullFace?: string;\n /** This flag indicates that the vertex color attribute of the geometry should be used to color the geometry\n * for rendering. If texture is present, the vertex colors are multiplied by this color.\n * e.g. pixel_color = [interpolated]vertex_color * texel_color. Default is false. */\n vertexColors?: boolean;\n /** This flag indicates that the geometry has uv region vertex attributes. These are used for adressing\n * subtextures in a texture atlas. The uv coordinates are relative to this subtexture in this case.\n * This is mostly useful for repeated textures in a texture atlas. Default is false. */\n vertexRegions?: boolean;\n /** Indicates whether Vertex Colors also contain a transparency channel. Default is false. */\n useVertexColorAlpha?: boolean;\n };\n};\n\n/** https://github.com/Esri/i3s-spec/blob/master/docs/1.8/sharedResource.cmn.md */\nexport type SharedResources = {\n /** Materials describe how a Feature or a set of Features is to be rendered. */\n materialDefinitions?: {[key: string]: MaterialDefinitionInfo};\n /** A Texture is a set of images, with some parameters specific to the texture/uv mapping to geometries. */\n textureDefinitions?: {[key: string]: TextureDefinitionInfo};\n};\n\n/** https://github.com/Esri/i3s-spec/blob/master/docs/1.8/image.cmn.md */\ntype TextureImage = {\n /** A unique ID for each image. Generated using the BuildID function. */\n id: string;\n /** width of this image, in pixels. */\n size?: number;\n /** The maximum size of a single pixel in world units.\n * This property is used by the client to pick the image to load and render. */\n pixelInWorldUnits?: number;\n /** The href to the image(s), one per encoding, in the same order as the encodings. */\n href?: string[];\n /** The byte offset of this image's encodings. There is one per encoding,\n * in the same order as the encodings, in the block in which this texture image resides. */\n byteOffset?: string[];\n /** The length in bytes of this image's encodings. There is one per encoding,\n * in the same order as the encodings. */\n length?: number[];\n};\n\nexport type Attribute = 'OBJECTID' | 'string' | 'double' | 'Int32' | string;\n\nexport type Extent = [number, number, number, number];\n\nexport type FeatureAttribute = {\n id: AttributeValue;\n faceRange: AttributeValue;\n};\n\nexport type BuildingSceneLayerTileset = {\n header: BuildingSceneLayer;\n sublayers: BuildingSceneSublayer[];\n};\n\nexport type BuildingSceneLayer = {\n id: number;\n name: string;\n version: string;\n alias?: string;\n layerType: 'Building';\n description?: string;\n copyrightText?: string;\n fullExtent: FullExtent;\n spatialReference: SpatialReference;\n heightModelInfo?: HeightModelInfo;\n sublayers: BuildingSceneSublayer[];\n filters?: Filter[];\n activeFilterID?: string;\n statisticsHRef?: string;\n};\n\nexport type BuildingSceneSublayer = {\n id: number;\n name: string;\n alias?: string;\n discipline?: 'Mechanical' | 'Architectural' | 'Piping' | 'Electrical' | 'Structural';\n modelName?: string;\n layerType: 'group' | '3DObject' | 'Point';\n visibility?: boolean;\n sublayers?: BuildingSceneSublayer[];\n isEmpty?: boolean;\n url?: string;\n};\n\ntype Filter = {\n id: string;\n name: string;\n description: string;\n isDefaultFilter?: boolean;\n isVisible?: boolean;\n filterBlocks: FilterBlock[];\n filterAuthoringInfo?: FilterAuthoringInfo;\n};\n\ntype FilterAuthoringInfo = {\n type: string;\n filterBlocks: FilterBlockAuthoringInfo[];\n};\n\ntype FilterBlockAuthoringInfo = {\n filterTypes: FilterType[];\n};\n\ntype FilterType = {\n filterType: string;\n filterValues: string[];\n};\n\ntype FilterBlock = {\n title: string;\n filterMode: FilterModeSolid | FilterModeWireFrame;\n filterExpression: string;\n};\n\ntype Edges = {\n type: string;\n color: number[];\n size: number;\n transparency: number;\n extensionLength: number;\n};\n\ntype FilterModeSolid = {\n type: 'solid';\n};\n\ntype FilterModeWireFrame = {\n type: 'wireFrame';\n edges: Edges;\n};\n\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/spatialReference.cmn.md */\nexport type SpatialReference = {\n /** The current WKID value of the vertical coordinate system. */\n latestVcsWkid: number;\n /** dentifies the current WKID value associated with the same spatial reference. */\n latestWkid: number;\n /** The WKID value of the vertical coordinate system. */\n vcsWkid: number;\n /** WKID, or Well-Known ID, of the CRS. Specify either WKID or WKT of the CRS. */\n wkid: number;\n /** WKT, or Well-Known Text, of the CRS. Specify either WKT or WKID of the CRS but not both. */\n wkt?: string;\n};\n\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/fullExtent.cmn.md */\nexport type FullExtent = {\n /** left longitude in decimal degrees */\n xmin: number;\n /** right longitude in decimal degrees */\n xmax: number;\n /** bottom latitude in decimal degrees*/\n ymin: number;\n /** top latitude in decimal degrees*/\n ymax: number;\n /** lowest elevation in meters */\n zmin: number;\n /** highest elevation in meters */\n zmax: number;\n spatialReference?: SpatialReference;\n};\n\n/**\n * https://github.com/Esri/i3s-spec/blob/master/docs/1.8/textureDefinitionInfo.cmn.md\n */\nexport type TextureDefinitionInfo = {\n /** MIMEtype - The encoding/content type that is used by all images in this map */\n encoding?: string[];\n /** UV wrapping modes, from {none, repeat, mirror}. */\n wrap?: string[];\n /** TRUE if the Map represents a texture atlas. */\n atlas?: boolean;\n /** The name of the UV set to be used as texture coordinates. */\n uvSet?: string;\n /** Indicates channels description. */\n channels?: 'rbg' | 'rgba' | string;\n /** An image is a binary resource, containing a single raster that can be used to texture a feature or symbol. */\n images: TextureImage[];\n};\n\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/domain.cmn.md */\ntype Domain = {\n type: string;\n name: string;\n description?: string;\n fieldType?: string;\n range?: [number, number];\n codedValues?: {name: string; code: string | number}[];\n mergePolicy?: string;\n splitPolicy?: string;\n};\n/**\n * spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/store.cmn.md\n */\ntype Store = {\n id?: string | number;\n profile: string;\n version: number | string;\n resourcePattern?: string[];\n rootNode?: string;\n extent?: number[];\n indexCRS?: string;\n vertexCRS?: string;\n normalReferenceFrame?: string;\n lodType?: string;\n lodModel?: string;\n defaultGeometrySchema: DefaultGeometrySchema;\n nidEncoding?: string;\n textureEncoding?: string[];\n featureEncoding?: string;\n geometryEncoding?: string;\n attributeEncoding?: string;\n indexingScheme?: string;\n};\n/**\n * Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/defaultGeometrySchema.cmn.md\n */\ntype DefaultGeometrySchema = {\n geometryType?: 'triangles';\n topology: 'PerAttributeArray' | 'Indexed';\n header: HeaderAttribute[];\n ordering: string[];\n vertexAttributes: VertexAttribute;\n faces?: VertexAttribute;\n featureAttributeOrder: string[];\n featureAttributes: FeatureAttribute;\n // TODO Do we realy need this Property?\n attributesOrder?: string[];\n};\n/**\n * spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/headerAttribute.cmn.md\n */\nexport type HeaderAttribute = {\n property: HeaderAttributeProperty.vertexCount | HeaderAttributeProperty.featureCount | string;\n type:\n | 'UInt8'\n | 'UInt16'\n | 'UInt32'\n | 'UInt64'\n | 'Int16'\n | 'Int32'\n | 'Int64'\n | 'Float32'\n | 'Float64';\n};\nexport enum HeaderAttributeProperty {\n vertexCount = 'vertexCount',\n featureCount = 'featureCount'\n}\nexport type VertexAttribute = {\n position: GeometryAttribute;\n normal: GeometryAttribute;\n uv0: GeometryAttribute;\n color: GeometryAttribute;\n region?: GeometryAttribute;\n};\nexport type GeometryAttribute = {\n byteOffset?: number;\n valueType: 'UInt8' | 'UInt16' | 'Int16' | 'Int32' | 'Int64' | 'Float32' | 'Float64';\n valuesPerElement: number;\n};\nexport type I3SMeshAttributes = {\n [key: string]: I3SMeshAttribute;\n};\nexport interface I3SMeshAttribute extends MeshAttribute {\n type?: number;\n metadata?: any;\n}\n/** https://github.com/Esri/i3s-spec/blob/master/docs/1.8/heightModelInfo.cmn.md */\ntype HeightModelInfo = {\n heightModel: 'gravity_related_height' | 'ellipsoidal';\n vertCRS: string;\n heightUnit:\n | 'meter'\n | 'us-foot'\n | 'foot'\n | 'clarke-foot'\n | 'clarke-yard'\n | 'clarke-link'\n | 'sears-yard'\n | 'sears-foot'\n | 'sears-chain'\n | 'benoit-1895-b-chain'\n | 'indian-yard'\n | 'indian-1937-yard'\n | 'gold-coast-foot'\n | 'sears-1922-truncated-chain'\n | 'us-inch'\n | 'us-mile'\n | 'us-yard'\n | 'millimeter'\n | 'decimeter'\n | 'centimeter'\n | 'kilometer';\n};\n\nexport type TextureSetDefinitionFormats = {name: string; format: I3STextureFormat}[];\n\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/textureSetDefinition.cmn.md */\ntype TextureSetDefinition = {\n formats: TextureSetDefinitionFormats;\n atlas?: boolean;\n};\n\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/geometryDefinition.cmn.md */\ntype GeometryDefinition = {\n topology?: 'triangle';\n geometryBuffers: GeometryBuffer[];\n};\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/geometryBuffer.cmn.md */\ntype GeometryBuffer = {\n offset?: number;\n position?: GeometryBufferItem;\n normal?: GeometryBufferItem;\n uv0?: GeometryBufferItem;\n color?: GeometryBufferItem;\n uvRegion?: GeometryBufferItem;\n featureId?: GeometryBufferItem;\n faceRange?: GeometryBufferItem;\n compressedAttributes?: {encoding: string; attributes: string[]};\n};\n\ntype GeometryBufferItem = {type: string; component: number; encoding?: string; binding?: string};\n\ntype AttributeValue = {valueType: string; encoding?: string; valuesPerElement?: number};\n\nexport type FieldInfo = {\n fieldName: string;\n visible: boolean;\n isEditable: boolean;\n label: string;\n};\n\nexport type ArcGisWebSceneData = {\n header: ArcGisWebScene;\n layers: OperationalLayer[];\n unsupportedLayers: OperationalLayer[];\n};\n\n/**\n * ArcGis WebScene spec - https://developers.arcgis.com/web-scene-specification/objects/webscene/\n */\nexport type ArcGisWebScene = {\n /**\n * @todo add type.\n * Spec - https://developers.arcgis.com/web-scene-specification/objects/applicationProperties/\n * Configuration of application and UI elements.\n */\n applicationProperties?: any;\n /**\n * Operational layers contain business data which are used to make thematic scenes.\n */\n operationalLayers: OperationalLayer[];\n /**\n * Basemaps give the web scene a geographic context.\n */\n baseMap: BaseMap;\n /**\n * Ground defines the main surface of the web scene, based on elevation layers.\n */\n ground: Ground;\n /**\n * An object that defines the characteristics of the vertical coordinate system used by the web scene.\n */\n heightModelInfo: HeightModelInfo;\n /**\n * Root element in the web scene specifying a string value indicating the web scene version.\n * Valid values: 1.8, 1.9, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19, 1.20, 1.21, 1.22, 1.23, 1.24, 1.25, 1.26, 1.27\n */\n version: string;\n /**\n * String value indicating the application which authored the webmap\n */\n authoringApp: string;\n /**\n * String value indicating the authoring App's version number.\n */\n authoringAppVersion: string;\n /**\n * A presentation consists of multiple slides, where each slide is a specific view into the web scene.\n * Spec - https://developers.arcgis.com/web-scene-specification/objects/presentation/\n * @todo Add presentation type.\n */\n presentation: ArcGisPresentation;\n /**\n * An object that provides information about the initial environment settings and viewpoint of the web scene.\n */\n initialState: InitialState;\n /**\n * An object used to specify the spatial reference of the given geometry.\n */\n spatialReference: SpatialReference;\n viewingMode: 'global' | 'local';\n /**\n * @todo add type.\n * Defines area to be clipped for display.\n */\n clippingArea?: any;\n /**\n * @todo add type.\n * Spec - https://developers.arcgis.com/web-scene-specification/objects/mapFloorInfo/\n * Contains floor-awareness information for the web scene.\n */\n mapFloorInfo?: any;\n /**\n * @todo add type.\n * Spec - https://developers.arcgis.com/web-scene-specification/objects/mapRangeInfo/\n * Map Range Information\n */\n mapRangeInfo?: any;\n /**\n * @todo add type.\n * Spec - https://developers.arcgis.com/web-scene-specification/objects/table/\n * An array of table objects.\n */\n tables?: any;\n /**\n * @todo add type.\n * Spec - https://developers.arcgis.com/web-scene-specification/objects/transportationNetwork/\n * Used to specify the transportation networks of the scene.\n */\n transportationNetworks?: any;\n /**\n * @todo add type.\n * Spec - https://developers.arcgis.com/web-scene-specification/objects/widgets/\n * The widgets object contains widgets that should be exposed to the user.\n */\n widgets?: any;\n};\n\n/**\n * Spec - https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html\n */\ntype ArcGisPresentation = {\n slides: Slide[];\n};\n\n/**\n * A slide stores a snapshot of several pre-set properties of the WebScene and SceneView,\n * such as the basemap, viewpoint and visible layers.\n * Spec - https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html\n */\ntype Slide = {\n id: string;\n title: {\n text: string;\n };\n thumbnail: {\n url: string;\n };\n description: {\n text: string;\n };\n ground: {\n transparency: number;\n };\n baseMap: ArcGisBaseMap;\n visibleLayers: ArcGisVisibleLayer[];\n viewpoint: ArcGisViewPoint;\n};\n\n/**\n * The basemap of the scene. Only the base and reference layers of the basemap are stored in a slide.\n * Spec - https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html\n */\ntype ArcGisBaseMap = {\n id: string;\n title: string;\n baseMapLayers: ArcGisBaseMapLayer[];\n};\n\n/**\n * The visible layers of the scene.\n * Spec - https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#visibleLayers\n */\ntype ArcGisVisibleLayer = {\n id: string;\n sublayerIds: number[];\n};\n/**\n * The basemap of the scene.\n * Spec - https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html\n */\ntype ArcGisBaseMapLayer = {\n id: string;\n title: string;\n url: string;\n layerType: string;\n visibility: boolean;\n};\n\n/**\n * The viewpoint of the slide. This acts like a bookmark, saving a predefined location or point of view from which to view the scene.\n * Spec - https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html\n */\ntype ArcGisViewPoint = {\n scale: number;\n rotation?: number;\n /**\n * Spec - https://developers.arcgis.com/web-scene-specification/objects/viewpoint/\n */\n targetGeometry: any;\n camera: ArcGisCamera;\n};\n\n/**\n * The camera defines the position, tilt, and heading of the point from which the SceneView's visible extent is observed.\n * It is not associated with device hardware. This class only applies to 3D SceneViews.\n * Spec - https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html\n */\nexport type ArcGisCamera = {\n position: {\n x: number;\n y: number;\n z: number;\n };\n spatialReference: {\n wkid: number;\n latestWkid: number;\n };\n heading: number;\n tilt: number;\n};\n\n/**\n * Operational layers contain your data. Usually, a basemap sits beneath your operational layers to give them geographic context.\n * Spec- https://developers.arcgis.com/web-scene-specification/objects/operationalLayers/\n */\nexport type OperationalLayer = {\n id: string;\n opacity: number;\n title: string;\n url: string;\n visibility: boolean;\n itemId: string;\n layerType: string;\n LayerDefinition: LayerDefinition;\n screenSizePerspective: boolean;\n showLabels?: boolean;\n disablePopup?: boolean;\n showLegend?: boolean;\n layers?: OperationalLayer[];\n};\n\ntype LayerDefinition = {\n elevationInfo: ElevationInfo;\n drawingInfo: DrawingInfo;\n};\n\ntype BaseMap = {\n id: string;\n title: string;\n baseMapLayers: BaseMapLayer[];\n elevationLayers: ElevationLayer[];\n};\n\ntype BaseMapLayer = {\n id: string;\n opacity: number;\n title: string;\n url: string;\n visibility: boolean;\n layerType: string;\n};\n\ntype ElevationLayer = {\n id: string;\n listMode: string;\n title: string;\n url: string;\n visibility: boolean;\n layerType: string;\n};\n\ntype Ground = {\n layers: ElevationLayer[];\n transparency: number;\n navigationConstraint: NavigationConstraint;\n};\n\ntype NavigationConstraint = {\n type: string;\n};\n\ntype InitialState = {\n environment: Enviroment;\n viewpoint: ViewPoint;\n};\n\ntype Enviroment = {\n lighting: Lighting;\n atmosphereEnabled?: string;\n starsEnabled?: string;\n};\n\ntype Lighting = {\n datetime?: number;\n displayUTCOffset?: number;\n};\n\ntype ViewPoint = {\n camera: Camera;\n};\n\ntype Camera = {\n position: CameraPosition;\n heading: number;\n tilt: number;\n};\n\ntype CameraPosition = {\n spatialReference: SpatialReference;\n x: number;\n y: number;\n z: number;\n};\n\n/**\n * Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/statsInfo.cmn.md\n */\nexport type StatsInfo = {\n /** Represents the count of the value. */\n totalValuesCount?: number;\n /** Minimum attribute value for the entire layer. */\n min?: number;\n /** Maximum attribute value for the entire layer. */\n max?: number;\n /** Count for the entire layer. */\n count?: number;\n /** Sum of the attribute values over the entire layer. */\n sum?: number;\n /** Representing average or mean value. For example, sum/count. */\n avg?: number;\n /** Representing the standard deviation. */\n stddev?: number;\n /**\tRepresenting variance. For example, stats.stddev *stats.stddev. */\n variance?: number;\n /** Represents the histogram. */\n histogram?: Histogram;\n /** An array of most frequently used values within the point cloud scene layer. */\n mostFrequentValues?: ValueCount[];\n};\n\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/histogram.cmn.md */\nexport type Histogram = {\n /** Minimum attribute value for the entire layer. */\n minimum: number;\n /** Maximum attribute value for the entire layer. Maximum array size for stats.histo.counts is 256. */\n maximum: number;\n /** Count for the entire layer. */\n counts: number[];\n};\n\nexport type ValueCount = {\n /** Type of the attribute values after decompression, if applicable. Please note that string is not supported for point cloud scene layer attributes. */\n value: number | string;\n /** Count of the number of values. May exceed 32 bits. */\n count: number;\n};\n"],"mappings":"AA6xBA,WAAYA,uBAAuB,aAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAA,OAAvBA,uBAAuB;AAAA"}
|
|
1
|
+
{"version":3,"file":"types.js","names":["HeaderAttributeProperty"],"sources":["../../src/types.ts"],"sourcesContent":["import type {Matrix4, Quaternion, Vector3} from '@math.gl/core';\nimport type {TypedArray, MeshAttribute, TextureLevel} from '@loaders.gl/schema';\nimport {TILESET_TYPE, TILE_REFINEMENT, TILE_TYPE, Tile3D, Tileset3D} from '@loaders.gl/tiles';\nimport I3SNodePagesTiles from './lib/helpers/i3s-nodepages-tiles';\nimport {LoaderWithParser} from '@loaders.gl/loader-utils';\n\nexport type COLOR = [number, number, number, number];\n\n/**\n * Extension of SceneLayer3D JSON with postprocessed loader data\n */\nexport interface I3STilesetHeader extends SceneLayer3D {\n /** Not in spec, but is necessary for woking */\n url?: string;\n /** Base path that non-absolute paths in tileset are relative to. */\n basePath?: string;\n /** root node metadata */\n root: I3STileHeader;\n /** instance of the NodePages to tiles loader */\n nodePagesTile?: I3SNodePagesTiles;\n /** Type of the tileset */\n type: TILESET_TYPE.I3S;\n /** LOD metric type per I3S spec*/\n lodMetricType?: string;\n /** LOD metric value */\n lodMetricValue?: number;\n /** Loader that has to be used to load content */\n loader: LoaderWithParser;\n}\n/** https://github.com/Esri/i3s-spec/blob/master/docs/1.8/nodePage.cmn.md */\nexport type NodePage = {\n /** Array of nodes. */\n nodes: NodeInPage[];\n};\n/**\n * Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/mesh.cmn.md\n */\ntype NodeMesh = {\n /**\n * The material definition.\n */\n material: MeshMaterial;\n /** The geometry definition. */\n geometry: MeshGeometry;\n /** The attribute set definition. */\n attribute: meshAttribute;\n};\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/meshMaterial.cmn.md */\nexport type MeshMaterial = {\n /** The index in layer.materialDefinitions array. */\n definition: number;\n /** Resource id for the material textures. i.e: layers/0/nodes/{material.resource}/textures/{tex_name}. Is required if material declares any textures. */\n resource?: number;\n /** Estimated number of texel for the highest resolution base color texture. */\n texelCountHint?: number;\n};\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/meshGeometry.cmn.md */\nexport type MeshGeometry = {\n /** The index in layer.geometryDefinitions array */\n definition: number;\n /** The resource locator to be used to query geometry resources: layers/0/nodes/{this.resource}/geometries/{layer.geometryDefinitions[this.definition].geometryBuffers[0 or 1]}. */\n resource: number;\n /** Number of vertices in the geometry buffer of this mesh for the umcompressed mesh buffer. Please note that Draco compressed meshes may have less vertices due to de-duplication (actual number of vertices is part of the Draco binary blob). Default=0 */\n vertexCount?: number;\n /** Number of features for this mesh. Default=0. (Must omit or set to 0 if mesh doesn't use features.) */\n featureCount?: number;\n};\n/** https://github.com/Esri/i3s-spec/blob/master/docs/1.8/meshAttribute.cmn.md */\ntype meshAttribute = {\n /** The resource identifier to be used to locate attribute resources of this mesh. i.e. layers/0/nodes/<resource id>/attributes/... */\n resource: number;\n};\n\n/**\n * Texture format\n * @see https://github.com/Esri/i3s-spec/blob/master/docs/1.7/textureSetDefinitionFormat.cmn.md\n */\nexport type I3STextureFormat = 'jpg' | 'png' | 'ktx-etc2' | 'dds' | 'ktx2';\n\n/** Postprocessed I3S Node */\nexport type I3STileHeader = I3SMinimalNodeData & {\n /** MBS per I3S spec */\n mbs: Mbs;\n /** Material definition from the layer metadata per I3S spec */\n materialDefinition?: I3SMaterialDefinition;\n /** Bounding volume converted to 3DTiles format. It is generic for `tile` module */\n boundingVolume: {box?: number[]; sphere?: number[]};\n /** LOD metric selected for usage */\n lodMetricType?: string;\n /** LOD metric value */\n lodMetricValue?: number;\n /** Tile content type */\n type: TILE_TYPE.MESH;\n /** Tile refinement type. I3S supports only `REPLACE` */\n refine: TILE_REFINEMENT.REPLACE;\n};\n\n/**\n * Minimal I3S node data is needed for loading\n * These data can come from 3DNodeIndexDocument (I3S spec) or from `I3SNodePagesTiles` instance\n * @see https://github.com/Esri/i3s-spec/blob/master/docs/1.7/3DNodeIndexDocument.cmn.md\n */\nexport type I3SMinimalNodeData = {\n /** Node ID */\n id: string;\n /** Node base path */\n url?: string;\n /** LOD selection metrics */\n lodSelection?: LodSelection[];\n // OBB per I3S spec\n obb?: Obb;\n /** MBS per I3S spec */\n mbs?: Mbs;\n /** Geometry content URL */\n contentUrl?: string;\n /** Texture image URL */\n textureUrl?: string;\n /** Feature attributes URLs */\n attributeUrls?: string[];\n /** Material definition from I3S layer metadata */\n materialDefinition?: I3SMaterialDefinition;\n /** Texture format per I3S spec */\n textureFormat: I3STextureFormat;\n /** Loader options for texture loader. The loader might be `CompressedTextureLoader` for `dds`, BasisLoader for `ktx2` or ImageLoader for `jpg`and `png` */\n textureLoaderOptions?: {[key: string]: any};\n /** Child Nodes references */\n children: NodeReference[];\n /** Is the node has Draco compressed geometry */\n isDracoGeometry: boolean;\n};\n\nexport type I3SParseOptions = {\n /** ArcGIS access token */\n token?: string;\n /** Is 3DSceneLayer json expected in response */\n isTileset?: string;\n /** Is 3DNodeIndexDocument json expected in response */\n isTileHeader?: string;\n /** Tile3D instance. This property used only to load tile content */\n /** Tile-specific options */\n _tileOptions?: I3STileOptions;\n /** Tileset-specific options */\n _tilesetOptions?: I3STilesetOptions;\n /** Load Draco Compressed geometry if available */\n useDracoGeometry?: boolean;\n /** Load compressed textures if available */\n useCompressedTextures?: boolean;\n /** Set false if don't need to parse textures */\n decodeTextures?: boolean;\n /** deck.gl compatible coordinate system.\n * https://github.com/visgl/deck.gl/blob/master/docs/developer-guide/coordinate-systems.md\n * Supported coordinate systems: METER_OFFSETS, LNGLAT_OFFSETS\n */\n coordinateSystem?: number;\n /** Options to colorize 3DObjects by attribute value */\n colorsByAttribute?: {\n /** Feature attribute name */\n attributeName: string;\n /** Minimum attribute value */\n minValue: number;\n /** Maximum attribute value */\n maxValue: number;\n /** Minimum color. 3DObject will be colorized with gradient from `minColor to `maxColor` */\n minColor: COLOR;\n /** Maximum color. 3DObject will be colorized with gradient from `minColor to `maxColor` */\n maxColor: COLOR;\n /** Colorization mode. `replace` - replace vertex colors with a new colors, `multiply` - multiply vertex colors with new colors */\n mode: 'multiply' | 'replace';\n };\n\n /** @deprecated */\n tile?: Tile3D | I3STileOptions;\n /** Tileset3D instance. This property used only to load tile content */\n /** @deprecated */\n tileset?: Tileset3D | I3STilesetOptions;\n};\n\nexport type I3STileOptions = {\n isDracoGeometry: boolean;\n textureUrl?: string;\n textureFormat?: I3STextureFormat;\n textureLoaderOptions?: any;\n materialDefinition?: I3SMaterialDefinition;\n attributeUrls: string[];\n mbs: Mbs;\n};\n\nexport type I3STilesetOptions = {\n store: Store;\n attributeStorageInfo: AttributeStorageInfo[];\n fields: Field[];\n};\n\n// TODO Replace \"[key: string]: any\" with actual defenition\nexport type I3STileContent = {\n attributes: I3SMeshAttributes;\n indices: TypedArray | null;\n featureIds: number[] | TypedArray;\n vertexCount: number;\n modelMatrix: Matrix4;\n coordinateSystem: number;\n byteLength: number;\n texture: TileContentTexture;\n [key: string]: any;\n};\n\nexport type TileContentTexture =\n | ArrayBuffer\n | {\n compressed: boolean;\n mipmaps: boolean;\n width: number;\n height: number;\n data: TextureLevel[];\n }\n | null;\n\nexport type BoundingVolumes = {\n mbs: Mbs;\n obb: Obb;\n};\n\n/**\n * Oriented bounding box per I3S spec\n * @see https://github.com/Esri/i3s-spec/blob/master/docs/1.7/obb.cmn.md\n */\nexport type Obb = {\n center: number[] | Vector3;\n halfSize: number[] | Vector3;\n quaternion: number[] | Quaternion;\n};\n\n/**\n * Minimum bounding sphere per I3S spec\n * @see https://github.com/Esri/i3s-spec/blob/master/docs/1.7/3DNodeIndexDocument.cmn.md#properties\n */\nexport type Mbs = [number, number, number, number];\n\n/** SceneLayer3D based on I3S specification - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/3DSceneLayer.cmn.md */\nexport type SceneLayer3D = {\n /** Unique numeric ID of the layer. */\n id: number;\n /** The relative URL to the 3DSceneLayerResource. Only present as part of the SceneServiceInfo resource. */\n href?: string;\n /** The user-visible layer type */\n layerType: '3DObject' | 'IntegratedMesh';\n /** The spatialReference of the layer including the vertical coordinate reference system (CRS). Well Known Text (WKT) for CRS is included to support custom CRS. */\n spatialReference?: SpatialReference;\n /** Enables consuming clients to quickly determine whether this layer is compatible (with respect to its horizontal and vertical coordinate system) with existing content. */\n heightModelInfo?: HeightModelInfo;\n /** The ID of the last update session in which any resource belonging to this layer has been updated. */\n version: string;\n /** The name of this layer. */\n name?: string;\n /** The time of the last update. */\n serviceUpdateTimeStamp?: {lastUpdate: number};\n /** The display alias to be used for this layer. */\n alias?: string;\n /** Description string for this layer. */\n description?: string;\n /** Copyright and usage information for the data in this layer. */\n copyrightText?: string;\n /** Capabilities supported by this layer. */\n capabilities: string[];\n /** ZFactor to define conversion factor for elevation unit. */\n ZFactor?: number;\n /** Indicates if any styling information represented as drawingInfo is captured as part of the binary mesh representation. */\n cachedDrawingInfo?: CachedDrawingInfo;\n /** An object containing drawing information. */\n drawingInfo?: DrawingInfo;\n /** An object containing elevation drawing information. If absent, any content of the scene layer is drawn at its z coordinate. */\n elevationInfo?: ElevationInfo;\n /** PopupInfo of the scene layer. */\n popupInfo?: PopupInfo;\n /** Indicates if client application will show the popup information. Default is FALSE. */\n disablePopup: boolean;\n /**\n * The store object describes the exact physical storage of a layer and\n * enables the client to detect when multiple layers are served from\n * the same store.\n */\n store: Store;\n /** A collection of objects that describe each attribute field regarding its field name, datatype, and a user friendly name {name,type,alias}. */\n fields?: Field[];\n /** Provides the schema and layout used for storing attribute content in binary format in I3S. */\n attributeStorageInfo?: AttributeStorageInfo[];\n /** Contains the statistical information for a layer. */\n statisticsInfo?: StatisticsInfo[];\n /** The paged-access index description. */\n nodePages?: NodePageDefinition;\n /** List of materials classes used in this layer. */\n materialDefinitions?: I3SMaterialDefinition[];\n /** Defines the set of textures that can be referenced by meshes. */\n textureSetDefinitions?: TextureSetDefinition[];\n /** Define the layouts of mesh geometry and its attributes */\n geometryDefinitions?: GeometryDefinition[];\n /** 3D extent. */\n fullExtent?: FullExtent;\n};\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/cachedDrawingInfo.cmn.md */\nexport type CachedDrawingInfo = {\n /** If true, the drawingInfo is captured as part of the binary scene layer representation. */\n color: boolean;\n};\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/drawingInfo.cmn.md */\nexport type DrawingInfo = {\n /** An object defining the symbology for the layer. See more information about supported renderer types in ArcGIS clients. */\n renderer: any;\n /** Scale symbols for the layer. */\n scaleSymbols: boolean;\n};\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/elevationInfo.cmn.md */\nexport type ElevationInfo = {\n mode: 'relativeToGround' | 'absoluteHeight' | 'onTheGround' | 'relativeToScene';\n /** Offset is always added to the result of the above logic except for onTheGround where offset is ignored. */\n offset: number;\n /** A string value indicating the unit for the values in elevationInfo */\n unit: string;\n};\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/statisticsInfo.cmn.md */\nexport type StatisticsInfo = {\n /** Key indicating the resource of the statistics. */\n key: string;\n /** Name of the field of the statistical information. */\n name: string;\n /** The URL to the statistics information. */\n href: string;\n};\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/nodePageDefinition.cmn.md */\nexport type NodePageDefinition = {\n /** Number of nodes per page for this layer. Must be a power-of-two less than 4096 */\n nodesPerPage: number;\n /** Index of the root node. Default = 0. */\n rootIndex?: number;\n /** Defines the meaning of nodes[].lodThreshold for this layer. */\n lodSelectionMetricType: 'maxScreenThresholdSQ';\n};\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/materialDefinitions.cmn.md */\nexport type I3SMaterialDefinition = {\n /** A set of parameter values that are used to define the metallic-roughness material model from Physically-Based Rendering (PBR) methodology. When not specified, all the default values of pbrMetallicRoughness apply. */\n pbrMetallicRoughness: I3SPbrMetallicRoughness;\n /** The normal texture map. */\n normalTexture?: I3SMaterialTexture;\n /** The occlusion texture map. */\n occlusionTexture?: I3SMaterialTexture;\n /** The emissive texture map. */\n emissiveTexture?: I3SMaterialTexture;\n /** The emissive color of the material. */\n emissiveFactor?: [number, number, number];\n /** Defines the meaning of the alpha-channel/alpha-mask. */\n alphaMode: 'opaque' | 'mask' | 'blend';\n /** The alpha cutoff value of the material. */\n alphaCutoff?: number;\n /** Specifies whether the material is double sided. */\n doubleSided?: boolean;\n /** Winding order is counterclockwise. */\n cullFace?: 'none' | 'front' | 'back';\n};\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/pbrMetallicRoughness.cmn.md */\nexport type I3SPbrMetallicRoughness = {\n /** The material's base color factor. default=[1,1,1,1] */\n baseColorFactor?: [number, number, number, number];\n /** The base color texture. */\n baseColorTexture?: I3SMaterialTexture;\n /** the metalness of the material. default=1.0 */\n metallicFactor: number;\n /** the roughness of the material. default=1.0 */\n roughnessFactor: number;\n /** the metallic-roughness texture. */\n metallicRoughnessTexture?: I3SMaterialTexture;\n};\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/materialTexture.cmn.md */\nexport type I3SMaterialTexture = {\n /** The index in layer.textureSetDefinitions. */\n textureSetDefinitionId: number;\n /** The set index of texture's TEXCOORD attribute used for texture coordinate mapping. Default is 0. Deprecated. */\n texCoord?: number;\n /** The normal texture: scalar multiplier applied to each normal vector of the normal texture. For occlusion texture,scalar multiplier controlling the amount of occlusion applied. Default=1 */\n factor?: number;\n};\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/attributeStorageInfo.cmn.md */\nexport type AttributeStorageInfo = {\n key: string;\n name: string;\n header: {property: string; valueType: string}[];\n ordering?: string[];\n attributeValues?: AttributeValue;\n attributeByteCounts?: AttributeValue;\n objectIds?: AttributeValue;\n};\n\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/field.cmn.md */\nexport type Field = {\n name: string;\n type: ESRIField;\n alias?: string;\n domain?: Domain;\n};\n\nexport type ESRIField =\n | 'esriFieldTypeDate'\n | 'esriFieldTypeSingle'\n | 'esriFieldTypeDouble'\n | 'esriFieldTypeGUID'\n | 'esriFieldTypeGlobalID'\n | 'esriFieldTypeInteger'\n | 'esriFieldTypeOID'\n | 'esriFieldTypeSmallInteger'\n | 'esriFieldTypeString';\n\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/popupInfo.cmn.md */\nexport type PopupInfo = {\n title?: string;\n description?: string;\n expressionInfos?: any[];\n fieldInfos?: FieldInfo[];\n mediaInfos?: any[];\n popupElements?: {text?: string; type?: string; fieldInfos?: FieldInfo[]}[];\n};\n\n/**\n * Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.7/3DNodeIndexDocument.cmn.md\n */\nexport type Node3DIndexDocument = {\n id: string;\n version?: string;\n level?: number;\n mbs?: Mbs;\n obb?: Obb;\n lodSelection?: LodSelection[];\n children?: NodeReference[];\n neighbors?: NodeReference[];\n parentNode?: NodeReference;\n sharedResource?: Resource;\n featureData?: Resource[];\n geometryData?: Resource[];\n textureData?: Resource[];\n attributeData?: Resource[];\n created?: string;\n expires?: string;\n};\n\n/**\n * LOD selection metrics per I3S spec\n * @see https://github.com/Esri/i3s-spec/blob/master/docs/1.7/lodSelection.cmn.md\n */\nexport type LodSelection = {\n /** */\n metricType?: string;\n maxError: number;\n};\n\n/**\n * Node reference per I3S spec\n * @see https://github.com/Esri/i3s-spec/blob/master/docs/1.7/nodeReference.cmn.md\n */\nexport type NodeReference = {\n /** Tree Key ID of the referenced node represented as string. */\n id: string;\n /** Version (store update session ID) of the referenced node. */\n version?: string;\n /** An array of four doubles, corresponding to x, y, z and radius of the minimum bounding sphere of a node. */\n mbs?: Mbs;\n /** Describes oriented bounding box. */\n obb?: Obb;\n /** Number of values per element. */\n href?: string;\n /** Number of features in the referenced node and its descendants, down to the leaf nodes. */\n featureCount?: number;\n};\n\nexport type Resource = {\n href: string;\n layerContent?: string[];\n featureRange?: number[];\n multiTextureBundle?: string;\n vertexElements?: number[];\n faceElements?: number[];\n nodePath?: string;\n};\n\nexport type MaxScreenThresholdSQ = {\n maxError: number;\n};\n\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/node.cmn.md */\nexport type NodeInPage = {\n /**\n * The index in the node array. May be different than material, geometry and attribute resource id. See mesh for more information.\n */\n index: number;\n /**\n * The index of the parent node in the node array.\n */\n parentIndex?: number;\n /**\n * When to switch LoD. See https://github.com/Esri/i3s-spec/blob/master/docs/1.8/nodePageDefinition.cmn.md for more information.\n */\n lodThreshold?: number;\n /**\n * Oriented bounding box for this node.\n */\n obb: Obb;\n /**\n * index of the children nodes indices.\n */\n children?: number[];\n /**\n * The mesh for this node. WARNING: only SINGLE mesh is supported at version 1.7 (i.e. length must be 0 or 1).\n */\n mesh?: NodeMesh;\n};\n\n/**\n * https://github.com/Esri/i3s-spec/blob/master/docs/1.8/materialDefinitionInfo.cmn.md\n */\nexport type MaterialDefinitionInfo = {\n /** A name for the material as assigned in the creating application. */\n name?: string;\n /** Indicates the material type, chosen from the supported values. */\n type?: 'standard' | 'water' | 'billboard' | 'leafcard' | 'reference';\n /** The href that resolves to the shared resource bundle in which the material definition is contained. */\n $ref?: string;\n /** Parameter defined for the material.\n * https://github.com/Esri/i3s-spec/blob/master/docs/1.8/materialParams.cmn.md\n */\n params: {\n /** Indicates transparency of this material; 0 = opaque, 1 = fully transparent. */\n transparency?: number;\n /** Indicates reflectivity of this material. */\n reflectivity?: number;\n /** Indicates shininess of this material. */\n shininess?: number;\n /** Ambient color of this material. Ambient color is the color of an object where it is in shadow.\n * This color is what the object reflects when illuminated by ambient light rather than direct light. */\n ambient?: number[];\n /** Diffuse color of this material. Diffuse color is the most instinctive meaning of the color of an object.\n * It is that essential color that the object reveals under pure white light. It is perceived as the color\n * of the object itself rather than a reflection of the light. */\n diffuse?: number[];\n /** Specular color of this material. Specular color is the color of the light of a specular reflection\n * (specular reflection is the type of reflection that is characteristic of light reflected from a shiny\n * surface). */\n specular?: number[];\n /** Rendering mode. */\n renderMode: 'textured' | 'solid' | 'untextured' | 'wireframe';\n /** TRUE if features with this material should cast shadows. */\n castShadows?: boolean;\n /** TRUE if features with this material should receive shadows */\n receiveShadows?: boolean;\n /** Indicates the material culling options {back, front, none}. */\n cullFace?: string;\n /** This flag indicates that the vertex color attribute of the geometry should be used to color the geometry\n * for rendering. If texture is present, the vertex colors are multiplied by this color.\n * e.g. pixel_color = [interpolated]vertex_color * texel_color. Default is false. */\n vertexColors?: boolean;\n /** This flag indicates that the geometry has uv region vertex attributes. These are used for adressing\n * subtextures in a texture atlas. The uv coordinates are relative to this subtexture in this case.\n * This is mostly useful for repeated textures in a texture atlas. Default is false. */\n vertexRegions?: boolean;\n /** Indicates whether Vertex Colors also contain a transparency channel. Default is false. */\n useVertexColorAlpha?: boolean;\n };\n};\n\n/** https://github.com/Esri/i3s-spec/blob/master/docs/1.8/sharedResource.cmn.md */\nexport type SharedResources = {\n /** Materials describe how a Feature or a set of Features is to be rendered. */\n materialDefinitions?: {[key: string]: MaterialDefinitionInfo};\n /** A Texture is a set of images, with some parameters specific to the texture/uv mapping to geometries. */\n textureDefinitions?: {[key: string]: TextureDefinitionInfo};\n};\n\n/** https://github.com/Esri/i3s-spec/blob/master/docs/1.8/image.cmn.md */\ntype TextureImage = {\n /** A unique ID for each image. Generated using the BuildID function. */\n id: string;\n /** width of this image, in pixels. */\n size?: number;\n /** The maximum size of a single pixel in world units.\n * This property is used by the client to pick the image to load and render. */\n pixelInWorldUnits?: number;\n /** The href to the image(s), one per encoding, in the same order as the encodings. */\n href?: string[];\n /** The byte offset of this image's encodings. There is one per encoding,\n * in the same order as the encodings, in the block in which this texture image resides. */\n byteOffset?: string[];\n /** The length in bytes of this image's encodings. There is one per encoding,\n * in the same order as the encodings. */\n length?: number[];\n};\n\nexport type Attribute = 'OBJECTID' | 'string' | 'double' | 'Int32' | string;\n\nexport type Extent = [number, number, number, number];\n\nexport type FeatureAttribute = {\n id: AttributeValue;\n faceRange: AttributeValue;\n};\n\nexport type BuildingSceneLayerTileset = {\n header: BuildingSceneLayer;\n sublayers: BuildingSceneSublayer[];\n};\n\nexport type BuildingSceneLayer = {\n id: number;\n name: string;\n version: string;\n alias?: string;\n layerType: 'Building';\n description?: string;\n copyrightText?: string;\n fullExtent: FullExtent;\n spatialReference: SpatialReference;\n heightModelInfo?: HeightModelInfo;\n sublayers: BuildingSceneSublayer[];\n filters?: Filter[];\n activeFilterID?: string;\n statisticsHRef?: string;\n};\n\nexport type BuildingSceneSublayer = {\n id: number;\n name: string;\n alias?: string;\n discipline?: 'Mechanical' | 'Architectural' | 'Piping' | 'Electrical' | 'Structural';\n modelName?: string;\n layerType: 'group' | '3DObject' | 'Point';\n visibility?: boolean;\n sublayers?: BuildingSceneSublayer[];\n isEmpty?: boolean;\n url?: string;\n};\n\ntype Filter = {\n id: string;\n name: string;\n description: string;\n isDefaultFilter?: boolean;\n isVisible?: boolean;\n filterBlocks: FilterBlock[];\n filterAuthoringInfo?: FilterAuthoringInfo;\n};\n\ntype FilterAuthoringInfo = {\n type: string;\n filterBlocks: FilterBlockAuthoringInfo[];\n};\n\ntype FilterBlockAuthoringInfo = {\n filterTypes: FilterType[];\n};\n\ntype FilterType = {\n filterType: string;\n filterValues: string[];\n};\n\ntype FilterBlock = {\n title: string;\n filterMode: FilterModeSolid | FilterModeWireFrame;\n filterExpression: string;\n};\n\ntype Edges = {\n type: string;\n color: number[];\n size: number;\n transparency: number;\n extensionLength: number;\n};\n\ntype FilterModeSolid = {\n type: 'solid';\n};\n\ntype FilterModeWireFrame = {\n type: 'wireFrame';\n edges: Edges;\n};\n\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/spatialReference.cmn.md */\nexport type SpatialReference = {\n /** The current WKID value of the vertical coordinate system. */\n latestVcsWkid: number;\n /** dentifies the current WKID value associated with the same spatial reference. */\n latestWkid: number;\n /** The WKID value of the vertical coordinate system. */\n vcsWkid: number;\n /** WKID, or Well-Known ID, of the CRS. Specify either WKID or WKT of the CRS. */\n wkid: number;\n /** WKT, or Well-Known Text, of the CRS. Specify either WKT or WKID of the CRS but not both. */\n wkt?: string;\n};\n\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/fullExtent.cmn.md */\nexport type FullExtent = {\n /** left longitude in decimal degrees */\n xmin: number;\n /** right longitude in decimal degrees */\n xmax: number;\n /** bottom latitude in decimal degrees*/\n ymin: number;\n /** top latitude in decimal degrees*/\n ymax: number;\n /** lowest elevation in meters */\n zmin: number;\n /** highest elevation in meters */\n zmax: number;\n spatialReference?: SpatialReference;\n};\n\n/**\n * https://github.com/Esri/i3s-spec/blob/master/docs/1.8/textureDefinitionInfo.cmn.md\n */\nexport type TextureDefinitionInfo = {\n /** MIMEtype - The encoding/content type that is used by all images in this map */\n encoding?: string[];\n /** UV wrapping modes, from {none, repeat, mirror}. */\n wrap?: string[];\n /** TRUE if the Map represents a texture atlas. */\n atlas?: boolean;\n /** The name of the UV set to be used as texture coordinates. */\n uvSet?: string;\n /** Indicates channels description. */\n channels?: 'rbg' | 'rgba' | string;\n /** An image is a binary resource, containing a single raster that can be used to texture a feature or symbol. */\n images: TextureImage[];\n};\n\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/domain.cmn.md */\ntype Domain = {\n type: string;\n name: string;\n description?: string;\n fieldType?: string;\n range?: [number, number];\n codedValues?: {name: string; code: string | number}[];\n mergePolicy?: string;\n splitPolicy?: string;\n};\n/**\n * spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/store.cmn.md\n */\ntype Store = {\n id?: string | number;\n profile: string;\n version: number | string;\n resourcePattern?: string[];\n rootNode?: string;\n extent?: number[];\n indexCRS?: string;\n vertexCRS?: string;\n normalReferenceFrame?: string;\n lodType?: string;\n lodModel?: string;\n defaultGeometrySchema: DefaultGeometrySchema;\n nidEncoding?: string;\n textureEncoding?: string[];\n featureEncoding?: string;\n geometryEncoding?: string;\n attributeEncoding?: string;\n indexingScheme?: string;\n};\n/**\n * Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/defaultGeometrySchema.cmn.md\n */\ntype DefaultGeometrySchema = {\n geometryType?: 'triangles';\n topology: 'PerAttributeArray' | 'Indexed';\n header: HeaderAttribute[];\n ordering: string[];\n vertexAttributes: VertexAttribute;\n faces?: VertexAttribute;\n featureAttributeOrder: string[];\n featureAttributes: FeatureAttribute;\n // TODO Do we realy need this Property?\n attributesOrder?: string[];\n};\n/**\n * spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/headerAttribute.cmn.md\n */\nexport type HeaderAttribute = {\n property: HeaderAttributeProperty.vertexCount | HeaderAttributeProperty.featureCount | string;\n type:\n | 'UInt8'\n | 'UInt16'\n | 'UInt32'\n | 'UInt64'\n | 'Int16'\n | 'Int32'\n | 'Int64'\n | 'Float32'\n | 'Float64';\n};\nexport enum HeaderAttributeProperty {\n vertexCount = 'vertexCount',\n featureCount = 'featureCount'\n}\nexport type VertexAttribute = {\n position: GeometryAttribute;\n normal: GeometryAttribute;\n uv0: GeometryAttribute;\n color: GeometryAttribute;\n region?: GeometryAttribute;\n};\nexport type GeometryAttribute = {\n byteOffset?: number;\n valueType: 'UInt8' | 'UInt16' | 'Int16' | 'Int32' | 'Int64' | 'Float32' | 'Float64';\n valuesPerElement: number;\n};\nexport type I3SMeshAttributes = {\n [key: string]: I3SMeshAttribute;\n};\nexport interface I3SMeshAttribute extends MeshAttribute {\n type?: number;\n metadata?: any;\n}\n/** https://github.com/Esri/i3s-spec/blob/master/docs/1.8/heightModelInfo.cmn.md */\ntype HeightModelInfo = {\n heightModel: 'gravity_related_height' | 'ellipsoidal';\n vertCRS: string;\n heightUnit:\n | 'meter'\n | 'us-foot'\n | 'foot'\n | 'clarke-foot'\n | 'clarke-yard'\n | 'clarke-link'\n | 'sears-yard'\n | 'sears-foot'\n | 'sears-chain'\n | 'benoit-1895-b-chain'\n | 'indian-yard'\n | 'indian-1937-yard'\n | 'gold-coast-foot'\n | 'sears-1922-truncated-chain'\n | 'us-inch'\n | 'us-mile'\n | 'us-yard'\n | 'millimeter'\n | 'decimeter'\n | 'centimeter'\n | 'kilometer';\n};\n\nexport type TextureSetDefinitionFormats = {name: string; format: I3STextureFormat}[];\n\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/textureSetDefinition.cmn.md */\ntype TextureSetDefinition = {\n formats: TextureSetDefinitionFormats;\n atlas?: boolean;\n};\n\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/geometryDefinition.cmn.md */\ntype GeometryDefinition = {\n topology?: 'triangle';\n geometryBuffers: GeometryBuffer[];\n};\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/geometryBuffer.cmn.md */\ntype GeometryBuffer = {\n offset?: number;\n position?: GeometryBufferItem;\n normal?: GeometryBufferItem;\n uv0?: GeometryBufferItem;\n color?: GeometryBufferItem;\n uvRegion?: GeometryBufferItem;\n featureId?: GeometryBufferItem;\n faceRange?: GeometryBufferItem;\n compressedAttributes?: {encoding: string; attributes: string[]};\n};\n\ntype GeometryBufferItem = {type: string; component: number; encoding?: string; binding?: string};\n\ntype AttributeValue = {valueType: string; encoding?: string; valuesPerElement?: number};\n\nexport type FieldInfo = {\n fieldName: string;\n visible: boolean;\n isEditable: boolean;\n label: string;\n};\n\nexport type ArcGISWebSceneData = {\n header: ArcGISWebScene;\n layers: OperationalLayer[];\n unsupportedLayers: OperationalLayer[];\n};\n\n/**\n * ArcGIS WebScene spec - https://developers.arcgis.com/web-scene-specification/objects/webscene/\n */\nexport type ArcGISWebScene = {\n /**\n * @todo add type.\n * Spec - https://developers.arcgis.com/web-scene-specification/objects/applicationProperties/\n * Configuration of application and UI elements.\n */\n applicationProperties?: any;\n /**\n * Operational layers contain business data which are used to make thematic scenes.\n */\n operationalLayers: OperationalLayer[];\n /**\n * Basemaps give the web scene a geographic context.\n */\n baseMap: BaseMap;\n /**\n * Ground defines the main surface of the web scene, based on elevation layers.\n */\n ground: Ground;\n /**\n * An object that defines the characteristics of the vertical coordinate system used by the web scene.\n */\n heightModelInfo: HeightModelInfo;\n /**\n * Root element in the web scene specifying a string value indicating the web scene version.\n * Valid values: 1.8, 1.9, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19, 1.20, 1.21, 1.22, 1.23, 1.24, 1.25, 1.26, 1.27\n */\n version: string;\n /**\n * String value indicating the application which authored the webmap\n */\n authoringApp: string;\n /**\n * String value indicating the authoring App's version number.\n */\n authoringAppVersion: string;\n /**\n * A presentation consists of multiple slides, where each slide is a specific view into the web scene.\n * Spec - https://developers.arcgis.com/web-scene-specification/objects/presentation/\n * @todo Add presentation type.\n */\n presentation: ArcGISPresentation;\n /**\n * An object that provides information about the initial environment settings and viewpoint of the web scene.\n */\n initialState: InitialState;\n /**\n * An object used to specify the spatial reference of the given geometry.\n */\n spatialReference: SpatialReference;\n viewingMode: 'global' | 'local';\n /**\n * @todo add type.\n * Defines area to be clipped for display.\n */\n clippingArea?: any;\n /**\n * @todo add type.\n * Spec - https://developers.arcgis.com/web-scene-specification/objects/mapFloorInfo/\n * Contains floor-awareness information for the web scene.\n */\n mapFloorInfo?: any;\n /**\n * @todo add type.\n * Spec - https://developers.arcgis.com/web-scene-specification/objects/mapRangeInfo/\n * Map Range Information\n */\n mapRangeInfo?: any;\n /**\n * @todo add type.\n * Spec - https://developers.arcgis.com/web-scene-specification/objects/table/\n * An array of table objects.\n */\n tables?: any;\n /**\n * @todo add type.\n * Spec - https://developers.arcgis.com/web-scene-specification/objects/transportationNetwork/\n * Used to specify the transportation networks of the scene.\n */\n transportationNetworks?: any;\n /**\n * @todo add type.\n * Spec - https://developers.arcgis.com/web-scene-specification/objects/widgets/\n * The widgets object contains widgets that should be exposed to the user.\n */\n widgets?: any;\n};\n\n/**\n * Spec - https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html\n */\ntype ArcGISPresentation = {\n slides: Slide[];\n};\n\n/**\n * A slide stores a snapshot of several pre-set properties of the WebScene and SceneView,\n * such as the basemap, viewpoint and visible layers.\n * Spec - https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html\n */\ntype Slide = {\n id: string;\n title: {\n text: string;\n };\n thumbnail: {\n url: string;\n };\n description: {\n text: string;\n };\n ground: {\n transparency: number;\n };\n baseMap: ArcGISBaseMap;\n visibleLayers: ArcGISVisibleLayer[];\n viewpoint: ArcGISViewPoint;\n};\n\n/**\n * The basemap of the scene. Only the base and reference layers of the basemap are stored in a slide.\n * Spec - https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html\n */\ntype ArcGISBaseMap = {\n id: string;\n title: string;\n baseMapLayers: ArcGISBaseMapLayer[];\n};\n\n/**\n * The visible layers of the scene.\n * Spec - https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#visibleLayers\n */\ntype ArcGISVisibleLayer = {\n id: string;\n sublayerIds: number[];\n};\n/**\n * The basemap of the scene.\n * Spec - https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html\n */\ntype ArcGISBaseMapLayer = {\n id: string;\n title: string;\n url: string;\n layerType: string;\n visibility: boolean;\n};\n\n/**\n * The viewpoint of the slide. This acts like a bookmark, saving a predefined location or point of view from which to view the scene.\n * Spec - https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html\n */\ntype ArcGISViewPoint = {\n scale: number;\n rotation?: number;\n /**\n * Spec - https://developers.arcgis.com/web-scene-specification/objects/viewpoint/\n */\n targetGeometry: any;\n camera: ArcGISCamera;\n};\n\n/**\n * The camera defines the position, tilt, and heading of the point from which the SceneView's visible extent is observed.\n * It is not associated with device hardware. This class only applies to 3D SceneViews.\n * Spec - https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html\n */\nexport type ArcGISCamera = {\n position: {\n x: number;\n y: number;\n z: number;\n };\n spatialReference: {\n wkid: number;\n latestWkid: number;\n };\n heading: number;\n tilt: number;\n};\n\n/**\n * Operational layers contain your data. Usually, a basemap sits beneath your operational layers to give them geographic context.\n * Spec- https://developers.arcgis.com/web-scene-specification/objects/operationalLayers/\n */\nexport type OperationalLayer = {\n id: string;\n opacity: number;\n title: string;\n url: string;\n visibility: boolean;\n itemId: string;\n layerType: string;\n LayerDefinition: LayerDefinition;\n screenSizePerspective: boolean;\n showLabels?: boolean;\n disablePopup?: boolean;\n showLegend?: boolean;\n layers?: OperationalLayer[];\n};\n\ntype LayerDefinition = {\n elevationInfo: ElevationInfo;\n drawingInfo: DrawingInfo;\n};\n\ntype BaseMap = {\n id: string;\n title: string;\n baseMapLayers: BaseMapLayer[];\n elevationLayers: ElevationLayer[];\n};\n\ntype BaseMapLayer = {\n id: string;\n opacity: number;\n title: string;\n url: string;\n visibility: boolean;\n layerType: string;\n};\n\ntype ElevationLayer = {\n id: string;\n listMode: string;\n title: string;\n url: string;\n visibility: boolean;\n layerType: string;\n};\n\ntype Ground = {\n layers: ElevationLayer[];\n transparency: number;\n navigationConstraint: NavigationConstraint;\n};\n\ntype NavigationConstraint = {\n type: string;\n};\n\ntype InitialState = {\n environment: Enviroment;\n viewpoint: ViewPoint;\n};\n\ntype Enviroment = {\n lighting: Lighting;\n atmosphereEnabled?: string;\n starsEnabled?: string;\n};\n\ntype Lighting = {\n datetime?: number;\n displayUTCOffset?: number;\n};\n\ntype ViewPoint = {\n camera: Camera;\n};\n\ntype Camera = {\n position: CameraPosition;\n heading: number;\n tilt: number;\n};\n\ntype CameraPosition = {\n spatialReference: SpatialReference;\n x: number;\n y: number;\n z: number;\n};\n\n/**\n * Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/statsInfo.cmn.md\n */\nexport type StatsInfo = {\n /** Represents the count of the value. */\n totalValuesCount?: number;\n /** Minimum attribute value for the entire layer. */\n min?: number;\n /** Maximum attribute value for the entire layer. */\n max?: number;\n /** Count for the entire layer. */\n count?: number;\n /** Sum of the attribute values over the entire layer. */\n sum?: number;\n /** Representing average or mean value. For example, sum/count. */\n avg?: number;\n /** Representing the standard deviation. */\n stddev?: number;\n /**\tRepresenting variance. For example, stats.stddev *stats.stddev. */\n variance?: number;\n /** Represents the histogram. */\n histogram?: Histogram;\n /** An array of most frequently used values within the point cloud scene layer. */\n mostFrequentValues?: ValueCount[];\n};\n\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/histogram.cmn.md */\nexport type Histogram = {\n /** Minimum attribute value for the entire layer. */\n minimum: number;\n /** Maximum attribute value for the entire layer. Maximum array size for stats.histo.counts is 256. */\n maximum: number;\n /** Count for the entire layer. */\n counts: number[];\n};\n\nexport type ValueCount = {\n /** Type of the attribute values after decompression, if applicable. Please note that string is not supported for point cloud scene layer attributes. */\n value: number | string;\n /** Count of the number of values. May exceed 32 bits. */\n count: number;\n};\n"],"mappings":"AA6xBA,WAAYA,uBAAuB,aAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAA,OAAvBA,uBAAuB;AAAA"}
|