@loaders.gl/i3s 3.1.0-beta.7 → 3.1.3
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/bundle.js +5 -10364
- package/dist/dist.min.js +10371 -0
- package/dist/es5/bundle.js +1 -1
- package/dist/es5/bundle.js.map +1 -1
- package/dist/es5/i3s-attribute-loader.js +147 -62
- package/dist/es5/i3s-attribute-loader.js.map +1 -1
- package/dist/es5/i3s-building-scene-layer-loader.js +36 -8
- package/dist/es5/i3s-building-scene-layer-loader.js.map +1 -1
- package/dist/es5/i3s-content-loader.js +36 -10
- package/dist/es5/i3s-content-loader.js.map +1 -1
- package/dist/es5/i3s-loader.js +175 -51
- package/dist/es5/i3s-loader.js.map +1 -1
- package/dist/es5/i3s-node-page-loader.js +51 -8
- package/dist/es5/i3s-node-page-loader.js.map +1 -1
- package/dist/es5/index.js +6 -6
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/lib/helpers/i3s-nodepages-tiles.js +328 -173
- package/dist/es5/lib/helpers/i3s-nodepages-tiles.js.map +1 -1
- package/dist/es5/lib/parsers/constants.js +9 -28
- package/dist/es5/lib/parsers/constants.js.map +1 -1
- package/dist/es5/lib/parsers/parse-i3s-attribute.js +69 -27
- package/dist/es5/lib/parsers/parse-i3s-attribute.js.map +1 -1
- package/dist/es5/lib/parsers/parse-i3s-building-scene-layer.js +62 -28
- package/dist/es5/lib/parsers/parse-i3s-building-scene-layer.js.map +1 -1
- package/dist/es5/lib/parsers/parse-i3s-tile-content.js +416 -314
- package/dist/es5/lib/parsers/parse-i3s-tile-content.js.map +1 -1
- package/dist/es5/lib/parsers/parse-i3s.js +109 -49
- package/dist/es5/lib/parsers/parse-i3s.js.map +1 -1
- package/dist/es5/lib/utils/convert-i3s-obb-to-mbs.js +8 -4
- package/dist/es5/lib/utils/convert-i3s-obb-to-mbs.js.map +1 -1
- package/dist/es5/lib/utils/url-utils.js +14 -17
- package/dist/es5/lib/utils/url-utils.js.map +1 -1
- package/dist/es5/types.js +10 -2
- package/dist/es5/types.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 +1 -1
- package/dist/esm/i3s-node-page-loader.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/helpers/i3s-nodepages-tiles.js +33 -23
- package/dist/esm/lib/helpers/i3s-nodepages-tiles.js.map +1 -1
- package/dist/esm/lib/parsers/constants.js +2 -18
- package/dist/esm/lib/parsers/constants.js.map +1 -1
- package/dist/esm/lib/parsers/parse-i3s-tile-content.js +44 -61
- package/dist/esm/lib/parsers/parse-i3s-tile-content.js.map +1 -1
- package/dist/esm/lib/parsers/parse-i3s.js +40 -25
- package/dist/esm/lib/parsers/parse-i3s.js.map +1 -1
- package/dist/esm/lib/utils/url-utils.js +2 -3
- package/dist/esm/lib/utils/url-utils.js.map +1 -1
- package/dist/esm/types.js +7 -0
- package/dist/esm/types.js.map +1 -1
- package/dist/i3s-building-scene-layer-loader.js +1 -1
- package/dist/i3s-content-loader.js +1 -1
- package/dist/i3s-content-worker.js +106 -95
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/lib/helpers/i3s-nodepages-tiles.d.ts +20 -20
- package/dist/lib/helpers/i3s-nodepages-tiles.d.ts.map +1 -1
- package/dist/lib/helpers/i3s-nodepages-tiles.js +33 -32
- package/dist/lib/parsers/constants.d.ts +1 -17
- package/dist/lib/parsers/constants.d.ts.map +1 -1
- package/dist/lib/parsers/constants.js +3 -21
- package/dist/lib/parsers/parse-i3s-attribute.d.ts +1 -1
- package/dist/lib/parsers/parse-i3s-tile-content.d.ts +2 -2
- package/dist/lib/parsers/parse-i3s-tile-content.d.ts.map +1 -1
- package/dist/lib/parsers/parse-i3s-tile-content.js +35 -61
- package/dist/lib/parsers/parse-i3s.d.ts +5 -3
- package/dist/lib/parsers/parse-i3s.d.ts.map +1 -1
- package/dist/lib/parsers/parse-i3s.js +37 -32
- package/dist/lib/utils/url-utils.d.ts +6 -6
- package/dist/lib/utils/url-utils.d.ts.map +1 -1
- package/dist/lib/utils/url-utils.js +5 -5
- package/dist/types.d.ts +289 -74
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +6 -1
- package/package.json +10 -10
- package/src/i3s-building-scene-layer-loader.ts +1 -1
- package/src/i3s-content-loader.ts +1 -1
- package/src/index.ts +3 -3
- package/src/lib/helpers/i3s-nodepages-tiles.ts +71 -55
- package/src/lib/parsers/constants.ts +2 -22
- package/src/lib/parsers/parse-i3s-tile-content.ts +74 -103
- package/src/lib/parsers/parse-i3s.ts +48 -37
- package/src/lib/utils/url-utils.ts +7 -7
- package/src/types.ts +302 -93
package/dist/esm/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types.ts"],"names":["DATA_TYPE"],"mappings":"AAKA,WAAYA,SAAZ;;WAAYA,S;AAAAA,EAAAA,S;AAAAA,EAAAA,S;AAAAA,EAAAA,S;AAAAA,EAAAA,S;AAAAA,EAAAA,S;AAAAA,EAAAA,S;AAAAA,EAAAA,S;AAAAA,EAAAA,S;AAAAA,EAAAA,S;GAAAA,S,KAAAA,S","sourcesContent":["import type {GLTFMaterial} from '@loaders.gl/gltf';\nimport type {Matrix4, Quaternion, Vector3} from '@math.gl/core';\nimport type {Mesh} from '@loaders.gl/gltf';\nimport type {TypedArray} from '@loaders.gl/schema';\n\nexport enum DATA_TYPE {\n UInt8 = 'UInt8',\n UInt16 = 'UInt16',\n UInt32 = 'UInt32',\n UInt64 = 'UInt64',\n Int16 = 'Int16',\n Int32 = 'Int32',\n Int64 = 'Int64',\n Float32 = 'Float32',\n Float64 = 'Float64'\n}\n/**\n * spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/3DSceneLayer.cmn.md\n */\n// TODO Replace \"[key: string]: any\" with actual defenition\nexport type Tileset = {\n /**\n * The store object describes the exact physical storage of a layer and enables the client to detect when multiple layers are served from the same store.\n */\n store: Store;\n [key: string]: any;\n};\n// TODO Replace \"[key: string]: any\" with actual defenition\nexport type NodePage = {[key: string]: any};\n// TODO Replace \"[key: string]: any\" with actual defenition\nexport type Tile = {\n content: TileContent;\n isDracoGeometry: boolean;\n textureUrl: string;\n url: string;\n /**\n * Resource reference describing a featureData document.\n */\n attributeData: Resource[];\n textureFormat: 'jpeg' | 'png' | 'ktx-etc2' | 'dds' | 'ktx2';\n textureLoaderOptions: any;\n materialDefinition: GLTFMaterial;\n mbs: Mbs;\n};\n// TODO Replace \"[key: string]: any\" with actual defenition\nexport type TileContent = {\n featureData: DefaultGeometrySchema;\n attributes: NormalizedAttributes;\n indices: NormalizedAttribute | 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: any;\n }\n | null;\n\nexport type BoundingVolumes = {\n mbs: Mbs;\n obb: Obb;\n};\n\nexport type Obb = {\n center: number[] | Vector3;\n halfSize: number[] | Vector3;\n quaternion: Quaternion;\n};\n\nexport type Mbs = [number, number, number, number];\n\n// SceneLayer3D based on I3S specification https://github.com/Esri/i3s-spec/tree/master/docs/1.7\n// TODO Add description for each property\n\nexport type SceneLayer3D = {\n id: number;\n href?: string;\n layerType: string;\n spatialReference?: SpatialReference;\n heightModelInfo?: HeightModelInfo;\n version: string;\n name?: string;\n capabilities: string[];\n store: Store;\n nodePages?: NodePages;\n materialDefinitions?: GLTFMaterial[];\n textureSetDefinitions?: TextureSetDefinition[];\n geometryDefinitions?: GeometryDefinitions;\n attributeStorageInfo?: AttributeStorageInfo[];\n fields?: Field[];\n popupInfo?: PopupInfo;\n};\n\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\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\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 path?: 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\nexport type LodSelection = {\n metricType?: string;\n maxError: number;\n};\n\nexport type NodeReference = {\n id: string;\n version?: string;\n mbs?: Mbs;\n obb?: Obb;\n href?: string;\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 I3SGeometry = {\n geometry: ArrayBuffer | null;\n compressedGeometry?: ArrayBuffer | null;\n texture: any | null;\n sharedResources: SharedResources | null;\n meshMaterial?: GLTFMaterial | null;\n vertexCount: number | null;\n attributes: any | null;\n featureCount: number | null;\n geometryBuffer?: ArrayBuffer;\n};\n\nexport type MaxScreenThresholdSQ = {\n maxError: number;\n};\n\nexport type NodeInPage = {\n index?: number;\n lodThreshold: number;\n obb: Obb;\n children: any[];\n mesh: Mesh;\n};\n\nexport type SharedResources = {\n materialDefinitions?: GLTFMaterial[];\n textureDefinitions?: TextureDefinitionInfo[];\n nodePath: string;\n};\n\nexport type TextureImage = {\n id: string;\n size?: number;\n pixelInWorldUnits?: number;\n href?: string[];\n byteOffset?: string[];\n length?: number[];\n mimeType?: string;\n bufferView?: {\n data: ArrayBuffer;\n };\n image?: {\n height: number;\n width: number;\n };\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\ntype SpatialReference = {\n wkid: number;\n latestWkid: number;\n vcsWkid: number;\n latestVcsWkid: number;\n wkt?: string;\n};\n\ntype FullExtent = {\n xmin: number; // left\n xmax: number; // right\n ymin: number; // bottom\n ymax: number; // top\n zmin: number; // lowest elevation\n zmax: number; // highest elevation\n spatialReference?: SpatialReference;\n};\n\ntype TextureDefinitionInfo = {\n encoding: string[];\n wrap?: string[];\n atlas?: boolean;\n uvSet?: string;\n channels?: 'rbg' | 'rgba' | string;\n images: TextureImage[];\n};\n\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 attributeEncoding: string;\n textureEncoding: string[];\n lodType: string;\n lodModel: string;\n defaultGeometrySchema: DefaultGeometrySchema;\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: {\n property: 'vertexCount' | 'featureCount' | string;\n type:\n | DATA_TYPE.UInt8\n | DATA_TYPE.UInt16\n | DATA_TYPE.UInt32\n | DATA_TYPE.UInt64\n | DATA_TYPE.Int16\n | DATA_TYPE.Int32\n | DATA_TYPE.Int64\n | DATA_TYPE.Float32\n | DATA_TYPE.Float64;\n }[];\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};\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:\n | DATA_TYPE.UInt8\n | DATA_TYPE.UInt16\n | DATA_TYPE.Int16\n | DATA_TYPE.Int32\n | DATA_TYPE.Int64\n | DATA_TYPE.Float32\n | DATA_TYPE.Float64;\n valuesPerElement: number;\n};\nexport type NormalizedAttributes = {\n [key: string]: NormalizedAttribute;\n};\nexport type NormalizedAttribute = {\n value: number[] | TypedArray;\n type: number;\n size: number;\n normalized?: boolean;\n metadata?: any;\n};\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\ntype NodePages = {\n nodesPerPage: number;\n lodSelectionMetricType: string;\n};\n\ntype TextureSetDefinition = {\n formats: {name: string; format: string}[];\n atlas?: boolean;\n};\n\ntype GeometryDefinitions = {\n topology: 'triangle' | string;\n geometryBuffers: GeometryBuffer[];\n};\n\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\ntype FieldInfo = {\n fieldName: string;\n visible: boolean;\n isEditable: boolean;\n label: string;\n};\n"],"file":"types.js"}
|
|
1
|
+
{"version":3,"sources":["../../src/types.ts"],"names":["DATA_TYPE","HeaderAttributeProperty"],"mappings":"AAKA,WAAYA,SAAZ;;WAAYA,S;AAAAA,EAAAA,S;AAAAA,EAAAA,S;AAAAA,EAAAA,S;AAAAA,EAAAA,S;AAAAA,EAAAA,S;AAAAA,EAAAA,S;AAAAA,EAAAA,S;AAAAA,EAAAA,S;AAAAA,EAAAA,S;GAAAA,S,KAAAA,S;;AAmmBZ,WAAYC,uBAAZ;;WAAYA,uB;AAAAA,EAAAA,uB;AAAAA,EAAAA,uB;GAAAA,uB,KAAAA,uB","sourcesContent":["import type {GLTFMaterial} from '@loaders.gl/gltf';\nimport type {TypedArray, MeshAttribute} from '@loaders.gl/schema';\nimport type {TextureLevel} from '@loaders.gl/textures/src/types';\nimport {Matrix4, Quaternion, Vector3} from '@math.gl/core';\n\nexport enum DATA_TYPE {\n UInt8 = 'UInt8',\n UInt16 = 'UInt16',\n UInt32 = 'UInt32',\n UInt64 = 'UInt64',\n Int16 = 'Int16',\n Int32 = 'Int32',\n Int64 = 'Int64',\n Float32 = 'Float32',\n Float64 = 'Float64'\n}\n/**\n * spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/3DSceneLayer.cmn.md\n */\n// TODO Replace \"[key: string]: any\" with actual defenition\nexport interface I3STilesetHeader extends SceneLayer3D {\n /** Not in spec, but is necessary for woking */\n url?: string;\n [key: string]: any;\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\nexport type I3STextureFormat = 'jpg' | 'png' | 'ktx-etc2' | 'dds' | 'ktx2';\n\n// TODO Replace \"[key: string]: any\" with actual defenition\nexport type I3STileHeader = {\n isDracoGeometry: boolean;\n textureUrl?: string;\n url?: string;\n textureFormat?: I3STextureFormat;\n textureLoaderOptions?: any;\n materialDefinition?: I3SMaterialDefinition;\n mbs: Mbs;\n obb?: Obb;\n lodSelection?: LodSelection[];\n [key: string]: any;\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\nexport type Obb = {\n center: number[] | Vector3;\n halfSize: number[] | Vector3;\n quaternion: Quaternion;\n};\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 path?: 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 * Minimal I3S node data is needed for loading\n */\nexport type I3SMinimalNodeData = {\n id: string;\n url?: string;\n transform?: number[];\n lodSelection?: LodSelection[];\n obb?: Obb;\n mbs?: Mbs;\n contentUrl?: string;\n textureUrl?: string;\n attributeUrls?: string[];\n materialDefinition?: I3SMaterialDefinition;\n textureFormat?: I3STextureFormat;\n textureLoaderOptions?: {[key: string]: any};\n children?: NodeReference[];\n isDracoGeometry: boolean;\n};\n\nexport type LodSelection = {\n metricType?: string;\n maxError: number;\n};\n\nexport type NodeReference = {\n id: string;\n version?: string;\n mbs?: Mbs;\n obb?: Obb;\n href?: string;\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\nexport type SharedResources = {\n materialDefinitions?: GLTFMaterial[];\n textureDefinitions?: TextureDefinitionInfo[];\n nodePath: string;\n};\n\ntype TextureImage = {\n id: string;\n size?: number;\n pixelInWorldUnits?: number;\n href?: string[];\n byteOffset?: string[];\n length?: number[];\n mimeType?: string;\n bufferView?: {\n data: ArrayBuffer;\n };\n image?: {\n height: number;\n width: number;\n };\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 */\ntype FullExtent = {\n /** left */\n xmin: number;\n /** right */\n xmax: number;\n /** bottom */\n ymin: number;\n /** top */\n ymax: number;\n /** lowest elevation */\n zmin: number;\n /** highest elevation */\n zmax: number;\n spatialReference?: SpatialReference;\n};\n\ntype TextureDefinitionInfo = {\n encoding: string[];\n wrap?: string[];\n atlas?: boolean;\n uvSet?: string;\n channels?: 'rbg' | 'rgba' | string;\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 attributeEncoding: string;\n textureEncoding: string[];\n lodType: string;\n lodModel: string;\n defaultGeometrySchema: DefaultGeometrySchema;\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 | DATA_TYPE.UInt8\n | DATA_TYPE.UInt16\n | DATA_TYPE.UInt32\n | DATA_TYPE.UInt64\n | DATA_TYPE.Int16\n | DATA_TYPE.Int32\n | DATA_TYPE.Int64\n | DATA_TYPE.Float32\n | DATA_TYPE.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:\n | DATA_TYPE.UInt8\n | DATA_TYPE.UInt16\n | DATA_TYPE.Int16\n | DATA_TYPE.Int32\n | DATA_TYPE.Int64\n | DATA_TYPE.Float32\n | DATA_TYPE.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' | string;\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"],"file":"types.js"}
|
|
@@ -4,7 +4,7 @@ exports.I3SBuildingSceneLayerLoader = void 0;
|
|
|
4
4
|
const parse_i3s_building_scene_layer_1 = require("./lib/parsers/parse-i3s-building-scene-layer");
|
|
5
5
|
// __VERSION__ is injected by babel-plugin-version-inline
|
|
6
6
|
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
7
|
-
const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : '
|
|
7
|
+
const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
|
|
8
8
|
/**
|
|
9
9
|
* Loader for I3S - Building Scene Layer
|
|
10
10
|
*/
|
|
@@ -4,7 +4,7 @@ exports.I3SContentLoader = void 0;
|
|
|
4
4
|
const parse_i3s_tile_content_1 = require("./lib/parsers/parse-i3s-tile-content");
|
|
5
5
|
// __VERSION__ is injected by babel-plugin-version-inline
|
|
6
6
|
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
7
|
-
const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : '
|
|
7
|
+
const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
|
|
8
8
|
/**
|
|
9
9
|
* Loader for I3S - Indexed 3D Scene Layer
|
|
10
10
|
*/
|
|
@@ -1,11 +1,36 @@
|
|
|
1
1
|
(() => {
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
3
8
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
9
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
10
|
+
return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
11
|
+
};
|
|
4
12
|
var __export = (target, all) => {
|
|
5
13
|
__markAsModule(target);
|
|
6
14
|
for (var name in all)
|
|
7
15
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
16
|
};
|
|
17
|
+
var __reExport = (target, module2, desc) => {
|
|
18
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
19
|
+
for (let key of __getOwnPropNames(module2))
|
|
20
|
+
if (!__hasOwnProp.call(target, key) && key !== "default")
|
|
21
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
22
|
+
}
|
|
23
|
+
return target;
|
|
24
|
+
};
|
|
25
|
+
var __toModule = (module2) => {
|
|
26
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// (disabled):../worker-utils/src/lib/node/require-utils.node
|
|
30
|
+
var require_require_utils = __commonJS({
|
|
31
|
+
"(disabled):../worker-utils/src/lib/node/require-utils.node"() {
|
|
32
|
+
}
|
|
33
|
+
});
|
|
9
34
|
|
|
10
35
|
// ../loader-utils/src/lib/env-utils/assert.ts
|
|
11
36
|
function assert(condition, message) {
|
|
@@ -30,7 +55,7 @@
|
|
|
30
55
|
var nodeVersion = matches && parseFloat(matches[1]) || 0;
|
|
31
56
|
|
|
32
57
|
// ../worker-utils/src/lib/env-utils/version.ts
|
|
33
|
-
var DEFAULT_VERSION = "
|
|
58
|
+
var DEFAULT_VERSION = "latest";
|
|
34
59
|
var VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : DEFAULT_VERSION;
|
|
35
60
|
if (typeof __VERSION__ === "undefined") {
|
|
36
61
|
console.error("loaders.gl: The __VERSION__ variable is not injected using babel plugin. Latest unstable workers would be fetched from the CDN.");
|
|
@@ -434,11 +459,14 @@
|
|
|
434
459
|
}
|
|
435
460
|
|
|
436
461
|
// ../worker-utils/src/lib/worker-api/get-worker-url.ts
|
|
437
|
-
var NPM_TAG = "
|
|
462
|
+
var NPM_TAG = "latest";
|
|
438
463
|
function getWorkerURL(worker, options = {}) {
|
|
439
464
|
const workerOptions = options[worker.id] || {};
|
|
440
465
|
const workerFile = `${worker.id}-worker.js`;
|
|
441
466
|
let url = workerOptions.workerUrl;
|
|
467
|
+
if (!url && worker.id === "compression") {
|
|
468
|
+
url = options.workerUrl;
|
|
469
|
+
}
|
|
442
470
|
if (options._workerType === "test") {
|
|
443
471
|
url = `modules/${worker.module}/dist/${workerFile}`;
|
|
444
472
|
}
|
|
@@ -465,7 +493,8 @@
|
|
|
465
493
|
}
|
|
466
494
|
|
|
467
495
|
// ../worker-utils/src/lib/library-utils/library-utils.ts
|
|
468
|
-
var
|
|
496
|
+
var node = __toModule(require_require_utils());
|
|
497
|
+
var LATEST = "latest";
|
|
469
498
|
var VERSION2 = typeof VERSION !== "undefined" ? VERSION : LATEST;
|
|
470
499
|
var loadLibraryPromises = {};
|
|
471
500
|
async function loadLibrary(libraryUrl, moduleName = null, options = {}) {
|
|
@@ -501,7 +530,11 @@
|
|
|
501
530
|
return await response2.arrayBuffer();
|
|
502
531
|
}
|
|
503
532
|
if (!isBrowser2) {
|
|
504
|
-
|
|
533
|
+
try {
|
|
534
|
+
return node && node.requireFromFile && await node.requireFromFile(libraryUrl);
|
|
535
|
+
} catch {
|
|
536
|
+
return null;
|
|
537
|
+
}
|
|
505
538
|
}
|
|
506
539
|
if (isWorker) {
|
|
507
540
|
return importScripts(libraryUrl);
|
|
@@ -1104,7 +1137,7 @@
|
|
|
1104
1137
|
}
|
|
1105
1138
|
|
|
1106
1139
|
// ../../node_modules/probe.gl/dist/esm/utils/hi-res-timestamp.js
|
|
1107
|
-
function
|
|
1140
|
+
function getHiResTimestamp() {
|
|
1108
1141
|
let timestamp;
|
|
1109
1142
|
if (isBrowser4 && window_3.performance) {
|
|
1110
1143
|
timestamp = window_3.performance.now();
|
|
@@ -1151,8 +1184,8 @@
|
|
|
1151
1184
|
}) {
|
|
1152
1185
|
this.id = id;
|
|
1153
1186
|
this.VERSION = VERSION3;
|
|
1154
|
-
this._startTs =
|
|
1155
|
-
this._deltaTs =
|
|
1187
|
+
this._startTs = getHiResTimestamp();
|
|
1188
|
+
this._deltaTs = getHiResTimestamp();
|
|
1156
1189
|
this.LOG_THROTTLE_TIMEOUT = 0;
|
|
1157
1190
|
this._storage = new LocalStorage("__probe-".concat(this.id, "__"), DEFAULT_SETTINGS);
|
|
1158
1191
|
this.userData = {};
|
|
@@ -1173,10 +1206,10 @@
|
|
|
1173
1206
|
return this._storage.config.level;
|
|
1174
1207
|
}
|
|
1175
1208
|
getTotal() {
|
|
1176
|
-
return Number((
|
|
1209
|
+
return Number((getHiResTimestamp() - this._startTs).toPrecision(10));
|
|
1177
1210
|
}
|
|
1178
1211
|
getDelta() {
|
|
1179
|
-
return Number((
|
|
1212
|
+
return Number((getHiResTimestamp() - this._deltaTs).toPrecision(10));
|
|
1180
1213
|
}
|
|
1181
1214
|
set priority(newPriority) {
|
|
1182
1215
|
this.level = newPriority;
|
|
@@ -1331,11 +1364,11 @@
|
|
|
1331
1364
|
assert3(method);
|
|
1332
1365
|
opts.total = this.getTotal();
|
|
1333
1366
|
opts.delta = this.getDelta();
|
|
1334
|
-
this._deltaTs =
|
|
1367
|
+
this._deltaTs = getHiResTimestamp();
|
|
1335
1368
|
const tag = opts.tag || opts.message;
|
|
1336
1369
|
if (opts.once) {
|
|
1337
1370
|
if (!cache[tag]) {
|
|
1338
|
-
cache[tag] =
|
|
1371
|
+
cache[tag] = getHiResTimestamp();
|
|
1339
1372
|
} else {
|
|
1340
1373
|
return noop;
|
|
1341
1374
|
}
|
|
@@ -5604,10 +5637,10 @@
|
|
|
5604
5637
|
}
|
|
5605
5638
|
|
|
5606
5639
|
// ../textures/src/lib/utils/version.ts
|
|
5607
|
-
var VERSION6 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "
|
|
5640
|
+
var VERSION6 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
5608
5641
|
|
|
5609
5642
|
// ../textures/src/lib/parsers/basis-module-loader.ts
|
|
5610
|
-
var VERSION7 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "
|
|
5643
|
+
var VERSION7 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
5611
5644
|
var BASIS_CDN_ENCODER_WASM = `https://unpkg.com/@loaders.gl/textures@${VERSION7}/dist/libs/basis_encoder.wasm`;
|
|
5612
5645
|
var BASIS_CDN_ENCODER_JS = `https://unpkg.com/@loaders.gl/textures@${VERSION7}/dist/libs/basis_encoder.js`;
|
|
5613
5646
|
var loadBasisTranscoderPromise;
|
|
@@ -6015,7 +6048,7 @@
|
|
|
6015
6048
|
});
|
|
6016
6049
|
}
|
|
6017
6050
|
|
|
6018
|
-
// ../textures/src/lib/parsers/parse-basis.
|
|
6051
|
+
// ../textures/src/lib/parsers/parse-basis.ts
|
|
6019
6052
|
var OutputFormat = {
|
|
6020
6053
|
etc1: {
|
|
6021
6054
|
basisFormat: 0,
|
|
@@ -6548,6 +6581,25 @@
|
|
|
6548
6581
|
}
|
|
6549
6582
|
};
|
|
6550
6583
|
|
|
6584
|
+
// src/types.ts
|
|
6585
|
+
var DATA_TYPE;
|
|
6586
|
+
(function(DATA_TYPE2) {
|
|
6587
|
+
DATA_TYPE2["UInt8"] = "UInt8";
|
|
6588
|
+
DATA_TYPE2["UInt16"] = "UInt16";
|
|
6589
|
+
DATA_TYPE2["UInt32"] = "UInt32";
|
|
6590
|
+
DATA_TYPE2["UInt64"] = "UInt64";
|
|
6591
|
+
DATA_TYPE2["Int16"] = "Int16";
|
|
6592
|
+
DATA_TYPE2["Int32"] = "Int32";
|
|
6593
|
+
DATA_TYPE2["Int64"] = "Int64";
|
|
6594
|
+
DATA_TYPE2["Float32"] = "Float32";
|
|
6595
|
+
DATA_TYPE2["Float64"] = "Float64";
|
|
6596
|
+
})(DATA_TYPE || (DATA_TYPE = {}));
|
|
6597
|
+
var HeaderAttributeProperty;
|
|
6598
|
+
(function(HeaderAttributeProperty2) {
|
|
6599
|
+
HeaderAttributeProperty2["vertexCount"] = "vertexCount";
|
|
6600
|
+
HeaderAttributeProperty2["featureCount"] = "featureCount";
|
|
6601
|
+
})(HeaderAttributeProperty || (HeaderAttributeProperty = {}));
|
|
6602
|
+
|
|
6551
6603
|
// src/lib/utils/url-utils.ts
|
|
6552
6604
|
function getUrlWithToken(url, token = null) {
|
|
6553
6605
|
return token ? `${url}?token=${token}` : url;
|
|
@@ -7171,20 +7223,6 @@
|
|
|
7171
7223
|
GPU_DISJOINT_EXT: 36795
|
|
7172
7224
|
};
|
|
7173
7225
|
|
|
7174
|
-
// src/types.ts
|
|
7175
|
-
var DATA_TYPE;
|
|
7176
|
-
(function(DATA_TYPE2) {
|
|
7177
|
-
DATA_TYPE2["UInt8"] = "UInt8";
|
|
7178
|
-
DATA_TYPE2["UInt16"] = "UInt16";
|
|
7179
|
-
DATA_TYPE2["UInt32"] = "UInt32";
|
|
7180
|
-
DATA_TYPE2["UInt64"] = "UInt64";
|
|
7181
|
-
DATA_TYPE2["Int16"] = "Int16";
|
|
7182
|
-
DATA_TYPE2["Int32"] = "Int32";
|
|
7183
|
-
DATA_TYPE2["Int64"] = "Int64";
|
|
7184
|
-
DATA_TYPE2["Float32"] = "Float32";
|
|
7185
|
-
DATA_TYPE2["Float64"] = "Float64";
|
|
7186
|
-
})(DATA_TYPE || (DATA_TYPE = {}));
|
|
7187
|
-
|
|
7188
7226
|
// src/lib/parsers/constants.ts
|
|
7189
7227
|
function getConstructorForDataFormat(dataType) {
|
|
7190
7228
|
switch (dataType) {
|
|
@@ -7199,7 +7237,7 @@
|
|
|
7199
7237
|
case DATA_TYPE.UInt64:
|
|
7200
7238
|
return Float64Array;
|
|
7201
7239
|
default:
|
|
7202
|
-
|
|
7240
|
+
throw new Error(`parse i3s tile content: unknown type of data: ${dataType}`);
|
|
7203
7241
|
}
|
|
7204
7242
|
}
|
|
7205
7243
|
var GL_TYPE_MAP = {
|
|
@@ -7209,22 +7247,6 @@
|
|
|
7209
7247
|
UInt32: esm_default2.UNSIGNED_INT,
|
|
7210
7248
|
UInt64: esm_default2.DOUBLE
|
|
7211
7249
|
};
|
|
7212
|
-
var I3S_NAMED_VERTEX_ATTRIBUTES = {
|
|
7213
|
-
position: "position",
|
|
7214
|
-
normal: "normal",
|
|
7215
|
-
uv0: "uv0",
|
|
7216
|
-
color: "color",
|
|
7217
|
-
region: "region"
|
|
7218
|
-
};
|
|
7219
|
-
var I3S_NAMED_GEOMETRY_ATTRIBUTES = {
|
|
7220
|
-
vertexAttributes: "vertexAttributes",
|
|
7221
|
-
featureAttributeOrder: "featureAttributeOrder",
|
|
7222
|
-
featureAttributes: "featureAttributes"
|
|
7223
|
-
};
|
|
7224
|
-
var I3S_NAMED_HEADER_ATTRIBUTES = {
|
|
7225
|
-
vertexCount: "vertexCount",
|
|
7226
|
-
featureCount: "featureCount"
|
|
7227
|
-
};
|
|
7228
7250
|
function sizeOf(dataType) {
|
|
7229
7251
|
switch (dataType) {
|
|
7230
7252
|
case DATA_TYPE.UInt8:
|
|
@@ -7241,7 +7263,7 @@
|
|
|
7241
7263
|
case DATA_TYPE.Float64:
|
|
7242
7264
|
return 8;
|
|
7243
7265
|
default:
|
|
7244
|
-
|
|
7266
|
+
throw new Error(`parse i3s tile content: unknown size of data: ${dataType}`);
|
|
7245
7267
|
}
|
|
7246
7268
|
}
|
|
7247
7269
|
var COORDINATE_SYSTEM;
|
|
@@ -7257,27 +7279,25 @@
|
|
|
7257
7279
|
var scratchVector5 = new Vector3([0, 0, 0]);
|
|
7258
7280
|
function getLoaderForTextureFormat(textureFormat) {
|
|
7259
7281
|
switch (textureFormat) {
|
|
7260
|
-
case "jpeg":
|
|
7261
|
-
case "png":
|
|
7262
|
-
return ImageLoader;
|
|
7263
7282
|
case "ktx-etc2":
|
|
7264
7283
|
case "dds":
|
|
7265
7284
|
return CompressedTextureLoader;
|
|
7266
7285
|
case "ktx2":
|
|
7267
7286
|
return BasisLoader;
|
|
7287
|
+
case "jpg":
|
|
7288
|
+
case "png":
|
|
7268
7289
|
default:
|
|
7269
|
-
return
|
|
7290
|
+
return ImageLoader;
|
|
7270
7291
|
}
|
|
7271
7292
|
}
|
|
7272
7293
|
var I3S_ATTRIBUTE_TYPE = "i3s-attribute-type";
|
|
7273
7294
|
async function parseI3STileContent(arrayBuffer, tile, tileset, options, context) {
|
|
7274
7295
|
tile.content = tile.content || {};
|
|
7275
7296
|
tile.content.featureIds = tile.content.featureIds || null;
|
|
7276
|
-
tile.content.featureData = constructFeatureDataStruct(tileset);
|
|
7277
7297
|
tile.content.attributes = {};
|
|
7278
7298
|
if (tile.textureUrl) {
|
|
7279
7299
|
const url = getUrlWithToken(tile.textureUrl, options?.i3s?.token);
|
|
7280
|
-
const loader = getLoaderForTextureFormat(tile.textureFormat)
|
|
7300
|
+
const loader = getLoaderForTextureFormat(tile.textureFormat);
|
|
7281
7301
|
const response = await fetch(url);
|
|
7282
7302
|
const arrayBuffer2 = await response.arrayBuffer();
|
|
7283
7303
|
if (options?.i3s.decodeTextures) {
|
|
@@ -7306,9 +7326,9 @@
|
|
|
7306
7326
|
if (tile.content.material) {
|
|
7307
7327
|
tile.content.texture = null;
|
|
7308
7328
|
}
|
|
7309
|
-
return await parseI3SNodeGeometry(arrayBuffer, tile, options);
|
|
7329
|
+
return await parseI3SNodeGeometry(arrayBuffer, tile, tileset, options);
|
|
7310
7330
|
}
|
|
7311
|
-
async function parseI3SNodeGeometry(arrayBuffer, tile, options) {
|
|
7331
|
+
async function parseI3SNodeGeometry(arrayBuffer, tile, tileset, options) {
|
|
7312
7332
|
if (!tile.content) {
|
|
7313
7333
|
return tile;
|
|
7314
7334
|
}
|
|
@@ -7317,6 +7337,7 @@
|
|
|
7317
7337
|
let vertexCount;
|
|
7318
7338
|
let byteOffset = 0;
|
|
7319
7339
|
let featureCount = 0;
|
|
7340
|
+
let indices;
|
|
7320
7341
|
if (tile.isDracoGeometry) {
|
|
7321
7342
|
const decompressedGeometry = await parse(arrayBuffer, DracoLoader2, {
|
|
7322
7343
|
draco: {
|
|
@@ -7324,7 +7345,7 @@
|
|
|
7324
7345
|
}
|
|
7325
7346
|
});
|
|
7326
7347
|
vertexCount = decompressedGeometry.header.vertexCount;
|
|
7327
|
-
|
|
7348
|
+
indices = decompressedGeometry.indices?.value;
|
|
7328
7349
|
const {
|
|
7329
7350
|
POSITION,
|
|
7330
7351
|
NORMAL,
|
|
@@ -7339,8 +7360,7 @@
|
|
|
7339
7360
|
color: COLOR_0,
|
|
7340
7361
|
uv0: TEXCOORD_0,
|
|
7341
7362
|
uvRegion,
|
|
7342
|
-
id: featureIndex
|
|
7343
|
-
indices
|
|
7363
|
+
id: featureIndex
|
|
7344
7364
|
};
|
|
7345
7365
|
updateAttributesMetadata(attributes, decompressedGeometry);
|
|
7346
7366
|
const featureIds = getFeatureIdsFromFeatureIndexMetadata(featureIndex);
|
|
@@ -7348,8 +7368,13 @@
|
|
|
7348
7368
|
flattenFeatureIdsByFeatureIndices(attributes, featureIds);
|
|
7349
7369
|
}
|
|
7350
7370
|
} else {
|
|
7351
|
-
const {
|
|
7352
|
-
|
|
7371
|
+
const {
|
|
7372
|
+
vertexAttributes,
|
|
7373
|
+
ordering: attributesOrder,
|
|
7374
|
+
featureAttributes,
|
|
7375
|
+
featureAttributeOrder
|
|
7376
|
+
} = tileset.store.defaultGeometrySchema;
|
|
7377
|
+
const headers = parseHeaders(tileset, arrayBuffer);
|
|
7353
7378
|
byteOffset = headers.byteOffset;
|
|
7354
7379
|
vertexCount = headers.vertexCount;
|
|
7355
7380
|
featureCount = headers.featureCount;
|
|
@@ -7373,7 +7398,7 @@
|
|
|
7373
7398
|
texCoords: attributes.uv0,
|
|
7374
7399
|
uvRegions: normalizeAttribute(attributes.uvRegion)
|
|
7375
7400
|
};
|
|
7376
|
-
content.indices =
|
|
7401
|
+
content.indices = indices || null;
|
|
7377
7402
|
if (attributes.id && attributes.id.value) {
|
|
7378
7403
|
tile.content.featureIds = attributes.id.value;
|
|
7379
7404
|
}
|
|
@@ -7411,41 +7436,25 @@
|
|
|
7411
7436
|
attribute.normalized = true;
|
|
7412
7437
|
return attribute;
|
|
7413
7438
|
}
|
|
7414
|
-
function
|
|
7415
|
-
const defaultGeometrySchema = tileset.store.defaultGeometrySchema;
|
|
7416
|
-
const featureData = defaultGeometrySchema;
|
|
7417
|
-
for (const geometryAttribute in I3S_NAMED_GEOMETRY_ATTRIBUTES) {
|
|
7418
|
-
for (const namedAttribute in I3S_NAMED_VERTEX_ATTRIBUTES) {
|
|
7419
|
-
const attribute = defaultGeometrySchema[geometryAttribute][namedAttribute];
|
|
7420
|
-
if (attribute) {
|
|
7421
|
-
const { byteOffset = 0, count = 0, valueType, valuesPerElement } = attribute;
|
|
7422
|
-
featureData[geometryAttribute][namedAttribute] = {
|
|
7423
|
-
valueType,
|
|
7424
|
-
valuesPerElement,
|
|
7425
|
-
byteOffset,
|
|
7426
|
-
count
|
|
7427
|
-
};
|
|
7428
|
-
}
|
|
7429
|
-
}
|
|
7430
|
-
}
|
|
7431
|
-
featureData.attributesOrder = defaultGeometrySchema.ordering;
|
|
7432
|
-
return featureData;
|
|
7433
|
-
}
|
|
7434
|
-
function parseHeaders(content, arrayBuffer) {
|
|
7439
|
+
function parseHeaders(tileset, arrayBuffer) {
|
|
7435
7440
|
let byteOffset = 0;
|
|
7436
7441
|
let vertexCount = 0;
|
|
7437
7442
|
let featureCount = 0;
|
|
7438
|
-
|
|
7443
|
+
for (const { property, type } of tileset.store.defaultGeometrySchema.header) {
|
|
7439
7444
|
const TypedArrayTypeHeader = getConstructorForDataFormat(type);
|
|
7440
|
-
|
|
7441
|
-
vertexCount
|
|
7442
|
-
|
|
7443
|
-
|
|
7444
|
-
|
|
7445
|
-
featureCount
|
|
7446
|
-
|
|
7445
|
+
switch (property) {
|
|
7446
|
+
case HeaderAttributeProperty.vertexCount:
|
|
7447
|
+
vertexCount = new TypedArrayTypeHeader(arrayBuffer, 0, 4)[0];
|
|
7448
|
+
byteOffset += sizeOf(type);
|
|
7449
|
+
break;
|
|
7450
|
+
case HeaderAttributeProperty.featureCount:
|
|
7451
|
+
featureCount = new TypedArrayTypeHeader(arrayBuffer, 4, 4)[0];
|
|
7452
|
+
byteOffset += sizeOf(type);
|
|
7453
|
+
break;
|
|
7454
|
+
default:
|
|
7455
|
+
break;
|
|
7447
7456
|
}
|
|
7448
|
-
}
|
|
7457
|
+
}
|
|
7449
7458
|
return {
|
|
7450
7459
|
vertexCount,
|
|
7451
7460
|
featureCount,
|
|
@@ -7462,7 +7471,7 @@
|
|
|
7462
7471
|
break;
|
|
7463
7472
|
}
|
|
7464
7473
|
const buffer = arrayBuffer.slice(byteOffset);
|
|
7465
|
-
let value
|
|
7474
|
+
let value;
|
|
7466
7475
|
if (valueType === "UInt64") {
|
|
7467
7476
|
value = parseUint64Values(buffer, count * valuesPerElement, sizeOf(valueType));
|
|
7468
7477
|
} else {
|
|
@@ -7499,7 +7508,7 @@
|
|
|
7499
7508
|
values.push(value);
|
|
7500
7509
|
offset += attributeSize;
|
|
7501
7510
|
}
|
|
7502
|
-
return values;
|
|
7511
|
+
return new Uint32Array(values);
|
|
7503
7512
|
}
|
|
7504
7513
|
function parsePositions(attribute, tile) {
|
|
7505
7514
|
const mbs = tile.mbs;
|
|
@@ -7566,7 +7575,9 @@
|
|
|
7566
7575
|
if (pbrMaterial.pbrMetallicRoughness && pbrMaterial.pbrMetallicRoughness.baseColorFactor) {
|
|
7567
7576
|
pbrMaterial.pbrMetallicRoughness.baseColorFactor = convertColorFormat(pbrMaterial.pbrMetallicRoughness.baseColorFactor);
|
|
7568
7577
|
}
|
|
7569
|
-
|
|
7578
|
+
if (texture) {
|
|
7579
|
+
setMaterialTexture(pbrMaterial, texture);
|
|
7580
|
+
}
|
|
7570
7581
|
return pbrMaterial;
|
|
7571
7582
|
}
|
|
7572
7583
|
function convertColorFormat(colorFactor) {
|
|
@@ -7628,11 +7639,11 @@
|
|
|
7628
7639
|
attributes.id.value = result;
|
|
7629
7640
|
}
|
|
7630
7641
|
function getFeatureIdsFromFeatureIndexMetadata(featureIndex) {
|
|
7631
|
-
return featureIndex
|
|
7642
|
+
return featureIndex?.metadata?.["i3s-feature-ids"]?.intArray;
|
|
7632
7643
|
}
|
|
7633
7644
|
|
|
7634
7645
|
// src/i3s-content-loader.ts
|
|
7635
|
-
var VERSION8 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "
|
|
7646
|
+
var VERSION8 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
7636
7647
|
var I3SContentLoader = {
|
|
7637
7648
|
name: "I3S Content (Indexed Scene Layers)",
|
|
7638
7649
|
id: "i3s-content",
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ export { I3SLoader } from './i3s-loader';
|
|
|
2
2
|
export { I3SContentLoader } from './i3s-content-loader';
|
|
3
3
|
export { I3SAttributeLoader, loadFeatureAttributes } from './i3s-attribute-loader';
|
|
4
4
|
export { I3SBuildingSceneLayerLoader } from './i3s-building-scene-layer-loader';
|
|
5
|
-
export type { BoundingVolumes, Mbs, Obb, SceneLayer3D, AttributeStorageInfo, Field, ESRIField, PopupInfo, Node3DIndexDocument, LodSelection, NodeReference, Resource,
|
|
5
|
+
export type { BoundingVolumes, Mbs, Obb, SceneLayer3D, AttributeStorageInfo, Field, ESRIField, PopupInfo, Node3DIndexDocument, LodSelection, NodeReference, Resource, MaxScreenThresholdSQ, NodeInPage, SharedResources, Attribute, Extent, FeatureAttribute, FieldInfo, I3SMaterialDefinition } from './types';
|
|
6
6
|
export { COORDINATE_SYSTEM } from './lib/parsers/constants';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AACvC,OAAO,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAC,kBAAkB,EAAE,qBAAqB,EAAC,MAAM,wBAAwB,CAAC;AACjF,OAAO,EAAC,2BAA2B,EAAC,MAAM,mCAAmC,CAAC;AAC9E,YAAY,EACV,eAAe,EACf,GAAG,EACH,GAAG,EACH,YAAY,EACZ,oBAAoB,EACpB,KAAK,EACL,SAAS,EACT,SAAS,EACT,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AACvC,OAAO,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAC,kBAAkB,EAAE,qBAAqB,EAAC,MAAM,wBAAwB,CAAC;AACjF,OAAO,EAAC,2BAA2B,EAAC,MAAM,mCAAmC,CAAC;AAC9E,YAAY,EACV,eAAe,EACf,GAAG,EACH,GAAG,EACH,YAAY,EACZ,oBAAoB,EACpB,KAAK,EACL,SAAS,EACT,SAAS,EACT,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,oBAAoB,EACpB,UAAU,EACV,eAAe,EACf,SAAS,EACT,MAAM,EACN,gBAAgB,EAChB,SAAS,EACT,qBAAqB,EACtB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAC"}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { LoaderOptions } from '@loaders.gl/loader-utils';
|
|
2
|
+
import { I3STilesetHeader, NodePage, NodeInPage, I3STextureFormat, I3STileHeader } from '../../types';
|
|
2
3
|
/**
|
|
3
4
|
* class I3SNodePagesTiles - loads nodePages and form i3s tiles from them
|
|
4
5
|
*/
|
|
5
6
|
export default class I3SNodePagesTiles {
|
|
6
|
-
tileset:
|
|
7
|
+
tileset: I3STilesetHeader;
|
|
7
8
|
nodePages: NodePage[];
|
|
8
9
|
pendingNodePages: {
|
|
9
10
|
promise: Promise<NodePage>;
|
|
10
11
|
status: 'Pending' | 'Done';
|
|
11
12
|
}[];
|
|
12
13
|
nodesPerPage: number;
|
|
13
|
-
options:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
options: LoaderOptions;
|
|
15
|
+
lodSelectionMetricType?: string;
|
|
16
|
+
textureDefinitionsSelectedFormats: ({
|
|
17
|
+
format: I3STextureFormat;
|
|
18
|
+
name: string;
|
|
19
|
+
} | null)[];
|
|
18
20
|
private textureLoaderOptions;
|
|
19
21
|
/**
|
|
20
22
|
* @constructs
|
|
@@ -22,37 +24,35 @@ export default class I3SNodePagesTiles {
|
|
|
22
24
|
* @param tileset - i3s tileset header ('layers/0')
|
|
23
25
|
* @param options - i3s loader options
|
|
24
26
|
*/
|
|
25
|
-
constructor(tileset:
|
|
27
|
+
constructor(tileset: I3STilesetHeader, options: LoaderOptions);
|
|
26
28
|
/**
|
|
27
29
|
* Loads some nodePage and return a particular node from it
|
|
28
30
|
* @param id - id of node through all node pages
|
|
29
31
|
*/
|
|
30
|
-
getNodeById(id: number): Promise<
|
|
32
|
+
getNodeById(id: number): Promise<NodeInPage>;
|
|
31
33
|
/**
|
|
32
34
|
* Forms tile header using node and tileset data
|
|
33
35
|
* @param id - id of node through all node pages
|
|
34
36
|
*/
|
|
35
|
-
formTileFromNodePages(id: number): Promise<
|
|
37
|
+
formTileFromNodePages(id: number): Promise<I3STileHeader>;
|
|
36
38
|
/**
|
|
37
39
|
* Forms url and type of geometry resource by nodepage's data and `geometryDefinitions` in the tileset
|
|
38
|
-
* @param
|
|
39
|
-
* @returns
|
|
40
|
+
* @param - data about the node's mesh from the nodepage
|
|
41
|
+
* @returns -
|
|
40
42
|
* {string} url - url to the geometry resource
|
|
41
43
|
* {boolean} isDracoGeometry - whether the geometry resource contain DRACO compressed geometry
|
|
42
44
|
*/
|
|
43
45
|
private getContentUrl;
|
|
44
46
|
/**
|
|
45
47
|
* Forms 1.6 compatible LOD selection object from a nodepage's node data
|
|
46
|
-
* @param
|
|
47
|
-
* @returns
|
|
48
|
-
* {string} metricType - the label of the LOD metric
|
|
49
|
-
* {number} maxError - the value of the metric
|
|
48
|
+
* @param node - a node from nodepage
|
|
49
|
+
* @returns- Array of LodSelection
|
|
50
50
|
*/
|
|
51
51
|
private getLodSelection;
|
|
52
52
|
/**
|
|
53
53
|
* Returns information about texture and material from `materialDefinitions`
|
|
54
|
-
* @param
|
|
55
|
-
* @returns
|
|
54
|
+
* @param material - material data from nodepage
|
|
55
|
+
* @returns - Couple {textureData, materialDefinition}
|
|
56
56
|
* {string} textureData.name - path name of the texture
|
|
57
57
|
* {string} textureData.format - format of the texture
|
|
58
58
|
* materialDefinition - PBR-like material definition from `materialDefinitions`
|
|
@@ -60,8 +60,8 @@ export default class I3SNodePagesTiles {
|
|
|
60
60
|
private getInformationFromMaterial;
|
|
61
61
|
/**
|
|
62
62
|
* Sets preferable and supported format for each textureDefinition of the tileset
|
|
63
|
-
* @param
|
|
64
|
-
* @returns
|
|
63
|
+
* @param tileset - I3S layer data
|
|
64
|
+
* @returns
|
|
65
65
|
*/
|
|
66
66
|
private initSelectedFormatsForTextureDefinitions;
|
|
67
67
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i3s-nodepages-tiles.d.ts","sourceRoot":"","sources":["../../../src/lib/helpers/i3s-nodepages-tiles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"i3s-nodepages-tiles.d.ts","sourceRoot":"","sources":["../../../src/lib/helpers/i3s-nodepages-tiles.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EACL,gBAAgB,EAEhB,QAAQ,EACR,UAAU,EAIV,gBAAgB,EAEhB,aAAa,EACd,MAAM,aAAa,CAAC;AAErB;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAiB;IACpC,OAAO,EAAE,gBAAgB,CAAC;IAC1B,SAAS,EAAE,QAAQ,EAAE,CAAM;IAC3B,gBAAgB,EAAE;QAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;QAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAA;KAAC,EAAE,CAAM;IAClF,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,aAAa,CAAC;IACvB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,iCAAiC,EAAE,CAAC;QAAC,MAAM,EAAE,gBAAgB,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,GAAG,IAAI,CAAC,EAAE,CAAM;IAC5F,OAAO,CAAC,oBAAoB,CAA4B;IAExD;;;;;OAKG;gBACS,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,aAAa;IAS7D;;;OAGG;IACG,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAqBlD;;;OAGG;IAEG,qBAAqB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAuD/D;;;;;;OAMG;IACH,OAAO,CAAC,aAAa;IA6BrB;;;;OAIG;IACH,OAAO,CAAC,eAAe;IAiBvB;;;;;;;OAOG;IACH,OAAO,CAAC,0BAA0B;IAuBlC;;;;OAIG;IACH,OAAO,CAAC,wCAAwC;IA2BhD;;;OAGG;IACH,OAAO,CAAC,0BAA0B;CAuBnC"}
|