@loaders.gl/i3s 4.0.5 → 4.0.6
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/arcgis-webscene-loader.js +1 -1
- package/dist/arcgis-webscene-loader.js.map +1 -1
- package/dist/dist.dev.js +12 -13
- package/dist/i3s-attribute-loader.js +1 -1
- package/dist/i3s-attribute-loader.js.map +1 -1
- package/dist/i3s-building-scene-layer-loader.js +1 -1
- package/dist/i3s-building-scene-layer-loader.js.map +1 -1
- package/dist/i3s-content-loader.js +1 -1
- package/dist/i3s-content-loader.js.map +1 -1
- package/dist/i3s-content-worker-node.js +2 -2
- package/dist/i3s-content-worker.js +6 -6
- package/dist/i3s-loader.js +1 -1
- package/dist/i3s-loader.js.map +1 -1
- package/dist/i3s-node-page-loader.js +1 -1
- package/dist/i3s-node-page-loader.js.map +1 -1
- package/dist/i3s-slpk-loader.js +1 -1
- package/dist/i3s-slpk-loader.js.map +1 -1
- package/package.json +10 -10
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseWebscene } from "./lib/parsers/parse-arcgis-webscene.js";
|
|
2
|
-
const VERSION = typeof
|
|
2
|
+
const VERSION = typeof "4.0.6" !== 'undefined' ? "4.0.6" : 'latest';
|
|
3
3
|
export const ArcGISWebSceneLoader = {
|
|
4
4
|
name: 'ArcGIS Web Scene Loader',
|
|
5
5
|
id: 'arcgis-web-scene',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arcgis-webscene-loader.js","names":["parseWebscene","VERSION","
|
|
1
|
+
{"version":3,"file":"arcgis-webscene-loader.js","names":["parseWebscene","VERSION","ArcGISWebSceneLoader","name","id","module","version","mimeTypes","parse","extensions","options","data"],"sources":["../src/arcgis-webscene-loader.ts"],"sourcesContent":["import type {LoaderOptions, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {ArcGISWebSceneData} from './types';\n\nimport {parseWebscene} from './lib/parsers/parse-arcgis-webscene';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type ArcGISWebSceneLoaderOptions = LoaderOptions & {};\n\n/**\n * Loader for ArcGIS WebScene\n * Spec - https://developers.arcgis.com/web-scene-specification/objects/webscene/\n */\nexport const ArcGISWebSceneLoader: LoaderWithParser<\n ArcGISWebSceneData,\n never,\n ArcGISWebSceneLoaderOptions\n> = {\n name: 'ArcGIS Web Scene Loader',\n id: 'arcgis-web-scene',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/json'],\n parse,\n extensions: ['json'],\n options: {}\n};\n\n/**\n * Parse ArcGIS webscene\n * @param data\n */\nasync function parse(data: ArrayBuffer): Promise<ArcGISWebSceneData> {\n return parseWebscene(data);\n}\n"],"mappings":"SAGQA,aAAa;AAIrB,MAAMC,OAAO,GAAG,cAAkB,KAAK,WAAW,aAAiB,QAAQ;AAQ3E,OAAO,MAAMC,oBAIZ,GAAG;EACFC,IAAI,EAAE,yBAAyB;EAC/BC,EAAE,EAAE,kBAAkB;EACtBC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEL,OAAO;EAChBM,SAAS,EAAE,CAAC,kBAAkB,CAAC;EAC/BC,KAAK;EACLC,UAAU,EAAE,CAAC,MAAM,CAAC;EACpBC,OAAO,EAAE,CAAC;AACZ,CAAC;AAMD,eAAeF,KAAKA,CAACG,IAAiB,EAA+B;EACnE,OAAOX,aAAa,CAACW,IAAI,CAAC;AAC5B"}
|
package/dist/dist.dev.js
CHANGED
|
@@ -4328,15 +4328,14 @@ var __exports__ = (() => {
|
|
|
4328
4328
|
var nodeVersion = matches && parseFloat(matches[1]) || 0;
|
|
4329
4329
|
|
|
4330
4330
|
// ../worker-utils/src/lib/env-utils/version.ts
|
|
4331
|
-
var NPM_TAG = "latest";
|
|
4332
4331
|
function getVersion() {
|
|
4333
4332
|
if (!globalThis._loadersgl_?.version) {
|
|
4334
4333
|
globalThis._loadersgl_ = globalThis._loadersgl_ || {};
|
|
4335
|
-
if (
|
|
4334
|
+
if (false) {
|
|
4336
4335
|
console.warn("loaders.gl: The __VERSION__ variable is not injected using babel plugin. Latest unstable workers would be fetched from the CDN.");
|
|
4337
4336
|
globalThis._loadersgl_.version = NPM_TAG;
|
|
4338
4337
|
} else {
|
|
4339
|
-
globalThis._loadersgl_.version =
|
|
4338
|
+
globalThis._loadersgl_.version = "4.0.6";
|
|
4340
4339
|
}
|
|
4341
4340
|
}
|
|
4342
4341
|
return globalThis._loadersgl_.version;
|
|
@@ -9109,7 +9108,7 @@ var __exports__ = (() => {
|
|
|
9109
9108
|
_defineProperty(Ellipsoid, "WGS84", new Ellipsoid(WGS84_RADIUS_X, WGS84_RADIUS_Y, WGS84_RADIUS_Z));
|
|
9110
9109
|
|
|
9111
9110
|
// ../images/src/lib/utils/version.ts
|
|
9112
|
-
var VERSION2 =
|
|
9111
|
+
var VERSION2 = true ? "4.0.6" : "latest";
|
|
9113
9112
|
|
|
9114
9113
|
// ../images/src/lib/category-api/image-type.ts
|
|
9115
9114
|
var parseImageNode = globalThis.loaders?.parseImageNode;
|
|
@@ -9498,7 +9497,7 @@ var __exports__ = (() => {
|
|
|
9498
9497
|
};
|
|
9499
9498
|
|
|
9500
9499
|
// ../draco/src/lib/utils/version.ts
|
|
9501
|
-
var VERSION3 =
|
|
9500
|
+
var VERSION3 = true ? "4.0.6" : "latest";
|
|
9502
9501
|
|
|
9503
9502
|
// ../draco/src/draco-loader.ts
|
|
9504
9503
|
var DEFAULT_DRACO_OPTIONS = {
|
|
@@ -10074,7 +10073,7 @@ var __exports__ = (() => {
|
|
|
10074
10073
|
}
|
|
10075
10074
|
|
|
10076
10075
|
// ../textures/src/lib/utils/version.ts
|
|
10077
|
-
var VERSION4 =
|
|
10076
|
+
var VERSION4 = true ? "4.0.6" : "latest";
|
|
10078
10077
|
|
|
10079
10078
|
// ../textures/src/lib/parsers/basis-module-loader.ts
|
|
10080
10079
|
var BASIS_EXTERNAL_LIBRARIES = {
|
|
@@ -11478,7 +11477,7 @@ var __exports__ = (() => {
|
|
|
11478
11477
|
}
|
|
11479
11478
|
|
|
11480
11479
|
// src/i3s-content-loader.ts
|
|
11481
|
-
var VERSION5 =
|
|
11480
|
+
var VERSION5 = true ? "4.0.6" : "latest";
|
|
11482
11481
|
var I3SContentLoader = {
|
|
11483
11482
|
name: "I3S Content (Indexed Scene Layers)",
|
|
11484
11483
|
id: "i3s-content",
|
|
@@ -11988,7 +11987,7 @@ var __exports__ = (() => {
|
|
|
11988
11987
|
var import_core16 = __toESM(require_core(), 1);
|
|
11989
11988
|
|
|
11990
11989
|
// src/i3s-node-page-loader.ts
|
|
11991
|
-
var VERSION6 =
|
|
11990
|
+
var VERSION6 = true ? "4.0.6" : "latest";
|
|
11992
11991
|
var I3SNodePageLoader = {
|
|
11993
11992
|
name: "I3S Node Page",
|
|
11994
11993
|
id: "i3s-node-page",
|
|
@@ -12278,7 +12277,7 @@ var __exports__ = (() => {
|
|
|
12278
12277
|
}
|
|
12279
12278
|
|
|
12280
12279
|
// src/i3s-loader.ts
|
|
12281
|
-
var VERSION7 =
|
|
12280
|
+
var VERSION7 = true ? "4.0.6" : "latest";
|
|
12282
12281
|
var TILESET_REGEX = /layers\/[0-9]+$/;
|
|
12283
12282
|
var TILE_HEADER_REGEX = /nodes\/([0-9-]+|root)$/;
|
|
12284
12283
|
var SLPK_HEX = "504b0304";
|
|
@@ -13373,7 +13372,7 @@ var __exports__ = (() => {
|
|
|
13373
13372
|
}
|
|
13374
13373
|
|
|
13375
13374
|
// src/i3s-slpk-loader.ts
|
|
13376
|
-
var VERSION8 =
|
|
13375
|
+
var VERSION8 = true ? "4.0.6" : "latest";
|
|
13377
13376
|
var SLPKLoader = {
|
|
13378
13377
|
name: "I3S SLPK (Scene Layer Package)",
|
|
13379
13378
|
id: "slpk",
|
|
@@ -13452,7 +13451,7 @@ var __exports__ = (() => {
|
|
|
13452
13451
|
}
|
|
13453
13452
|
|
|
13454
13453
|
// src/i3s-attribute-loader.ts
|
|
13455
|
-
var VERSION9 =
|
|
13454
|
+
var VERSION9 = true ? "4.0.6" : "latest";
|
|
13456
13455
|
var EMPTY_VALUE = "";
|
|
13457
13456
|
var REJECTED_STATUS = "rejected";
|
|
13458
13457
|
var I3SAttributeLoader = {
|
|
@@ -13605,7 +13604,7 @@ var __exports__ = (() => {
|
|
|
13605
13604
|
}
|
|
13606
13605
|
|
|
13607
13606
|
// src/i3s-building-scene-layer-loader.ts
|
|
13608
|
-
var VERSION10 =
|
|
13607
|
+
var VERSION10 = true ? "4.0.6" : "latest";
|
|
13609
13608
|
var I3SBuildingSceneLayerLoader = {
|
|
13610
13609
|
name: "I3S Building Scene Layer",
|
|
13611
13610
|
id: "i3s-building-scene-layer",
|
|
@@ -13693,7 +13692,7 @@ var __exports__ = (() => {
|
|
|
13693
13692
|
}
|
|
13694
13693
|
|
|
13695
13694
|
// src/arcgis-webscene-loader.ts
|
|
13696
|
-
var VERSION11 =
|
|
13695
|
+
var VERSION11 = true ? "4.0.6" : "latest";
|
|
13697
13696
|
var ArcGISWebSceneLoader = {
|
|
13698
13697
|
name: "ArcGIS Web Scene Loader",
|
|
13699
13698
|
id: "arcgis-web-scene",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { load } from '@loaders.gl/core';
|
|
2
2
|
import { parseI3STileAttribute } from "./lib/parsers/parse-i3s-attribute.js";
|
|
3
3
|
import { getUrlWithToken } from "./lib/utils/url-utils.js";
|
|
4
|
-
const VERSION = typeof
|
|
4
|
+
const VERSION = typeof "4.0.6" !== 'undefined' ? "4.0.6" : 'latest';
|
|
5
5
|
const EMPTY_VALUE = '';
|
|
6
6
|
const REJECTED_STATUS = 'rejected';
|
|
7
7
|
export const I3SAttributeLoader = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i3s-attribute-loader.js","names":["load","parseI3STileAttribute","getUrlWithToken","VERSION","__VERSION__","EMPTY_VALUE","REJECTED_STATUS","I3SAttributeLoader","name","id","module","version","mimeTypes","parse","arrayBuffer","options","extensions","binary","loadFeatureAttributes","tile","featureId","arguments","length","undefined","attributeStorageInfo","attributeUrls","tilesetFields","getAttributesData","attributes","attributeLoadPromises","index","_options$i3s","url","i3s","token","attributeName","attributeType","getAttributeValueType","loadOptions","promise","push","Promise","allSettled","error","generateAttributesByFeatureId","_tile$tileset","_tile$tileset$tileset","_tile$header","_tile$tileset2","_tile$tileset2$tilese","tileset","header","fields","attribute","hasOwnProperty","attributeValues","valueType","getFeatureIdsAttributeName","objectIdsAttribute","find","includes","objectIdsAttributeName","objectIds","value","attributeIndex","indexOf","getFeatureAttributesByIndex","featureIdIndex","attributesObject","codedValues","getAttributeCodedValues","getAttributeByIndexAndAttributeName","formatAttributeValue","_attributeField$domai","attributeField","field","alias","domain","attributesName","attributeObject","status","String","replace","trim","codeValue","codedValue","code","Number"],"sources":["../src/i3s-attribute-loader.ts"],"sourcesContent":["import type {LoaderOptions, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {load} from '@loaders.gl/core';\nimport type {I3SLoaderOptions} from './i3s-loader';\nimport type {I3STileAttributes} from './lib/parsers/parse-i3s-attribute';\nimport {parseI3STileAttribute} from './lib/parsers/parse-i3s-attribute';\nimport {getUrlWithToken} from './lib/utils/url-utils';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\nconst EMPTY_VALUE = '';\nconst REJECTED_STATUS = 'rejected';\n\n/**\n * Loader for I3S attributes\n */\nexport const I3SAttributeLoader: LoaderWithParser<I3STileAttributes, never, I3SLoaderOptions> = {\n name: 'I3S Attribute',\n id: 'i3s-attribute',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/binary'],\n parse: async (arrayBuffer: ArrayBuffer, options?: LoaderOptions) => parseI3STileAttribute(arrayBuffer, options),\n extensions: ['bin'],\n options: {},\n binary: true\n};\n\n\n// TODO - these seem to use the loader rather than being part of the loader. Move to different file...\n\n/**\n * Load attributes based on feature id\n * @param {Object} tile\n * @param {number} featureId\n * @param {Object} options\n * @returns {Promise}\n */\n// eslint-disable-next-line complexity\nexport async function loadFeatureAttributes(tile, featureId, options = {}) {\n const {attributeStorageInfo, attributeUrls, tilesetFields} = getAttributesData(tile);\n\n if (!attributeStorageInfo || !attributeUrls || featureId < 0) {\n return null;\n }\n\n let attributes: object[] = [];\n const attributeLoadPromises: Promise<object>[] = [];\n\n for (let index = 0; index < attributeStorageInfo.length; index++) {\n // @ts-ignore\n const url = getUrlWithToken(attributeUrls[index], options.i3s?.token);\n const attributeName = attributeStorageInfo[index].name;\n const attributeType = getAttributeValueType(attributeStorageInfo[index]);\n const loadOptions = {...options, attributeName, attributeType};\n const promise = load(url, I3SAttributeLoader, loadOptions);\n\n attributeLoadPromises.push(promise);\n }\n try {\n attributes = await Promise.allSettled(attributeLoadPromises);\n } catch (error) {\n // do nothing\n }\n\n if (!attributes.length) {\n return null;\n }\n\n return generateAttributesByFeatureId(attributes, attributeStorageInfo, featureId, tilesetFields);\n}\n\n/**\n * Gets attributes data from tile.\n * @param tile \n * @returns \n */\nfunction getAttributesData(tile) {\n const attributeStorageInfo = tile.tileset?.tileset?.attributeStorageInfo;\n const attributeUrls = tile.header?.attributeUrls;\n const tilesetFields = tile.tileset?.tileset?.fields || [];\n\n return {attributeStorageInfo, attributeUrls, tilesetFields};\n}\n\n/**\n * Get attribute value type based on property names\n * @param {Object} attribute\n * @returns {String}\n */\nexport function getAttributeValueType(attribute) {\n if (attribute.hasOwnProperty('objectIds')) {\n return 'Oid32';\n } else if (attribute.hasOwnProperty('attributeValues')) {\n return attribute.attributeValues.valueType;\n }\n return '';\n}\n\n/**\n * Find in attributeStorageInfo attribute name responsible for feature ids list.\n * @param attributeStorageInfo \n * @returns Feature ids attribute name\n */\nfunction getFeatureIdsAttributeName(attributeStorageInfo) {\n const objectIdsAttribute = attributeStorageInfo.find(attribute => attribute.name.includes('OBJECTID'));\n\n return objectIdsAttribute?.name;\n}\n\n/**\n * Generates mapping featureId to feature attributes\n * @param {Array} attributes\n * @param {Object} attributeStorageInfo\n * @param {number} featureId\n * @returns {Object}\n */\nfunction generateAttributesByFeatureId(attributes, attributeStorageInfo, featureId, tilesetFields) {\n const objectIdsAttributeName = getFeatureIdsAttributeName(attributeStorageInfo);\n const objectIds = attributes.find((attribute) => attribute.value[objectIdsAttributeName]);\n\n if (!objectIds) {\n return null;\n }\n\n const attributeIndex = objectIds.value[objectIdsAttributeName].indexOf(featureId);\n\n if (attributeIndex < 0) {\n return null;\n }\n\n return getFeatureAttributesByIndex(attributes, attributeIndex, attributeStorageInfo, tilesetFields);\n}\n\n/**\n * Generates attribute object for feature mapping by feature id\n * @param {Array} attributes\n * @param {Number} featureIdIndex\n * @param {Object} attributeStorageInfo\n * @returns {Object}\n */\nfunction getFeatureAttributesByIndex(attributes, featureIdIndex, attributeStorageInfo, tilesetFields) {\n const attributesObject = {};\n\n for (let index = 0; index < attributeStorageInfo.length; index++) {\n const attributeName = attributeStorageInfo[index].name;\n const codedValues = getAttributeCodedValues(attributeName, tilesetFields);\n const attribute = getAttributeByIndexAndAttributeName(attributes, index, attributeName);\n attributesObject[attributeName] = formatAttributeValue(attribute, featureIdIndex, codedValues);\n }\n\n return attributesObject;\n}\n\n/**\n * Get coded values list from tileset.\n * @param attributeName \n * @param tilesetFields \n */\nfunction getAttributeCodedValues(attributeName, tilesetFields) {\n const attributeField = tilesetFields\n .find(field => field.name === attributeName || field.alias === attributeName);\n\n return attributeField?.domain?.codedValues || [];\n}\n\n/**\n * Return attribute value if it presents in atrributes list\n * @param {array} attributes\n * @param {number} index\n * @param {string} attributesName\n */\nfunction getAttributeByIndexAndAttributeName(attributes, index, attributesName) {\n const attributeObject = attributes[index];\n\n if (attributeObject.status === REJECTED_STATUS) {\n return null;\n }\n\n return attributeObject.value[attributesName];\n}\n\n/**\n * Do formatting of attribute values or return empty string.\n * @param {Array} attribute\n * @param {Number} featureIdIndex\n * @returns {String}\n */\nfunction formatAttributeValue(attribute, featureIdIndex, codedValues) {\n let value = EMPTY_VALUE;\n\n if (attribute && (featureIdIndex in attribute)) {\n // eslint-disable-next-line no-control-regex\n value = String(attribute[featureIdIndex]).replace(/\\u0000|NaN/g, '').trim();\n }\n\n // Check if coded values are existed. If so we use them.\n if (codedValues.length) {\n const codeValue = codedValues.find(codedValue => codedValue.code === Number(value));\n value = codeValue?.name || EMPTY_VALUE;\n }\n\n return value;\n}\n"],"mappings":"AACA,SAAQA,IAAI,QAAO,kBAAkB;AAAC,SAG9BC,qBAAqB;AAAA,SACrBC,eAAe;AAIvB,MAAMC,OAAO,GAAG,OAAOC,WAAW,KAAK,WAAW,GAAGA,WAAW,GAAG,QAAQ;AAC3E,MAAMC,WAAW,GAAG,EAAE;AACtB,MAAMC,eAAe,GAAG,UAAU;AAKlC,OAAO,MAAMC,kBAAgF,GAAG;EAC9FC,IAAI,EAAE,eAAe;EACrBC,EAAE,EAAE,eAAe;EACnBC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAER,OAAO;EAChBS,SAAS,EAAE,CAAC,oBAAoB,CAAC;EACjCC,KAAK,EAAE,MAAAA,CAAOC,WAAwB,EAAEC,OAAuB,KAAKd,qBAAqB,CAACa,WAAW,EAAEC,OAAO,CAAC;EAC/GC,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBD,OAAO,EAAE,CAAC,CAAC;EACXE,MAAM,EAAE;AACV,CAAC;AAaD,OAAO,eAAeC,qBAAqBA,CAACC,IAAI,EAAEC,SAAS,EAAgB;EAAA,IAAdL,OAAO,GAAAM,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EACvE,MAAM;IAACG,oBAAoB;IAAEC,aAAa;IAAEC;EAAa,CAAC,GAAGC,iBAAiB,CAACR,IAAI,CAAC;EAEpF,I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qBAAA,uBAAtBA,qBAAA,CAAwBJ,WAAW,KAAI,EAAE;AAClD;AAQA,SAASE,mCAAmCA,CAAC3C,UAAU,EAAEE,KAAK,EAAEgD,cAAc,EAAE;EAC9E,MAAMC,eAAe,GAAGnD,UAAU,CAACE,KAAK,CAAC;EAEzC,IAAIiD,eAAe,CAACC,MAAM,KAAK1E,eAAe,EAAE;IAC9C,OAAO,IAAI;EACb;EAEA,OAAOyE,eAAe,CAAChB,KAAK,CAACe,cAAc,CAAC;AAC9C;AAQA,SAASN,oBAAoBA,CAACnB,SAAS,EAAEc,cAAc,EAAEE,WAAW,EAAE;EACpE,IAAIN,KAAK,GAAG1D,WAAW;EAEvB,IAAIgD,SAAS,IAAKc,cAAc,IAAId,SAAU,EAAE;IAE9CU,KAAK,GAAGkB,MAAM,CAAC5B,SAAS,CAACc,cAAc,CAAC,CAAC,CAACe,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAACC,IAAI,CAAC,CAAC;EAC7E;EAGA,IAAId,WAAW,CAAC/C,MAAM,EAAE;IACtB,MAAM8D,SAAS,GAAGf,WAAW,CAACV,IAAI,CAAC0B,UAAU,IAAIA,UAAU,CAACC,IAAI,KAAKC,MAAM,CAACxB,KAAK,CAAC,CAAC;IACnFA,KAAK,GAAG,CAAAqB,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAE5E,IAAI,KAAIH,WAAW;EACxC;EAEA,OAAO0D,KAAK;AACd"}
|
|
1
|
+
{"version":3,"file":"i3s-attribute-loader.js","names":["load","parseI3STileAttribute","getUrlWithToken","VERSION","EMPTY_VALUE","REJECTED_STATUS","I3SAttributeLoader","name","id","module","version","mimeTypes","parse","arrayBuffer","options","extensions","binary","loadFeatureAttributes","tile","featureId","arguments","length","undefined","attributeStorageInfo","attributeUrls","tilesetFields","getAttributesData","attributes","attributeLoadPromises","index","_options$i3s","url","i3s","token","attributeName","attributeType","getAttributeValueType","loadOptions","promise","push","Promise","allSettled","error","generateAttributesByFeatureId","_tile$tileset","_tile$tileset$tileset","_tile$header","_tile$tileset2","_tile$tileset2$tilese","tileset","header","fields","attribute","hasOwnProperty","attributeValues","valueType","getFeatureIdsAttributeName","objectIdsAttribute","find","includes","objectIdsAttributeName","objectIds","value","attributeIndex","indexOf","getFeatureAttributesByIndex","featureIdIndex","attributesObject","codedValues","getAttributeCodedValues","getAttributeByIndexAndAttributeName","formatAttributeValue","_attributeField$domai","attributeField","field","alias","domain","attributesName","attributeObject","status","String","replace","trim","codeValue","codedValue","code","Number"],"sources":["../src/i3s-attribute-loader.ts"],"sourcesContent":["import type {LoaderOptions, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {load} from '@loaders.gl/core';\nimport type {I3SLoaderOptions} from './i3s-loader';\nimport type {I3STileAttributes} from './lib/parsers/parse-i3s-attribute';\nimport {parseI3STileAttribute} from './lib/parsers/parse-i3s-attribute';\nimport {getUrlWithToken} from './lib/utils/url-utils';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\nconst EMPTY_VALUE = '';\nconst REJECTED_STATUS = 'rejected';\n\n/**\n * Loader for I3S attributes\n */\nexport const I3SAttributeLoader: LoaderWithParser<I3STileAttributes, never, I3SLoaderOptions> = {\n name: 'I3S Attribute',\n id: 'i3s-attribute',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/binary'],\n parse: async (arrayBuffer: ArrayBuffer, options?: LoaderOptions) => parseI3STileAttribute(arrayBuffer, options),\n extensions: ['bin'],\n options: {},\n binary: true\n};\n\n\n// TODO - these seem to use the loader rather than being part of the loader. Move to different file...\n\n/**\n * Load attributes based on feature id\n * @param {Object} tile\n * @param {number} featureId\n * @param {Object} options\n * @returns {Promise}\n */\n// eslint-disable-next-line complexity\nexport async function loadFeatureAttributes(tile, featureId, options = {}) {\n const {attributeStorageInfo, attributeUrls, tilesetFields} = getAttributesData(tile);\n\n if (!attributeStorageInfo || !attributeUrls || featureId < 0) {\n return null;\n }\n\n let attributes: object[] = [];\n const attributeLoadPromises: Promise<object>[] = [];\n\n for (let index = 0; index < attributeStorageInfo.length; index++) {\n // @ts-ignore\n const url = getUrlWithToken(attributeUrls[index], options.i3s?.token);\n const attributeName = attributeStorageInfo[index].name;\n const attributeType = getAttributeValueType(attributeStorageInfo[index]);\n const loadOptions = {...options, attributeName, attributeType};\n const promise = load(url, I3SAttributeLoader, loadOptions);\n\n attributeLoadPromises.push(promise);\n }\n try {\n attributes = await Promise.allSettled(attributeLoadPromises);\n } catch (error) {\n // do nothing\n }\n\n if (!attributes.length) {\n return null;\n }\n\n return generateAttributesByFeatureId(attributes, attributeStorageInfo, featureId, tilesetFields);\n}\n\n/**\n * Gets attributes data from tile.\n * @param tile \n * @returns \n */\nfunction getAttributesData(tile) {\n const attributeStorageInfo = tile.tileset?.tileset?.attributeStorageInfo;\n const attributeUrls = tile.header?.attributeUrls;\n const tilesetFields = tile.tileset?.tileset?.fields || [];\n\n return {attributeStorageInfo, attributeUrls, tilesetFields};\n}\n\n/**\n * Get attribute value type based on property names\n * @param {Object} attribute\n * @returns {String}\n */\nexport function getAttributeValueType(attribute) {\n if (attribute.hasOwnProperty('objectIds')) {\n return 'Oid32';\n } else if (attribute.hasOwnProperty('attributeValues')) {\n return attribute.attributeValues.valueType;\n }\n return '';\n}\n\n/**\n * Find in attributeStorageInfo attribute name responsible for feature ids list.\n * @param attributeStorageInfo \n * @returns Feature ids attribute name\n */\nfunction getFeatureIdsAttributeName(attributeStorageInfo) {\n const objectIdsAttribute = attributeStorageInfo.find(attribute => attribute.name.includes('OBJECTID'));\n\n return objectIdsAttribute?.name;\n}\n\n/**\n * Generates mapping featureId to feature attributes\n * @param {Array} attributes\n * @param {Object} attributeStorageInfo\n * @param {number} featureId\n * @returns {Object}\n */\nfunction generateAttributesByFeatureId(attributes, attributeStorageInfo, featureId, tilesetFields) {\n const objectIdsAttributeName = getFeatureIdsAttributeName(attributeStorageInfo);\n const objectIds = attributes.find((attribute) => attribute.value[objectIdsAttributeName]);\n\n if (!objectIds) {\n return null;\n }\n\n const attributeIndex = objectIds.value[objectIdsAttributeName].indexOf(featureId);\n\n if (attributeIndex < 0) {\n return null;\n }\n\n return getFeatureAttributesByIndex(attributes, attributeIndex, attributeStorageInfo, tilesetFields);\n}\n\n/**\n * Generates attribute object for feature mapping by feature id\n * @param {Array} attributes\n * @param {Number} featureIdIndex\n * @param {Object} attributeStorageInfo\n * @returns {Object}\n */\nfunction getFeatureAttributesByIndex(attributes, featureIdIndex, attributeStorageInfo, tilesetFields) {\n const attributesObject = {};\n\n for (let index = 0; index < attributeStorageInfo.length; index++) {\n const attributeName = attributeStorageInfo[index].name;\n const codedValues = getAttributeCodedValues(attributeName, tilesetFields);\n const attribute = getAttributeByIndexAndAttributeName(attributes, index, attributeName);\n attributesObject[attributeName] = formatAttributeValue(attribute, featureIdIndex, codedValues);\n }\n\n return attributesObject;\n}\n\n/**\n * Get coded values list from tileset.\n * @param attributeName \n * @param tilesetFields \n */\nfunction getAttributeCodedValues(attributeName, tilesetFields) {\n const attributeField = tilesetFields\n .find(field => field.name === attributeName || field.alias === attributeName);\n\n return attributeField?.domain?.codedValues || [];\n}\n\n/**\n * Return attribute value if it presents in atrributes list\n * @param {array} attributes\n * @param {number} index\n * @param {string} attributesName\n */\nfunction getAttributeByIndexAndAttributeName(attributes, index, attributesName) {\n const attributeObject = attributes[index];\n\n if (attributeObject.status === REJECTED_STATUS) {\n return null;\n }\n\n return attributeObject.value[attributesName];\n}\n\n/**\n * Do formatting of attribute values or return empty string.\n * @param {Array} attribute\n * @param {Number} featureIdIndex\n * @returns {String}\n */\nfunction formatAttributeValue(attribute, featureIdIndex, codedValues) {\n let value = EMPTY_VALUE;\n\n if (attribute && (featureIdIndex in attribute)) {\n // eslint-disable-next-line no-control-regex\n value = String(attribute[featureIdIndex]).replace(/\\u0000|NaN/g, '').trim();\n }\n\n // Check if coded values are existed. If so we use them.\n if (codedValues.length) {\n const codeValue = codedValues.find(codedValue => codedValue.code === Number(value));\n value = codeValue?.name || EMPTY_VALUE;\n }\n\n return value;\n}\n"],"mappings":"AACA,SAAQA,IAAI,QAAO,kBAAkB;AAAC,SAG9BC,qBAAqB;AAAA,SACrBC,eAAe;AAIvB,MAAMC,OAAO,GAAG,cAAkB,KAAK,WAAW,aAAiB,QAAQ;AAC3E,MAAMC,WAAW,GAAG,EAAE;AACtB,MAAMC,eAAe,GAAG,UAAU;AAKlC,OAAO,MAAMC,kBAAgF,GAAG;EAC9FC,IAAI,EAAE,eAAe;EACrBC,EAAE,EAAE,eAAe;EACnBC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEP,OAAO;EAChBQ,SAAS,EAAE,CAAC,oBAAoB,CAAC;EACjCC,KAAK,EAAE,MAAAA,CAAOC,WAAwB,EAAEC,OAAuB,KAAKb,qBAAqB,CAACY,WAAW,EAAEC,OAAO,CAAC;EAC/GC,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBD,OAAO,EAAE,CAAC,CAAC;EACXE,MAAM,EAAE;AACV,CAAC;AAaD,OAAO,eAAeC,qBAAqBA,CAACC,IAAI,EAAEC,SAAS,EAAgB;EAAA,IAAdL,OAAO,GAAAM,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EACvE,MAAM;IAACG,oBAAoB;IAAEC,aAAa;IAAEC;EAAa,CAAC,GAAGC,iBAAiB,CAACR,IAAI,CAAC;EAEpF,IAAI,CAACK,oBAAoB,IAAI,CAACC,aAAa,IAAIL,SAAS,GAAG,CAAC,EAAE;IAC5D,OAAO,IAAI;EACb;EAEA,IAAIQ,UAAoB,GAAG,EAAE;EAC7B,MAAMC,qBAAwC,GAAG,EAAE;EAEnD,KAAK,IAAIC,KAAK,GAAG,CAAC,EAAEA,KAAK,GAAGN,oBAAoB,CAACF,MAAM,EAAEQ,KAAK,EAAE,EAAE;IAAA,IAAAC,YA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AChB,KAAK,CAACe,cAAc,CAAC;AAC9C;AAQA,SAASN,oBAAoBA,CAACnB,SAAS,EAAEc,cAAc,EAAEE,WAAW,EAAE;EACpE,IAAIN,KAAK,GAAG1D,WAAW;EAEvB,IAAIgD,SAAS,IAAKc,cAAc,IAAId,SAAU,EAAE;IAE9CU,KAAK,GAAGkB,MAAM,CAAC5B,SAAS,CAACc,cAAc,CAAC,CAAC,CAACe,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAACC,IAAI,CAAC,CAAC;EAC7E;EAGA,IAAId,WAAW,CAAC/C,MAAM,EAAE;IACtB,MAAM8D,SAAS,GAAGf,WAAW,CAACV,IAAI,CAAC0B,UAAU,IAAIA,UAAU,CAACC,IAAI,KAAKC,MAAM,CAACxB,KAAK,CAAC,CAAC;IACnFA,KAAK,GAAG,CAAAqB,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAE5E,IAAI,KAAIH,WAAW;EACxC;EAEA,OAAO0D,KAAK;AACd"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseBuildingSceneLayer } from "./lib/parsers/parse-i3s-building-scene-layer.js";
|
|
2
|
-
const VERSION = typeof
|
|
2
|
+
const VERSION = typeof "4.0.6" !== 'undefined' ? "4.0.6" : 'latest';
|
|
3
3
|
export const I3SBuildingSceneLayerLoader = {
|
|
4
4
|
name: 'I3S Building Scene Layer',
|
|
5
5
|
id: 'i3s-building-scene-layer',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i3s-building-scene-layer-loader.js","names":["parseBuildingSceneLayer","VERSION","
|
|
1
|
+
{"version":3,"file":"i3s-building-scene-layer-loader.js","names":["parseBuildingSceneLayer","VERSION","I3SBuildingSceneLayerLoader","name","id","module","version","mimeTypes","parse","extensions","options","data","context","url","Error"],"sources":["../src/i3s-building-scene-layer-loader.ts"],"sourcesContent":["import type {LoaderWithParser, LoaderOptions, LoaderContext} from '@loaders.gl/loader-utils';\nimport type {I3SLoaderOptions} from './i3s-loader';\nimport type {BuildingSceneLayerTileset} from './types';\n\nimport {parseBuildingSceneLayer} from './lib/parsers/parse-i3s-building-scene-layer';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\n\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n/**\n * Loader for I3S - Building Scene Layer\n */\nexport const I3SBuildingSceneLayerLoader: LoaderWithParser<\n BuildingSceneLayerTileset,\n never,\n I3SLoaderOptions\n> = {\n name: 'I3S Building Scene Layer',\n id: 'i3s-building-scene-layer',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/json'],\n parse,\n extensions: ['json'],\n options: {}\n};\n\nasync function parse(\n data: ArrayBuffer,\n options?: LoaderOptions,\n context?: LoaderContext\n): Promise<BuildingSceneLayerTileset> {\n if (!context?.url) {\n throw new Error('Url is not provided');\n }\n\n return parseBuildingSceneLayer(data, context.url);\n}\n"],"mappings":"SAIQA,uBAAuB;AAK/B,MAAMC,OAAO,GAAG,cAAkB,KAAK,WAAW,aAAiB,QAAQ;AAI3E,OAAO,MAAMC,2BAIZ,GAAG;EACFC,IAAI,EAAE,0BAA0B;EAChCC,EAAE,EAAE,0BAA0B;EAC9BC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEL,OAAO;EAChBM,SAAS,EAAE,CAAC,kBAAkB,CAAC;EAC/BC,KAAK;EACLC,UAAU,EAAE,CAAC,MAAM,CAAC;EACpBC,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,eAAeF,KAAKA,CAClBG,IAAiB,EACjBD,OAAuB,EACvBE,OAAuB,EACa;EACpC,IAAI,EAACA,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEC,GAAG,GAAE;IACjB,MAAM,IAAIC,KAAK,CAAC,qBAAqB,CAAC;EACxC;EAEA,OAAOd,uBAAuB,CAACW,IAAI,EAAEC,OAAO,CAACC,GAAG,CAAC;AACnD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseI3STileContent } from "./lib/parsers/parse-i3s-tile-content.js";
|
|
2
|
-
const VERSION = typeof
|
|
2
|
+
const VERSION = typeof "4.0.6" !== 'undefined' ? "4.0.6" : 'latest';
|
|
3
3
|
export const I3SContentLoader = {
|
|
4
4
|
name: 'I3S Content (Indexed Scene Layers)',
|
|
5
5
|
id: 'i3s-content',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i3s-content-loader.js","names":["parseI3STileContent","VERSION","
|
|
1
|
+
{"version":3,"file":"i3s-content-loader.js","names":["parseI3STileContent","VERSION","I3SContentLoader","name","id","module","worker","version","mimeTypes","parse","extensions","options","data","context","tile","_tileOptions","tileset","_tilesetOptions","i3s","tileOptions","tilesetOptions"],"sources":["../src/i3s-content-loader.ts"],"sourcesContent":["import type {LoaderWithParser, LoaderContext} from '@loaders.gl/loader-utils';\nimport type {I3SLoaderOptions} from './i3s-loader';\nimport {parseI3STileContent} from './lib/parsers/parse-i3s-tile-content';\nimport {I3STileContent, I3STileOptions, I3STilesetOptions} from './types';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\n\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/**\n * Loader for I3S - Indexed 3D Scene Layer\n */\nexport const I3SContentLoader: LoaderWithParser<I3STileContent | null, never, I3SLoaderOptions> = {\n name: 'I3S Content (Indexed Scene Layers)',\n id: 'i3s-content',\n module: 'i3s',\n worker: true,\n version: VERSION,\n mimeTypes: ['application/octet-stream'],\n parse,\n extensions: ['bin'],\n options: {\n 'i3s-content': {}\n }\n};\n\nasync function parse(data, options?: I3SLoaderOptions, context?: LoaderContext) {\n const {tile, _tileOptions, tileset, _tilesetOptions} = options?.i3s || {};\n const tileOptions = _tileOptions || tile;\n const tilesetOptions = _tilesetOptions || tileset;\n if (!tileOptions || !tilesetOptions) {\n return null;\n }\n return await parseI3STileContent(\n data,\n tileOptions as I3STileOptions,\n tilesetOptions as I3STilesetOptions,\n options,\n context\n );\n}\n"],"mappings":"SAEQA,mBAAmB;AAM3B,MAAMC,OAAO,GAAG,cAAkB,KAAK,WAAW,aAAiB,QAAQ;AAK3E,OAAO,MAAMC,gBAAkF,GAAG;EAChGC,IAAI,EAAE,oCAAoC;EAC1CC,EAAE,EAAE,aAAa;EACjBC,MAAM,EAAE,KAAK;EACbC,MAAM,EAAE,IAAI;EACZC,OAAO,EAAEN,OAAO;EAChBO,SAAS,EAAE,CAAC,0BAA0B,CAAC;EACvCC,KAAK;EACLC,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBC,OAAO,EAAE;IACP,aAAa,EAAE,CAAC;EAClB;AACF,CAAC;AAED,eAAeF,KAAKA,CAACG,IAAI,EAAED,OAA0B,EAAEE,OAAuB,EAAE;EAC9E,MAAM;IAACC,IAAI;IAAEC,YAAY;IAAEC,OAAO;IAAEC;EAAe,CAAC,GAAG,CAAAN,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEO,GAAG,KAAI,CAAC,CAAC;EACzE,MAAMC,WAAW,GAAGJ,YAAY,IAAID,IAAI;EACxC,MAAMM,cAAc,GAAGH,eAAe,IAAID,OAAO;EACjD,IAAI,CAACG,WAAW,IAAI,CAACC,cAAc,EAAE;IACnC,OAAO,IAAI;EACb;EACA,OAAO,MAAMpB,mBAAmB,CAC9BY,IAAI,EACJO,WAAW,EACXC,cAAc,EACdT,OAAO,EACPE,OACF,CAAC;AACH"}
|