UNPKG

@deck.gl/geo-layers

Version:

deck.gl layers supporting geospatial use cases and GIS formats

1,208 lines (974 loc) 2.5 MB
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("deck"), require("luma"), require("h3")); else if(typeof define === 'function' && define.amd) define(["deck", "luma", "h3"], factory); else if(typeof exports === 'object') exports["deck"] = factory(require("deck"), require("luma"), require("h3")); else root["deck"] = factory(root["deck"], root["luma"], root["h3"]); })(window, function(__WEBPACK_EXTERNAL_MODULE__deck_gl_layers__, __WEBPACK_EXTERNAL_MODULE__luma_gl_core__, __WEBPACK_EXTERNAL_MODULE_h3_js__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = "./bundle.ts"); /******/ }) /************************************************************************/ /******/ ({ /***/ "../../node_modules/@babel/runtime/helpers/esm/defineProperty.js": /*!*********************************************************************************************!*\ !*** /Users/missx/Source/deck.gl/node_modules/@babel/runtime/helpers/esm/defineProperty.js ***! \*********************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _defineProperty; }); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /***/ }), /***/ "../../node_modules/@babel/runtime/helpers/interopRequireDefault.js": /*!************************************************************************************************!*\ !*** /Users/missx/Source/deck.gl/node_modules/@babel/runtime/helpers/interopRequireDefault.js ***! \************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } module.exports = _interopRequireDefault; /***/ }), /***/ "../../node_modules/@babel/runtime/helpers/typeof.js": /*!*********************************************************************************!*\ !*** /Users/missx/Source/deck.gl/node_modules/@babel/runtime/helpers/typeof.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { module.exports = _typeof = function _typeof(obj) { return typeof obj; }; } else { module.exports = _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } module.exports = _typeof; /***/ }), /***/ "../../node_modules/@loaders.gl/3d-tiles/dist/esm/cesium-ion-loader.js": /*!***************************************************************************************************!*\ !*** /Users/missx/Source/deck.gl/node_modules/@loaders.gl/3d-tiles/dist/esm/cesium-ion-loader.js ***! \***************************************************************************************************/ /*! exports provided: CesiumIonLoader */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CesiumIonLoader", function() { return CesiumIonLoader; }); /* harmony import */ var _tiles_3d_loader__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./tiles-3d-loader */ "../../node_modules/@loaders.gl/3d-tiles/dist/esm/tiles-3d-loader.js"); /* harmony import */ var _lib_ion_ion__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/ion/ion */ "../../node_modules/@loaders.gl/3d-tiles/dist/esm/lib/ion/ion.js"); async function preload(url, options = {}) { options = options['cesium-ion'] || {}; const { accessToken } = options; let assetId = options.assetId; if (!Number.isFinite(assetId)) { const matched = url.match(/\/([0-9]+)\/tileset.json/); assetId = matched && matched[1]; } return Object(_lib_ion_ion__WEBPACK_IMPORTED_MODULE_1__["getIonTilesetMetadata"])(accessToken, assetId); } const CesiumIonLoader = { ..._tiles_3d_loader__WEBPACK_IMPORTED_MODULE_0__["Tiles3DLoader"], id: 'cesium-ion', name: 'Cesium Ion', preload, parse: async (data, options, context) => { options = { ...options }; options['3d-tiles'] = options['cesium-ion']; options.loader = CesiumIonLoader; return _tiles_3d_loader__WEBPACK_IMPORTED_MODULE_0__["Tiles3DLoader"].parse(data, options, context); }, options: { 'cesium-ion': { ..._tiles_3d_loader__WEBPACK_IMPORTED_MODULE_0__["Tiles3DLoader"].options['3d-tiles'], accessToken: null } } }; //# sourceMappingURL=cesium-ion-loader.js.map /***/ }), /***/ "../../node_modules/@loaders.gl/3d-tiles/dist/esm/index.js": /*!***************************************************************************************!*\ !*** /Users/missx/Source/deck.gl/node_modules/@loaders.gl/3d-tiles/dist/esm/index.js ***! \***************************************************************************************/ /*! exports provided: Tiles3DLoader, CesiumIonLoader, Tile3DSubtreeLoader, Tile3DWriter, Tile3DFeatureTable, Tile3DBatchTable, TILE3D_TYPE, _getIonTilesetMetadata */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _tiles_3d_loader__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./tiles-3d-loader */ "../../node_modules/@loaders.gl/3d-tiles/dist/esm/tiles-3d-loader.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Tiles3DLoader", function() { return _tiles_3d_loader__WEBPACK_IMPORTED_MODULE_0__["Tiles3DLoader"]; }); /* harmony import */ var _cesium_ion_loader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./cesium-ion-loader */ "../../node_modules/@loaders.gl/3d-tiles/dist/esm/cesium-ion-loader.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CesiumIonLoader", function() { return _cesium_ion_loader__WEBPACK_IMPORTED_MODULE_1__["CesiumIonLoader"]; }); /* harmony import */ var _tile_3d_subtree_loader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tile-3d-subtree-loader */ "../../node_modules/@loaders.gl/3d-tiles/dist/esm/tile-3d-subtree-loader.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Tile3DSubtreeLoader", function() { return _tile_3d_subtree_loader__WEBPACK_IMPORTED_MODULE_2__["Tile3DSubtreeLoader"]; }); /* harmony import */ var _tile_3d_writer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./tile-3d-writer */ "../../node_modules/@loaders.gl/3d-tiles/dist/esm/tile-3d-writer.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Tile3DWriter", function() { return _tile_3d_writer__WEBPACK_IMPORTED_MODULE_3__["Tile3DWriter"]; }); /* harmony import */ var _lib_classes_tile_3d_feature_table__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lib/classes/tile-3d-feature-table */ "../../node_modules/@loaders.gl/3d-tiles/dist/esm/lib/classes/tile-3d-feature-table.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Tile3DFeatureTable", function() { return _lib_classes_tile_3d_feature_table__WEBPACK_IMPORTED_MODULE_4__["default"]; }); /* harmony import */ var _lib_classes_tile_3d_batch_table__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./lib/classes/tile-3d-batch-table */ "../../node_modules/@loaders.gl/3d-tiles/dist/esm/lib/classes/tile-3d-batch-table.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Tile3DBatchTable", function() { return _lib_classes_tile_3d_batch_table__WEBPACK_IMPORTED_MODULE_5__["default"]; }); /* harmony import */ var _lib_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./lib/constants */ "../../node_modules/@loaders.gl/3d-tiles/dist/esm/lib/constants.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TILE3D_TYPE", function() { return _lib_constants__WEBPACK_IMPORTED_MODULE_6__["TILE3D_TYPE"]; }); /* harmony import */ var _lib_ion_ion__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./lib/ion/ion */ "../../node_modules/@loaders.gl/3d-tiles/dist/esm/lib/ion/ion.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_getIonTilesetMetadata", function() { return _lib_ion_ion__WEBPACK_IMPORTED_MODULE_7__["getIonTilesetMetadata"]; }); //# sourceMappingURL=index.js.map /***/ }), /***/ "../../node_modules/@loaders.gl/3d-tiles/dist/esm/lib/classes/helpers/tile-3d-accessor-utils.js": /*!****************************************************************************************************************************!*\ !*** /Users/missx/Source/deck.gl/node_modules/@loaders.gl/3d-tiles/dist/esm/lib/classes/helpers/tile-3d-accessor-utils.js ***! \****************************************************************************************************************************/ /*! exports provided: createTypedArrayFromAccessor */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createTypedArrayFromAccessor", function() { return createTypedArrayFromAccessor; }); /* harmony import */ var _loaders_gl_math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @loaders.gl/math */ "../../node_modules/@loaders.gl/math/dist/esm/index.js"); /* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @loaders.gl/loader-utils */ "../../node_modules/@loaders.gl/loader-utils/dist/esm/index.js"); const COMPONENTS_PER_ATTRIBUTE = { SCALAR: 1, VEC2: 2, VEC3: 3, VEC4: 4, MAT2: 4, MAT3: 9, MAT4: 16 }; const UNPACKER = { SCALAR: (values, i) => values[i], VEC2: (values, i) => [values[2 * i + 0], values[2 * i + 1]], VEC3: (values, i) => [values[3 * i + 0], values[3 * i + 1], values[3 * i + 2]], VEC4: (values, i) => [values[4 * i + 0], values[4 * i + 1], values[4 * i + 2], values[4 * i + 3]], MAT2: (values, i) => [values[4 * i + 0], values[4 * i + 1], values[4 * i + 2], values[4 * i + 3]], MAT3: (values, i) => [values[9 * i + 0], values[9 * i + 1], values[9 * i + 2], values[9 * i + 3], values[9 * i + 4], values[9 * i + 5], values[9 * i + 6], values[9 * i + 7], values[9 * i + 8]], MAT4: (values, i) => [values[16 * i + 0], values[16 * i + 1], values[16 * i + 2], values[16 * i + 3], values[16 * i + 4], values[16 * i + 5], values[16 * i + 6], values[16 * i + 7], values[16 * i + 8], values[16 * i + 9], values[16 * i + 10], values[16 * i + 11], values[16 * i + 12], values[16 * i + 13], values[16 * i + 14], values[16 * i + 15]] }; const PACKER = { SCALAR: (x, values, i) => { values[i] = x; }, VEC2: (x, values, i) => { values[2 * i + 0] = x[0]; values[2 * i + 1] = x[1]; }, VEC3: (x, values, i) => { values[3 * i + 0] = x[0]; values[3 * i + 1] = x[1]; values[3 * i + 2] = x[2]; }, VEC4: (x, values, i) => { values[4 * i + 0] = x[0]; values[4 * i + 1] = x[1]; values[4 * i + 2] = x[2]; values[4 * i + 3] = x[3]; }, MAT2: (x, values, i) => { values[4 * i + 0] = x[0]; values[4 * i + 1] = x[1]; values[4 * i + 2] = x[2]; values[4 * i + 3] = x[3]; }, MAT3: (x, values, i) => { values[9 * i + 0] = x[0]; values[9 * i + 1] = x[1]; values[9 * i + 2] = x[2]; values[9 * i + 3] = x[3]; values[9 * i + 4] = x[4]; values[9 * i + 5] = x[5]; values[9 * i + 6] = x[6]; values[9 * i + 7] = x[7]; values[9 * i + 8] = x[8]; values[9 * i + 9] = x[9]; }, MAT4: (x, values, i) => { values[16 * i + 0] = x[0]; values[16 * i + 1] = x[1]; values[16 * i + 2] = x[2]; values[16 * i + 3] = x[3]; values[16 * i + 4] = x[4]; values[16 * i + 5] = x[5]; values[16 * i + 6] = x[6]; values[16 * i + 7] = x[7]; values[16 * i + 8] = x[8]; values[16 * i + 9] = x[9]; values[16 * i + 10] = x[10]; values[16 * i + 11] = x[11]; values[16 * i + 12] = x[12]; values[16 * i + 13] = x[13]; values[16 * i + 14] = x[14]; values[16 * i + 15] = x[15]; } }; function createTypedArrayFromAccessor(tile3DAccessor, buffer, byteOffset, length) { const { componentType } = tile3DAccessor; Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_1__["assert"])(tile3DAccessor.componentType); const type = typeof componentType === 'string' ? _loaders_gl_math__WEBPACK_IMPORTED_MODULE_0__["GLType"].fromName(componentType) : componentType; const size = COMPONENTS_PER_ATTRIBUTE[tile3DAccessor.type]; const unpacker = UNPACKER[tile3DAccessor.type]; const packer = PACKER[tile3DAccessor.type]; byteOffset += tile3DAccessor.byteOffset; const values = _loaders_gl_math__WEBPACK_IMPORTED_MODULE_0__["GLType"].createTypedArray(type, buffer, byteOffset, size * length); return { values, type, size, unpacker, packer }; } //# sourceMappingURL=tile-3d-accessor-utils.js.map /***/ }), /***/ "../../node_modules/@loaders.gl/3d-tiles/dist/esm/lib/classes/tile-3d-batch-table-hierarchy.js": /*!***************************************************************************************************************************!*\ !*** /Users/missx/Source/deck.gl/node_modules/@loaders.gl/3d-tiles/dist/esm/lib/classes/tile-3d-batch-table-hierarchy.js ***! \***************************************************************************************************************************/ /*! exports provided: initializeHierarchy, traverseHierarchy */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initializeHierarchy", function() { return initializeHierarchy; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "traverseHierarchy", function() { return traverseHierarchy; }); const defined = x => x !== undefined; function initializeHierarchy(batchTable, jsonHeader, binaryBody) { if (!jsonHeader) { return null; } let hierarchy = batchTable.getExtension('3DTILES_batch_table_hierarchy'); const legacyHierarchy = jsonHeader.HIERARCHY; if (legacyHierarchy) { console.warn('3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy.'); jsonHeader.extensions = jsonHeader.extensions || {}; jsonHeader.extensions['3DTILES_batch_table_hierarchy'] = legacyHierarchy; hierarchy = legacyHierarchy; } if (!hierarchy) { return null; } return initializeHierarchyValues(hierarchy, binaryBody); } function initializeHierarchyValues(hierarchyJson, binaryBody) { let i; let classId; let binaryAccessor; const instancesLength = hierarchyJson.instancesLength; const classes = hierarchyJson.classes; let classIds = hierarchyJson.classIds; let parentCounts = hierarchyJson.parentCounts; let parentIds = hierarchyJson.parentIds; let parentIdsLength = instancesLength; if (defined(classIds.byteOffset)) { classIds.componentType = defaultValue(classIds.componentType, GL.UNSIGNED_SHORT); classIds.type = AttributeType.SCALAR; binaryAccessor = getBinaryAccessor(classIds); classIds = binaryAccessor.createArrayBufferView(binaryBody.buffer, binaryBody.byteOffset + classIds.byteOffset, instancesLength); } let parentIndexes; if (defined(parentCounts)) { if (defined(parentCounts.byteOffset)) { parentCounts.componentType = defaultValue(parentCounts.componentType, GL.UNSIGNED_SHORT); parentCounts.type = AttributeType.SCALAR; binaryAccessor = getBinaryAccessor(parentCounts); parentCounts = binaryAccessor.createArrayBufferView(binaryBody.buffer, binaryBody.byteOffset + parentCounts.byteOffset, instancesLength); } parentIndexes = new Uint16Array(instancesLength); parentIdsLength = 0; for (i = 0; i < instancesLength; ++i) { parentIndexes[i] = parentIdsLength; parentIdsLength += parentCounts[i]; } } if (defined(parentIds) && defined(parentIds.byteOffset)) { parentIds.componentType = defaultValue(parentIds.componentType, GL.UNSIGNED_SHORT); parentIds.type = AttributeType.SCALAR; binaryAccessor = getBinaryAccessor(parentIds); parentIds = binaryAccessor.createArrayBufferView(binaryBody.buffer, binaryBody.byteOffset + parentIds.byteOffset, parentIdsLength); } const classesLength = classes.length; for (i = 0; i < classesLength; ++i) { const classInstancesLength = classes[i].length; const properties = classes[i].instances; const binaryProperties = getBinaryProperties(classInstancesLength, properties, binaryBody); classes[i].instances = combine(binaryProperties, properties); } const classCounts = new Array(classesLength).fill(0); const classIndexes = new Uint16Array(instancesLength); for (i = 0; i < instancesLength; ++i) { classId = classIds[i]; classIndexes[i] = classCounts[classId]; ++classCounts[classId]; } const hierarchy = { classes, classIds, classIndexes, parentCounts, parentIndexes, parentIds }; validateHierarchy(hierarchy); return hierarchy; } function traverseHierarchy(hierarchy, instanceIndex, endConditionCallback) { if (!hierarchy) { return; } const parentCounts = hierarchy.parentCounts; const parentIds = hierarchy.parentIds; if (parentIds) { return endConditionCallback(hierarchy, instanceIndex); } if (parentCounts > 0) { return traverseHierarchyMultipleParents(hierarchy, instanceIndex, endConditionCallback); } return traverseHierarchySingleParent(hierarchy, instanceIndex, endConditionCallback); } function traverseHierarchyMultipleParents(hierarchy, instanceIndex, endConditionCallback) { const classIds = hierarchy.classIds; const parentCounts = hierarchy.parentCounts; const parentIds = hierarchy.parentIds; const parentIndexes = hierarchy.parentIndexes; const instancesLength = classIds.length; const visited = scratchVisited; visited.length = Math.max(visited.length, instancesLength); const visitedMarker = ++marker; const stack = scratchStack; stack.length = 0; stack.push(instanceIndex); while (stack.length > 0) { instanceIndex = stack.pop(); if (visited[instanceIndex] === visitedMarker) { continue; } visited[instanceIndex] = visitedMarker; const result = endConditionCallback(hierarchy, instanceIndex); if (defined(result)) { return result; } const parentCount = parentCounts[instanceIndex]; const parentIndex = parentIndexes[instanceIndex]; for (let i = 0; i < parentCount; ++i) { const parentId = parentIds[parentIndex + i]; if (parentId !== instanceIndex) { stack.push(parentId); } } } return null; } function traverseHierarchySingleParent(hierarchy, instanceIndex, endConditionCallback) { let hasParent = true; while (hasParent) { const result = endConditionCallback(hierarchy, instanceIndex); if (defined(result)) { return result; } const parentId = hierarchy.parentIds[instanceIndex]; hasParent = parentId !== instanceIndex; instanceIndex = parentId; } throw new Error('traverseHierarchySingleParent'); } function validateHierarchy(hierarchy) { const scratchValidateStack = []; const classIds = hierarchy.classIds; const instancesLength = classIds.length; for (let i = 0; i < instancesLength; ++i) { validateInstance(hierarchy, i, stack); } } function validateInstance(hierarchy, instanceIndex, stack) { const parentCounts = hierarchy.parentCounts; const parentIds = hierarchy.parentIds; const parentIndexes = hierarchy.parentIndexes; const classIds = hierarchy.classIds; const instancesLength = classIds.length; if (!defined(parentIds)) { return; } assert(instanceIndex < instancesLength, "Parent index ".concat(instanceIndex, " exceeds the total number of instances: ").concat(instancesLength)); assert(stack.indexOf(instanceIndex) === -1, 'Circular dependency detected in the batch table hierarchy.'); stack.push(instanceIndex); const parentCount = defined(parentCounts) ? parentCounts[instanceIndex] : 1; const parentIndex = defined(parentCounts) ? parentIndexes[instanceIndex] : instanceIndex; for (let i = 0; i < parentCount; ++i) { const parentId = parentIds[parentIndex + i]; if (parentId !== instanceIndex) { validateInstance(hierarchy, parentId, stack); } } stack.pop(instanceIndex); } //# sourceMappingURL=tile-3d-batch-table-hierarchy.js.map /***/ }), /***/ "../../node_modules/@loaders.gl/3d-tiles/dist/esm/lib/classes/tile-3d-batch-table.js": /*!*****************************************************************************************************************!*\ !*** /Users/missx/Source/deck.gl/node_modules/@loaders.gl/3d-tiles/dist/esm/lib/classes/tile-3d-batch-table.js ***! \*****************************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Tile3DBatchTableParser; }); /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ "../../node_modules/@babel/runtime/helpers/esm/defineProperty.js"); /* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @loaders.gl/loader-utils */ "../../node_modules/@loaders.gl/loader-utils/dist/esm/index.js"); /* harmony import */ var _helpers_tile_3d_accessor_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./helpers/tile-3d-accessor-utils */ "../../node_modules/@loaders.gl/3d-tiles/dist/esm/lib/classes/helpers/tile-3d-accessor-utils.js"); /* harmony import */ var _tile_3d_batch_table_hierarchy__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./tile-3d-batch-table-hierarchy */ "../../node_modules/@loaders.gl/3d-tiles/dist/esm/lib/classes/tile-3d-batch-table-hierarchy.js"); function defined(x) { return x !== undefined && x !== null; } const clone = (x, y) => x; const IGNORED_PROPERTY_FIELDS = { HIERARCHY: true, extensions: true, extras: true }; class Tile3DBatchTableParser { constructor(json, binary, featureCount, options = {}) { var _this$json; Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "json", void 0); Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "binary", void 0); Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "featureCount", void 0); Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_extensions", void 0); Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_properties", void 0); Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_binaryProperties", void 0); Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_hierarchy", void 0); Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_1__["assert"])(featureCount >= 0); this.json = json || {}; this.binary = binary; this.featureCount = featureCount; this._extensions = ((_this$json = this.json) === null || _this$json === void 0 ? void 0 : _this$json.extensions) || {}; this._properties = {}; for (const propertyName in this.json) { if (!IGNORED_PROPERTY_FIELDS[propertyName]) { this._properties[propertyName] = this.json[propertyName]; } } this._binaryProperties = this._initializeBinaryProperties(); if (options['3DTILES_batch_table_hierarchy']) { this._hierarchy = Object(_tile_3d_batch_table_hierarchy__WEBPACK_IMPORTED_MODULE_3__["initializeHierarchy"])(this, this.json, this.binary); } } getExtension(extensionName) { return this.json && this.json.extensions && this.json.extensions[extensionName]; } memorySizeInBytes() { return 0; } isClass(batchId, className) { this._checkBatchId(batchId); Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_1__["assert"])(typeof className === 'string', className); if (this._hierarchy) { const result = Object(_tile_3d_batch_table_hierarchy__WEBPACK_IMPORTED_MODULE_3__["traverseHierarchy"])(this._hierarchy, batchId, (hierarchy, instanceIndex) => { const classId = hierarchy.classIds[instanceIndex]; const instanceClass = hierarchy.classes[classId]; return instanceClass.name === className; }); return defined(result); } return false; } isExactClass(batchId, className) { Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_1__["assert"])(typeof className === 'string', className); return this.getExactClassName(batchId) === className; } getExactClassName(batchId) { this._checkBatchId(batchId); if (this._hierarchy) { const classId = this._hierarchy.classIds[batchId]; const instanceClass = this._hierarchy.classes[classId]; return instanceClass.name; } return undefined; } hasProperty(batchId, name) { this._checkBatchId(batchId); Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_1__["assert"])(typeof name === 'string', name); return defined(this._properties[name]) || this._hasPropertyInHierarchy(batchId, name); } getPropertyNames(batchId, results) { this._checkBatchId(batchId); results = defined(results) ? results : []; results.length = 0; const propertyNames = Object.keys(this._properties); results.push(...propertyNames); if (this._hierarchy) { this._getPropertyNamesInHierarchy(batchId, results); } return results; } getProperty(batchId, name) { this._checkBatchId(batchId); Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_1__["assert"])(typeof name === 'string', name); if (this._binaryProperties) { const binaryProperty = this._binaryProperties[name]; if (defined(binaryProperty)) { return this._getBinaryProperty(binaryProperty, batchId); } } const propertyValues = this._properties[name]; if (defined(propertyValues)) { return clone(propertyValues[batchId], true); } if (this._hierarchy) { const hierarchyProperty = this._getHierarchyProperty(batchId, name); if (defined(hierarchyProperty)) { return hierarchyProperty; } } return undefined; } setProperty(batchId, name, value) { const featureCount = this.featureCount; this._checkBatchId(batchId); Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_1__["assert"])(typeof name === 'string', name); if (this._binaryProperties) { const binaryProperty = this._binaryProperties[name]; if (binaryProperty) { this._setBinaryProperty(binaryProperty, batchId, value); return; } } if (this._hierarchy) { if (this._setHierarchyProperty(this, batchId, name, value)) { return; } } let propertyValues = this._properties[name]; if (!defined(propertyValues)) { this._properties[name] = new Array(featureCount); propertyValues = this._properties[name]; } propertyValues[batchId] = clone(value, true); } _checkBatchId(batchId) { const valid = batchId >= 0 && batchId < this.featureCount; if (!valid) { throw new Error('batchId not in range [0, featureCount - 1].'); } } _getBinaryProperty(binaryProperty, index) { return binaryProperty.unpack(binaryProperty.typedArray, index); } _setBinaryProperty(binaryProperty, index, value) { binaryProperty.pack(value, binaryProperty.typedArray, index); } _initializeBinaryProperties() { let binaryProperties = null; for (const name in this._properties) { const property = this._properties[name]; const binaryProperty = this._initializeBinaryProperty(name, property); if (binaryProperty) { binaryProperties = binaryProperties || {}; binaryProperties[name] = binaryProperty; } } return binaryProperties; } _initializeBinaryProperty(name, property) { if ('byteOffset' in property) { const tile3DAccessor = property; Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_1__["assert"])(this.binary, "Property ".concat(name, " requires a batch table binary.")); Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_1__["assert"])(tile3DAccessor.type, "Property ".concat(name, " requires a type.")); const accessor = Object(_helpers_tile_3d_accessor_utils__WEBPACK_IMPORTED_MODULE_2__["createTypedArrayFromAccessor"])(tile3DAccessor, this.binary.buffer, this.binary.byteOffset | 0, this.featureCount); return { typedArray: accessor.values, componentCount: accessor.size, unpack: accessor.unpacker, pack: accessor.packer }; } return null; } _hasPropertyInHierarchy(batchId, name) { if (!this._hierarchy) { return false; } const result = Object(_tile_3d_batch_table_hierarchy__WEBPACK_IMPORTED_MODULE_3__["traverseHierarchy"])(this._hierarchy, batchId, (hierarchy, instanceIndex) => { const classId = hierarchy.classIds[instanceIndex]; const instances = hierarchy.classes[classId].instances; return defined(instances[name]); }); return defined(result); } _getPropertyNamesInHierarchy(batchId, results) { Object(_tile_3d_batch_table_hierarchy__WEBPACK_IMPORTED_MODULE_3__["traverseHierarchy"])(this._hierarchy, batchId, (hierarchy, instanceIndex) => { const classId = hierarchy.classIds[instanceIndex]; const instances = hierarchy.classes[classId].instances; for (const name in instances) { if (instances.hasOwnProperty(name)) { if (results.indexOf(name) === -1) { results.push(name); } } } }); } _getHierarchyProperty(batchId, name) { return Object(_tile_3d_batch_table_hierarchy__WEBPACK_IMPORTED_MODULE_3__["traverseHierarchy"])(this._hierarchy, batchId, (hierarchy, instanceIndex) => { const classId = hierarchy.classIds[instanceIndex]; const instanceClass = hierarchy.classes[classId]; const indexInClass = hierarchy.classIndexes[instanceIndex]; const propertyValues = instanceClass.instances[name]; if (defined(propertyValues)) { if (defined(propertyValues.typedArray)) { return this._getBinaryProperty(propertyValues, indexInClass); } return clone(propertyValues[indexInClass], true); } return null; }); } _setHierarchyProperty(batchTable, batchId, name, value) { const result = Object(_tile_3d_batch_table_hierarchy__WEBPACK_IMPORTED_MODULE_3__["traverseHierarchy"])(this._hierarchy, batchId, (hierarchy, instanceIndex) => { const classId = hierarchy.classIds[instanceIndex]; const instanceClass = hierarchy.classes[classId]; const indexInClass = hierarchy.classIndexes[instanceIndex]; const propertyValues = instanceClass.instances[name]; if (defined(propertyValues)) { Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_1__["assert"])(instanceIndex === batchId, "Inherited property \"".concat(name, "\" is read-only.")); if (defined(propertyValues.typedArray)) { this._setBinaryProperty(propertyValues, indexInClass, value); } else { propertyValues[indexInClass] = clone(value, true); } return true; } return false; }); return defined(result); } } //# sourceMappingURL=tile-3d-batch-table.js.map /***/ }), /***/ "../../node_modules/@loaders.gl/3d-tiles/dist/esm/lib/classes/tile-3d-feature-table.js": /*!*******************************************************************************************************************!*\ !*** /Users/missx/Source/deck.gl/node_modules/@loaders.gl/3d-tiles/dist/esm/lib/classes/tile-3d-feature-table.js ***! \*******************************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Tile3DFeatureTable; }); /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ "../../node_modules/@babel/runtime/helpers/esm/defineProperty.js"); /* harmony import */ var _loaders_gl_math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @loaders.gl/math */ "../../node_modules/@loaders.gl/math/dist/esm/index.js"); class Tile3DFeatureTable { constructor(featureTableJson, featureTableBinary) { Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "json", void 0); Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "buffer", void 0); Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "featuresLength", 0); Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_cachedTypedArrays", {}); this.json = featureTableJson; this.buffer = featureTableBinary; } getExtension(extensionName) { return this.json.extensions && this.json.extensions[extensionName]; } hasProperty(propertyName) { return Boolean(this.json[propertyName]); } getGlobalProperty(propertyName, componentType = _loaders_gl_math__WEBPACK_IMPORTED_MODULE_1__["GL"].UNSIGNED_INT, componentLength = 1) { const jsonValue = this.json[propertyName]; if (jsonValue && Number.isFinite(jsonValue.byteOffset)) { return this._getTypedArrayFromBinary(propertyName, componentType, componentLength, 1, jsonValue.byteOffset); } return jsonValue; } getPropertyArray(propertyName, componentType, componentLength) { const jsonValue = this.json[propertyName]; if (jsonValue && Number.isFinite(jsonValue.byteOffset)) { if ('componentType' in jsonValue) { componentType = _loaders_gl_math__WEBPACK_IMPORTED_MODULE_1__["GLType"].fromName(jsonValue.componentType); } return this._getTypedArrayFromBinary(propertyName, componentType, componentLength, this.featuresLength, jsonValue.byteOffset); } return this._getTypedArrayFromArray(propertyName, componentType, jsonValue); } getProperty(propertyName, componentType, componentLength, featureId, result) { const jsonValue = this.json[propertyName]; if (!jsonValue) { return jsonValue; } const typedArray = this.getPropertyArray(propertyName, componentType, componentLength); if (componentLength === 1) { return typedArray[featureId]; } for (let i = 0; i < componentLength; ++i) { result[i] = typedArray[componentLength * featureId + i]; } return result; } _getTypedArrayFromBinary(propertyName, componentType, componentLength, count, byteOffset) { const cachedTypedArrays = this._cachedTypedArrays; let typedArray = cachedTypedArrays[propertyName]; if (!typedArray) { typedArray = _loaders_gl_math__WEBPACK_IMPORTED_MODULE_1__["GLType"].createTypedArray(componentType, this.buffer.buffer, this.buffer.byteOffset + byteOffset, count * componentLength); cachedTypedArrays[propertyName] = typedArray; } return typedArray; } _getTypedArrayFromArray(propertyName, componentType, array) { const cachedTypedArrays = this._cachedTypedArrays; let typedArray = cachedTypedArrays[propertyName]; if (!typedArray) { typedArray = _loaders_gl_math__WEBPACK_IMPORTED_MODULE_1__["GLType"].createTypedArray(componentType, array); cachedTypedArrays[propertyName] = typedArray; } return typedArray; } } //# sourceMappingURL=tile-3d-feature-table.js.map /***/ }), /***/ "../../node_modules/@loaders.gl/3d-tiles/dist/esm/lib/constants.js": /*!***********************************************************************************************!*\ !*** /Users/missx/Source/deck.gl/node_modules/@loaders.gl/3d-tiles/dist/esm/lib/constants.js ***! \***********************************************************************************************/ /*! exports provided: TILE3D_TYPE, TILE3D_TYPES, MAGIC_ARRAY, TILE3D_OPTIMIZATION_HINT */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TILE3D_TYPE", function() { return TILE3D_TYPE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TILE3D_TYPES", function() { return TILE3D_TYPES; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAGIC_ARRAY", function() { return MAGIC_ARRAY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TILE3D_OPTIMIZATION_HINT", function() { return TILE3D_OPTIMIZATION_HINT; }); const TILE3D_TYPE = { COMPOSITE: 'cmpt', POINT_CLOUD: 'pnts', BATCHED_3D_MODEL: 'b3dm', INSTANCED_3D_MODEL: 'i3dm', GEOMETRY: 'geom', VECTOR: 'vect', GLTF: 'glTF' }; const TILE3D_TYPES = Object.keys(TILE3D_TYPE); const MAGIC_ARRAY = { BATCHED_MODEL: [98, 51, 100, 109], INSTANCED_MODEL: [105, 51, 100, 109], POINT_CLOUD: [112, 110, 116, 115], COMPOSITE: [99, 109, 112, 116] }; const TILE3D_OPTIMIZATION_HINT = { NOT_COMPUTED: -1, USE_OPTIMIZATION: 1, SKIP_OPTIMIZATION: 0 }; //# sourceMappingURL=constants.js.map /***/ }), /***/ "../../node_modules/@loaders.gl/3d-tiles/dist/esm/lib/encoders/encode-3d-tile-batched-model.js": /*!***************************************************************************************************************************!*\ !*** /Users/missx/Source/deck.gl/node_modules/@loaders.gl/3d-tiles/dist/esm/lib/encoders/encode-3d-tile-batched-model.js ***! \***************************************************************************************************************************/ /*! exports provided: encodeBatchedModel3DTile */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "encodeBatchedModel3DTile", function() { return encodeBatchedModel3DTile; }); /* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @loaders.gl/loader-utils */ "../../node_modules/@loaders.gl/loader-utils/dist/esm/index.js"); /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants */ "../../node_modules/@loaders.gl/3d-tiles/dist/esm/lib/constants.js"); /* harmony import */ var _helpers_encode_3d_tile_header__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./helpers/encode-3d-tile-header */ "../../node_modules/@loaders.gl/3d-tiles/dist/esm/lib/encoders/helpers/encode-3d-tile-header.js"); function encodeBatchedModel3DTile(tile, dataView, byteOffset, options) { const { featuresLength = 0, batchTable } = tile; const featureTableJson = { BATCH_LENGTH: featuresLength }; const featureTableJsonString = JSON.stringify(featureTableJson); const batchTableJsonString = batchTable ? JSON.stringify(batchTable) : ''; const featureTableJsonByteLength = Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__["padToNBytes"])(featureTableJsonString.length, 8); const batchTableJsonByteLength = batchTableJsonString ? Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__["padToNBytes"])(batchTableJsonString.length, 8) : 0; tile = { magic: _constants__WEBPACK_IMPORTED_MODULE_1__["MAGIC_ARRAY"].BATCHED_MODEL, ...tile }; const byteOffsetStart = byteOffset; byteOffset = Object(_helpers_encode_3d_tile_header__WEBPACK_IMPORTED_MODULE_2__["encode3DTileHeader"])(tile, dataView, byteOffset); if (dataView) { dataView.setUint32(12, featureTableJsonByteLength, true); dataView.setUint32(16, 0, true); dataView.setUint32(20, batchTableJsonByteLength, true); dataView.setUint32(24, 0, true); } byteOffset += 16; byteOffset = Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__["copyPaddedStringToDataView"])(dataView, byteOffset, featureTableJsonString, 8); if (batchTable) { byteOffset = Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__["copyPaddedStringToDataView"])(dataView, byteOffset, batchTableJsonString, 8); } const gltfEncoded = tile.gltfEncoded; if (gltfEncoded) { byteOffset = Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__["copyBinaryToDataView"])(dataView, byteOffset, gltfEncoded, gltfEncoded.byteLength); } Object(_helpers_encode_3d_tile_header__WEBPACK_IMPORTED_MODULE_2__["encode3DTileByteLength"])(dataView, byteOffsetStart, byteOffset - byteOffsetStart); return byteOffset; } //# sourceMappingURL=encode-3d-tile-batched-model.js.map /***/ }), /***/ "../../node_modules/@loaders.gl/3d-tiles/dist/esm/lib/encoders/encode-3d-tile-composite.js": /*!***********************************************************************************************************************!*\ !*** /Users/missx/Source/deck.gl/node_modules/@loaders.gl/3d-tiles/dist/esm/lib/encoders/encode-3d-tile-composite.js ***! \***********************************************************************************************************************/ /*! exports provided: encodeComposite3DTile */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "encodeComposite3DTile", function() { return encodeComposite3DTile; }); /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants */ "../../node_modules/@loaders.gl/3d-tiles/dist/esm/lib/constants.js"); /* harmony import */ var _helpers_encode_3d_tile_header__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers/encode-3d-tile-header */ "../../node_modules/@loaders.gl/3d-tiles/dist/esm/lib/encoders/helpers/encode-3d-tile-header.js"); function encodeComposite3DTile(tile, dataView, byteOffset, options, encode3DTile) { tile = { magic: _constants__WEBPACK_IMPORTED_MODULE_0__["MAGIC_ARRAY"].COMPOSITE, tiles: [], ...tile }; const byteOffsetStart = byteOffset; byteOffset += Object(_helpers_encode_3d_tile_header__WEBPACK_IMPORTED_MODULE_1__["encode3DTileHeader"])(tile, dataView, byteOffset); if (dataView) { dataView.setUint32(byteOffset, tile.tiles.length, true); } byteOffset += 4; for (let i = 0; i < tile.tiles.length; ++i) { byteOffset += encode3DTile(tile.tiles[i], dataView, byteOffset, options); } Object(_helpers_encode_3d_tile_header__WEBPACK_IMPORTED_MODULE_1__["encode3DTileByteLength"])(dataView, byteOffsetStart, byteOffset - byteOffsetStart); return byteOffset; } //# sourceMappingURL=encode-3d-tile-composite.js.map /***/ }), /***/ "../../node_modules/@loaders.gl/3d-tiles/dist/esm/lib/encoders/encode-3d-tile-instanced-model.js": /*!*****************************************************************************************************************************!*\ !*** /Users/missx/Source/deck.gl/node_modules/@loaders.gl/3d-tiles/dist/esm/lib/encoders/encode-3d-tile-instanced-model.js ***! \*****************************************************************************************************************************/ /*! exports provided: encodeInstancedModel3DTile */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "encodeInstancedModel3DTile", function() { return encodeInstancedModel3DTile; }); /* harmony import */ var _loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @loaders.gl/loader-utils */ "../../node_modules/@loaders.gl/loader-utils/dist/esm/index.js"); /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants */ "../../node_modules/@loaders.gl/3d-tiles/dist/esm/lib/constants.js"); /* harmony import */ var _helpers_encode_3d_tile_header__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./helpers/encode-3d-tile-header */ "../../node_modules/@loaders.gl/3d-tiles/dist/esm/lib/encoders/helpers/encode-3d-tile-header.js"); function encodeInstancedModel3DTile(tile, dataView, byteOffset, options) { const { featuresLength = 1, gltfFormat = 1, gltfUri = '' } = tile; const gltfUriByteLength = gltfUri.length; const featureTableJson = { INSTANCES_LENGTH: featuresLength, POSITION: new Array(featuresLength * 3).fill(0) }; const featureTableJsonString = JSON.stringify(featureTableJson); const featureTableJsonByteLength = featureTableJsonString.length; tile = { magic: _constants__WEBPACK_IMPORTED_MODULE_1__["MAGIC_ARRAY"].INSTANCED_MODEL, ...tile }; const byteOffsetStart = byteOffset; byteOffset = Object(_helpers_encod