@loaders.gl/i3s 3.1.8 → 3.2.0-alpha.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/dist.min.js +130 -64
- package/dist/es5/i3s-attribute-loader.js +1 -1
- package/dist/es5/i3s-attribute-loader.js.map +1 -1
- package/dist/es5/i3s-building-scene-layer-loader.js +1 -1
- package/dist/es5/i3s-building-scene-layer-loader.js.map +1 -1
- package/dist/es5/i3s-content-loader.js +1 -1
- package/dist/es5/i3s-content-loader.js.map +1 -1
- package/dist/es5/i3s-loader.js +1 -1
- package/dist/es5/i3s-loader.js.map +1 -1
- package/dist/es5/i3s-node-page-loader.js +1 -1
- package/dist/es5/i3s-node-page-loader.js.map +1 -1
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/lib/helpers/i3s-nodepages-tiles.js +43 -52
- package/dist/es5/lib/helpers/i3s-nodepages-tiles.js.map +1 -1
- package/dist/es5/lib/parsers/parse-i3s-tile-content.js +56 -51
- package/dist/es5/lib/parsers/parse-i3s-tile-content.js.map +1 -1
- package/dist/es5/lib/parsers/parse-i3s.js +8 -12
- package/dist/es5/lib/parsers/parse-i3s.js.map +1 -1
- 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 +8 -2
- package/dist/esm/lib/helpers/i3s-nodepages-tiles.js.map +1 -1
- package/dist/esm/lib/parsers/parse-i3s-tile-content.js +35 -30
- package/dist/esm/lib/parsers/parse-i3s-tile-content.js.map +1 -1
- package/dist/esm/lib/parsers/parse-i3s.js +1 -1
- package/dist/esm/lib/parsers/parse-i3s.js.map +1 -1
- 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 +154 -71
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/lib/helpers/i3s-nodepages-tiles.d.ts.map +1 -1
- package/dist/lib/helpers/i3s-nodepages-tiles.js +7 -3
- package/dist/lib/parsers/parse-i3s-tile-content.d.ts.map +1 -1
- package/dist/lib/parsers/parse-i3s-tile-content.js +35 -30
- package/dist/lib/parsers/parse-i3s.js +1 -1
- package/dist/types.d.ts +100 -34
- package/dist/types.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/i3s-building-scene-layer-loader.ts +1 -1
- package/src/i3s-content-loader.ts +1 -1
- package/src/index.ts +4 -1
- package/src/lib/helpers/i3s-nodepages-tiles.ts +8 -3
- package/src/lib/parsers/parse-i3s-tile-content.ts +39 -33
- package/src/lib/parsers/parse-i3s.ts +1 -1
- package/src/types.ts +97 -34
package/dist/esm/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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"}
|
|
1
|
+
{"version":3,"sources":["../../src/types.ts"],"names":["DATA_TYPE","HeaderAttributeProperty"],"mappings":"AAGA,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;;AAoqBZ,WAAYC,uBAAZ;;WAAYA,uB;AAAAA,EAAAA,uB;AAAAA,EAAAA,uB;GAAAA,uB,KAAAA,uB","sourcesContent":["import type {Matrix4, Quaternion, Vector3} from '@math.gl/core';\nimport type {TypedArray, MeshAttribute, TextureLevel} 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 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\n/**\n * https://github.com/Esri/i3s-spec/blob/master/docs/1.8/materialDefinitionInfo.cmn.md\n */\nexport type MaterialDefinitionInfo = {\n /** A name for the material as assigned in the creating application. */\n name?: string;\n /** Indicates the material type, chosen from the supported values. */\n type?: 'standard' | 'water' | 'billboard' | 'leafcard' | 'reference';\n /** The href that resolves to the shared resource bundle in which the material definition is contained. */\n $ref?: string;\n /** Parameter defined for the material.\n * https://github.com/Esri/i3s-spec/blob/master/docs/1.8/materialParams.cmn.md\n */\n params: {\n /** Indicates transparency of this material; 0 = opaque, 1 = fully transparent. */\n transparency?: number;\n /** Indicates reflectivity of this material. */\n reflectivity?: number;\n /** Indicates shininess of this material. */\n shininess?: number;\n /** Ambient color of this material. Ambient color is the color of an object where it is in shadow.\n * This color is what the object reflects when illuminated by ambient light rather than direct light. */\n ambient?: number[];\n /** Diffuse color of this material. Diffuse color is the most instinctive meaning of the color of an object.\n * It is that essential color that the object reveals under pure white light. It is perceived as the color\n * of the object itself rather than a reflection of the light. */\n diffuse?: number[];\n /** Specular color of this material. Specular color is the color of the light of a specular reflection\n * (specular reflection is the type of reflection that is characteristic of light reflected from a shiny\n * surface). */\n specular?: number[];\n /** Rendering mode. */\n renderMode: 'textured' | 'solid' | 'untextured' | 'wireframe';\n /** TRUE if features with this material should cast shadows. */\n castShadows?: boolean;\n /** TRUE if features with this material should receive shadows */\n receiveShadows?: boolean;\n /** Indicates the material culling options {back, front, none}. */\n cullFace?: string;\n /** This flag indicates that the vertex color attribute of the geometry should be used to color the geometry\n * for rendering. If texture is present, the vertex colors are multiplied by this color.\n * e.g. pixel_color = [interpolated]vertex_color * texel_color. Default is false. */\n vertexColors?: boolean;\n /** This flag indicates that the geometry has uv region vertex attributes. These are used for adressing\n * subtextures in a texture atlas. The uv coordinates are relative to this subtexture in this case.\n * This is mostly useful for repeated textures in a texture atlas. Default is false. */\n vertexRegions?: boolean;\n /** Indicates whether Vertex Colors also contain a transparency channel. Default is false. */\n useVertexColorAlpha?: boolean;\n };\n};\n\n/** https://github.com/Esri/i3s-spec/blob/master/docs/1.8/sharedResource.cmn.md */\nexport type SharedResources = {\n /** Materials describe how a Feature or a set of Features is to be rendered. */\n materialDefinitions?: {[key: string]: MaterialDefinitionInfo};\n /** A Texture is a set of images, with some parameters specific to the texture/uv mapping to geometries. */\n textureDefinitions?: {[key: string]: TextureDefinitionInfo};\n};\n\n/** https://github.com/Esri/i3s-spec/blob/master/docs/1.8/image.cmn.md */\ntype TextureImage = {\n /** A unique ID for each image. Generated using the BuildID function. */\n id: string;\n /** width of this image, in pixels. */\n size?: number;\n /** The maximum size of a single pixel in world units.\n * This property is used by the client to pick the image to load and render. */\n pixelInWorldUnits?: number;\n /** The href to the image(s), one per encoding, in the same order as the encodings. */\n href?: string[];\n /** The byte offset of this image's encodings. There is one per encoding,\n * in the same order as the encodings, in the block in which this texture image resides. */\n byteOffset?: string[];\n /** The length in bytes of this image's encodings. There is one per encoding,\n * in the same order as the encodings. */\n length?: number[];\n};\n\nexport type Attribute = 'OBJECTID' | 'string' | 'double' | 'Int32' | string;\n\nexport type Extent = [number, number, number, number];\n\nexport type FeatureAttribute = {\n id: AttributeValue;\n faceRange: AttributeValue;\n};\n\nexport type BuildingSceneLayerTileset = {\n header: BuildingSceneLayer;\n sublayers: BuildingSceneSublayer[];\n};\n\nexport type BuildingSceneLayer = {\n id: number;\n name: string;\n version: string;\n alias?: string;\n layerType: 'Building';\n description?: string;\n copyrightText?: string;\n fullExtent: FullExtent;\n spatialReference: SpatialReference;\n heightModelInfo?: HeightModelInfo;\n sublayers: BuildingSceneSublayer[];\n filters?: Filter[];\n activeFilterID?: string;\n statisticsHRef?: string;\n};\n\nexport type BuildingSceneSublayer = {\n id: number;\n name: string;\n alias?: string;\n discipline?: 'Mechanical' | 'Architectural' | 'Piping' | 'Electrical' | 'Structural';\n modelName?: string;\n layerType: 'group' | '3DObject' | 'Point';\n visibility?: boolean;\n sublayers?: BuildingSceneSublayer[];\n isEmpty?: boolean;\n url?: string;\n};\n\ntype Filter = {\n id: string;\n name: string;\n description: string;\n isDefaultFilter?: boolean;\n isVisible?: boolean;\n filterBlocks: FilterBlock[];\n filterAuthoringInfo?: FilterAuthoringInfo;\n};\n\ntype FilterAuthoringInfo = {\n type: string;\n filterBlocks: FilterBlockAuthoringInfo[];\n};\n\ntype FilterBlockAuthoringInfo = {\n filterTypes: FilterType[];\n};\n\ntype FilterType = {\n filterType: string;\n filterValues: string[];\n};\n\ntype FilterBlock = {\n title: string;\n filterMode: FilterModeSolid | FilterModeWireFrame;\n filterExpression: string;\n};\n\ntype Edges = {\n type: string;\n color: number[];\n size: number;\n transparency: number;\n extensionLength: number;\n};\n\ntype FilterModeSolid = {\n type: 'solid';\n};\n\ntype FilterModeWireFrame = {\n type: 'wireFrame';\n edges: Edges;\n};\n\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/spatialReference.cmn.md */\nexport type SpatialReference = {\n /** The current WKID value of the vertical coordinate system. */\n latestVcsWkid: number;\n /** dentifies the current WKID value associated with the same spatial reference. */\n latestWkid: number;\n /** The WKID value of the vertical coordinate system. */\n vcsWkid: number;\n /** WKID, or Well-Known ID, of the CRS. Specify either WKID or WKT of the CRS. */\n wkid: number;\n /** WKT, or Well-Known Text, of the CRS. Specify either WKT or WKID of the CRS but not both. */\n wkt?: string;\n};\n\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/fullExtent.cmn.md */\nexport type FullExtent = {\n /** left longitude in decimal degrees */\n xmin: number;\n /** right longitude in decimal degrees */\n xmax: number;\n /** bottom latitude in decimal degrees*/\n ymin: number;\n /** top latitude in decimal degrees*/\n ymax: number;\n /** lowest elevation in meters */\n zmin: number;\n /** highest elevation in meters */\n zmax: number;\n spatialReference?: SpatialReference;\n};\n\n/**\n * https://github.com/Esri/i3s-spec/blob/master/docs/1.8/textureDefinitionInfo.cmn.md\n */\nexport type TextureDefinitionInfo = {\n /** MIMEtype - The encoding/content type that is used by all images in this map */\n encoding?: string[];\n /** UV wrapping modes, from {none, repeat, mirror}. */\n wrap?: string[];\n /** TRUE if the Map represents a texture atlas. */\n atlas?: boolean;\n /** The name of the UV set to be used as texture coordinates. */\n uvSet?: string;\n /** Indicates channels description. */\n channels?: 'rbg' | 'rgba' | string;\n /** An image is a binary resource, containing a single raster that can be used to texture a feature or symbol. */\n images: TextureImage[];\n};\n\n/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/domain.cmn.md */\ntype Domain = {\n type: string;\n name: string;\n description?: string;\n fieldType?: string;\n range?: [number, number];\n codedValues?: {name: string; code: string | number}[];\n mergePolicy?: string;\n splitPolicy?: string;\n};\n/**\n * spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/store.cmn.md\n */\ntype Store = {\n id: string | number;\n profile: string;\n version: number | string;\n resourcePattern: string[];\n rootNode: string;\n extent: number[];\n indexCRS: string;\n vertexCRS: string;\n normalReferenceFrame: string;\n 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__ : 'beta';
|
|
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__ : 'beta';
|
|
8
8
|
/**
|
|
9
9
|
* Loader for I3S - Indexed 3D Scene Layer
|
|
10
10
|
*/
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
var nodeVersion = matches && parseFloat(matches[1]) || 0;
|
|
56
56
|
|
|
57
57
|
// ../worker-utils/src/lib/env-utils/version.ts
|
|
58
|
-
var VERSION = true ? "3.
|
|
58
|
+
var VERSION = true ? "3.2.0-alpha.3" : DEFAULT_VERSION;
|
|
59
59
|
if (false) {
|
|
60
60
|
console.error("loaders.gl: The __VERSION__ variable is not injected using babel plugin. Latest unstable workers would be fetched from the CDN.");
|
|
61
61
|
}
|
|
@@ -87,13 +87,13 @@
|
|
|
87
87
|
// ../worker-utils/src/lib/worker-farm/worker-job.ts
|
|
88
88
|
var WorkerJob = class {
|
|
89
89
|
constructor(jobName, workerThread) {
|
|
90
|
-
this.name = jobName;
|
|
91
|
-
this.workerThread = workerThread;
|
|
92
90
|
this.isRunning = true;
|
|
93
91
|
this._resolve = () => {
|
|
94
92
|
};
|
|
95
93
|
this._reject = () => {
|
|
96
94
|
};
|
|
95
|
+
this.name = jobName;
|
|
96
|
+
this.workerThread = workerThread;
|
|
97
97
|
this.result = new Promise((resolve, reject) => {
|
|
98
98
|
this._resolve = resolve;
|
|
99
99
|
this._reject = reject;
|
|
@@ -118,6 +118,16 @@
|
|
|
118
118
|
}
|
|
119
119
|
};
|
|
120
120
|
|
|
121
|
+
// ../worker-utils/src/lib/node/worker_threads-browser.js
|
|
122
|
+
var Worker2 = class {
|
|
123
|
+
on(message, cb) {
|
|
124
|
+
}
|
|
125
|
+
postMessage(...args) {
|
|
126
|
+
}
|
|
127
|
+
terminate() {
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
|
|
121
131
|
// ../worker-utils/src/lib/worker-utils/get-loadable-worker-url.ts
|
|
122
132
|
var workerURLCache = new Map();
|
|
123
133
|
function getLoadableWorkerURL(props) {
|
|
@@ -205,10 +215,10 @@
|
|
|
205
215
|
this.url = url;
|
|
206
216
|
this.onMessage = NOOP;
|
|
207
217
|
this.onError = (error) => console.log(error);
|
|
208
|
-
this.worker = this._createBrowserWorker();
|
|
218
|
+
this.worker = isBrowser2 ? this._createBrowserWorker() : this._createNodeWorker();
|
|
209
219
|
}
|
|
210
220
|
static isSupported() {
|
|
211
|
-
return typeof Worker !== "undefined";
|
|
221
|
+
return typeof Worker !== "undefined" && isBrowser2 || typeof Worker2 !== void 0;
|
|
212
222
|
}
|
|
213
223
|
destroy() {
|
|
214
224
|
this.onMessage = NOOP;
|
|
@@ -251,6 +261,27 @@
|
|
|
251
261
|
worker.onmessageerror = (event) => console.error(event);
|
|
252
262
|
return worker;
|
|
253
263
|
}
|
|
264
|
+
_createNodeWorker() {
|
|
265
|
+
let worker;
|
|
266
|
+
if (this.url) {
|
|
267
|
+
const absolute = this.url.includes(":/") || this.url.startsWith("/");
|
|
268
|
+
const url = absolute ? this.url : `./${this.url}`;
|
|
269
|
+
worker = new Worker2(url, { eval: false });
|
|
270
|
+
} else if (this.source) {
|
|
271
|
+
worker = new Worker2(this.source, { eval: true });
|
|
272
|
+
} else {
|
|
273
|
+
throw new Error("no worker");
|
|
274
|
+
}
|
|
275
|
+
worker.on("message", (data) => {
|
|
276
|
+
this.onMessage(data);
|
|
277
|
+
});
|
|
278
|
+
worker.on("error", (error) => {
|
|
279
|
+
this.onError(error);
|
|
280
|
+
});
|
|
281
|
+
worker.on("exit", (code) => {
|
|
282
|
+
});
|
|
283
|
+
return worker;
|
|
284
|
+
}
|
|
254
285
|
};
|
|
255
286
|
|
|
256
287
|
// ../worker-utils/src/lib/worker-farm/worker-pool.ts
|
|
@@ -271,6 +302,9 @@
|
|
|
271
302
|
this.url = props.url;
|
|
272
303
|
this.setProps(props);
|
|
273
304
|
}
|
|
305
|
+
static isSupported() {
|
|
306
|
+
return WorkerThread.isSupported();
|
|
307
|
+
}
|
|
274
308
|
destroy() {
|
|
275
309
|
this.idleQueue.forEach((worker) => worker.destroy());
|
|
276
310
|
this.isDestroyed = true;
|
|
@@ -360,9 +394,9 @@
|
|
|
360
394
|
var DEFAULT_PROPS = {
|
|
361
395
|
maxConcurrency: 3,
|
|
362
396
|
maxMobileConcurrency: 1,
|
|
397
|
+
reuseWorkers: true,
|
|
363
398
|
onDebug: () => {
|
|
364
|
-
}
|
|
365
|
-
reuseWorkers: true
|
|
399
|
+
}
|
|
366
400
|
};
|
|
367
401
|
var WorkerFarm = class {
|
|
368
402
|
constructor(props) {
|
|
@@ -383,6 +417,7 @@
|
|
|
383
417
|
for (const workerPool of this.workerPools.values()) {
|
|
384
418
|
workerPool.destroy();
|
|
385
419
|
}
|
|
420
|
+
this.workerPools = new Map();
|
|
386
421
|
}
|
|
387
422
|
setProps(props) {
|
|
388
423
|
this.props = { ...this.props, ...props };
|
|
@@ -415,16 +450,33 @@
|
|
|
415
450
|
};
|
|
416
451
|
|
|
417
452
|
// ../worker-utils/src/lib/worker-farm/worker-body.ts
|
|
453
|
+
function getParentPort() {
|
|
454
|
+
let parentPort;
|
|
455
|
+
try {
|
|
456
|
+
eval("globalThis.parentPort = require('worker_threads').parentPort");
|
|
457
|
+
parentPort = globalThis.parentPort;
|
|
458
|
+
} catch {
|
|
459
|
+
}
|
|
460
|
+
return parentPort;
|
|
461
|
+
}
|
|
418
462
|
var onMessageWrapperMap = new Map();
|
|
419
463
|
var WorkerBody = class {
|
|
464
|
+
static inWorkerThread() {
|
|
465
|
+
return typeof self !== "undefined" || Boolean(getParentPort());
|
|
466
|
+
}
|
|
420
467
|
static set onmessage(onMessage2) {
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
}
|
|
425
|
-
const { type, payload } = message.data;
|
|
468
|
+
function handleMessage(message) {
|
|
469
|
+
const parentPort3 = getParentPort();
|
|
470
|
+
const { type, payload } = parentPort3 ? message : message.data;
|
|
426
471
|
onMessage2(type, payload);
|
|
427
|
-
}
|
|
472
|
+
}
|
|
473
|
+
const parentPort2 = getParentPort();
|
|
474
|
+
if (parentPort2) {
|
|
475
|
+
parentPort2.on("message", handleMessage);
|
|
476
|
+
parentPort2.on("exit", () => console.debug("Node worker closing"));
|
|
477
|
+
} else {
|
|
478
|
+
globalThis.onmessage = handleMessage;
|
|
479
|
+
}
|
|
428
480
|
}
|
|
429
481
|
static addEventListener(onMessage2) {
|
|
430
482
|
let onMessageWrapper = onMessageWrapperMap.get(onMessage2);
|
|
@@ -433,22 +485,36 @@
|
|
|
433
485
|
if (!isKnownMessage(message)) {
|
|
434
486
|
return;
|
|
435
487
|
}
|
|
436
|
-
const
|
|
488
|
+
const parentPort3 = getParentPort();
|
|
489
|
+
const { type, payload } = parentPort3 ? message : message.data;
|
|
437
490
|
onMessage2(type, payload);
|
|
438
491
|
};
|
|
439
492
|
}
|
|
440
|
-
|
|
493
|
+
const parentPort2 = getParentPort();
|
|
494
|
+
if (parentPort2) {
|
|
495
|
+
console.error("not implemented");
|
|
496
|
+
} else {
|
|
497
|
+
globalThis.addEventListener("message", onMessageWrapper);
|
|
498
|
+
}
|
|
441
499
|
}
|
|
442
500
|
static removeEventListener(onMessage2) {
|
|
443
501
|
const onMessageWrapper = onMessageWrapperMap.get(onMessage2);
|
|
444
502
|
onMessageWrapperMap.delete(onMessage2);
|
|
445
|
-
|
|
503
|
+
const parentPort2 = getParentPort();
|
|
504
|
+
if (parentPort2) {
|
|
505
|
+
console.error("not implemented");
|
|
506
|
+
} else {
|
|
507
|
+
globalThis.removeEventListener("message", onMessageWrapper);
|
|
508
|
+
}
|
|
446
509
|
}
|
|
447
510
|
static postMessage(type, payload) {
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
511
|
+
const data = { source: "loaders.gl", type, payload };
|
|
512
|
+
const transferList = getTransferList(payload);
|
|
513
|
+
const parentPort2 = getParentPort();
|
|
514
|
+
if (parentPort2) {
|
|
515
|
+
parentPort2.postMessage(data, transferList);
|
|
516
|
+
} else {
|
|
517
|
+
globalThis.postMessage(data, transferList);
|
|
452
518
|
}
|
|
453
519
|
}
|
|
454
520
|
};
|
|
@@ -458,7 +524,7 @@
|
|
|
458
524
|
}
|
|
459
525
|
|
|
460
526
|
// ../worker-utils/src/lib/worker-api/get-worker-url.ts
|
|
461
|
-
var NPM_TAG = "
|
|
527
|
+
var NPM_TAG = "beta";
|
|
462
528
|
function getWorkerURL(worker, options = {}) {
|
|
463
529
|
const workerOptions = options[worker.id] || {};
|
|
464
530
|
const workerFile = `${worker.id}-worker.js`;
|
|
@@ -493,7 +559,7 @@
|
|
|
493
559
|
|
|
494
560
|
// ../worker-utils/src/lib/library-utils/library-utils.ts
|
|
495
561
|
var node = __toModule(require_require_utils());
|
|
496
|
-
var LATEST = "
|
|
562
|
+
var LATEST = "beta";
|
|
497
563
|
var VERSION2 = typeof VERSION !== "undefined" ? VERSION : LATEST;
|
|
498
564
|
var loadLibraryPromises = {};
|
|
499
565
|
async function loadLibrary(libraryUrl, moduleName = null, options = {}) {
|
|
@@ -564,19 +630,20 @@
|
|
|
564
630
|
// ../loader-utils/src/lib/worker-loader-utils/create-loader-worker.ts
|
|
565
631
|
var requestId = 0;
|
|
566
632
|
function createLoaderWorker(loader) {
|
|
567
|
-
if (
|
|
633
|
+
if (!WorkerBody.inWorkerThread()) {
|
|
568
634
|
return;
|
|
569
635
|
}
|
|
570
636
|
WorkerBody.onmessage = async (type, payload) => {
|
|
571
637
|
switch (type) {
|
|
572
638
|
case "process":
|
|
573
639
|
try {
|
|
574
|
-
const { input, options = {} } = payload;
|
|
640
|
+
const { input, options = {}, context = {} } = payload;
|
|
575
641
|
const result = await parseData({
|
|
576
642
|
loader,
|
|
577
643
|
arrayBuffer: input,
|
|
578
644
|
options,
|
|
579
645
|
context: {
|
|
646
|
+
...context,
|
|
580
647
|
parse: parseOnMainThread
|
|
581
648
|
}
|
|
582
649
|
});
|
|
@@ -640,6 +707,9 @@
|
|
|
640
707
|
if (!WorkerFarm.isSupported()) {
|
|
641
708
|
return false;
|
|
642
709
|
}
|
|
710
|
+
if (!isBrowser2 && !options?._nodeWorkers) {
|
|
711
|
+
return false;
|
|
712
|
+
}
|
|
643
713
|
return loader.worker && options?.worker;
|
|
644
714
|
}
|
|
645
715
|
async function parseWithWorker(loader, data, options, context, parseOnMainThread2) {
|
|
@@ -648,10 +718,12 @@
|
|
|
648
718
|
const workerFarm = WorkerFarm.getWorkerFarm(options);
|
|
649
719
|
const workerPool = workerFarm.getWorkerPool({ name, url });
|
|
650
720
|
options = JSON.parse(JSON.stringify(options));
|
|
721
|
+
context = JSON.parse(JSON.stringify(context || {}));
|
|
651
722
|
const job = await workerPool.startJob("process-on-worker", onMessage.bind(null, parseOnMainThread2));
|
|
652
723
|
job.postMessage("process", {
|
|
653
724
|
input: data,
|
|
654
|
-
options
|
|
725
|
+
options,
|
|
726
|
+
context
|
|
655
727
|
});
|
|
656
728
|
const result = await job.result;
|
|
657
729
|
return await result.result;
|
|
@@ -932,7 +1004,7 @@
|
|
|
932
1004
|
text += ` ${await response.text()}`;
|
|
933
1005
|
}
|
|
934
1006
|
message += text;
|
|
935
|
-
message = message.length > 60 ? `${message.slice(60)}...` : message;
|
|
1007
|
+
message = message.length > 60 ? `${message.slice(0, 60)}...` : message;
|
|
936
1008
|
} catch (error) {
|
|
937
1009
|
}
|
|
938
1010
|
return message;
|
|
@@ -1016,7 +1088,7 @@
|
|
|
1016
1088
|
var process_ = globals3.process || {};
|
|
1017
1089
|
|
|
1018
1090
|
// ../../node_modules/probe.gl/dist/esm/utils/globals.js
|
|
1019
|
-
var VERSION3 = true ? "3.
|
|
1091
|
+
var VERSION3 = true ? "3.2.0-alpha.3" : "untranspiled source";
|
|
1020
1092
|
var isBrowser4 = isBrowser3();
|
|
1021
1093
|
|
|
1022
1094
|
// ../../node_modules/probe.gl/dist/esm/utils/local-storage.js
|
|
@@ -1549,7 +1621,8 @@
|
|
|
1549
1621
|
worker: true,
|
|
1550
1622
|
maxConcurrency: 3,
|
|
1551
1623
|
maxMobileConcurrency: 1,
|
|
1552
|
-
reuseWorkers:
|
|
1624
|
+
reuseWorkers: isBrowser,
|
|
1625
|
+
_nodeWorkers: false,
|
|
1553
1626
|
_workerType: "",
|
|
1554
1627
|
limit: 0,
|
|
1555
1628
|
_limitMB: 0,
|
|
@@ -1761,7 +1834,7 @@
|
|
|
1761
1834
|
var process_2 = globals4.process || {};
|
|
1762
1835
|
|
|
1763
1836
|
// ../../node_modules/@probe.gl/env/dist/esm/utils/globals.js
|
|
1764
|
-
var VERSION4 = true ? "3.
|
|
1837
|
+
var VERSION4 = true ? "3.2.0-alpha.3" : "untranspiled source";
|
|
1765
1838
|
var isBrowser6 = isBrowser5();
|
|
1766
1839
|
|
|
1767
1840
|
// ../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js
|
|
@@ -2654,6 +2727,12 @@
|
|
|
2654
2727
|
}
|
|
2655
2728
|
async function parseWithLoader(loader, data, options, context) {
|
|
2656
2729
|
validateWorkerVersion(loader);
|
|
2730
|
+
if (isResponse(data)) {
|
|
2731
|
+
const response = data;
|
|
2732
|
+
const { ok, redirected, status, statusText, type, url } = response;
|
|
2733
|
+
const headers = Object.fromEntries(response.headers.entries());
|
|
2734
|
+
context.response = { headers, ok, redirected, status, statusText, type, url };
|
|
2735
|
+
}
|
|
2657
2736
|
data = await getArrayBufferOrStringFromData(data, loader, options);
|
|
2658
2737
|
if (loader.parseTextSync && typeof data === "string") {
|
|
2659
2738
|
options.dataType = "text";
|
|
@@ -4877,7 +4956,7 @@
|
|
|
4877
4956
|
};
|
|
4878
4957
|
|
|
4879
4958
|
// ../images/src/lib/utils/version.ts
|
|
4880
|
-
var VERSION5 = true ? "3.
|
|
4959
|
+
var VERSION5 = true ? "3.2.0-alpha.3" : "latest";
|
|
4881
4960
|
|
|
4882
4961
|
// ../images/src/lib/category-api/image-type.ts
|
|
4883
4962
|
var { _parseImageNode } = globalThis;
|
|
@@ -5225,7 +5304,7 @@
|
|
|
5225
5304
|
};
|
|
5226
5305
|
|
|
5227
5306
|
// ../draco/src/lib/utils/version.ts
|
|
5228
|
-
var VERSION6 = true ? "3.
|
|
5307
|
+
var VERSION6 = true ? "3.2.0-alpha.3" : "latest";
|
|
5229
5308
|
|
|
5230
5309
|
// ../draco/src/draco-loader.ts
|
|
5231
5310
|
var DEFAULT_DRACO_OPTIONS = {
|
|
@@ -6209,10 +6288,10 @@
|
|
|
6209
6288
|
}
|
|
6210
6289
|
|
|
6211
6290
|
// ../textures/src/lib/utils/version.ts
|
|
6212
|
-
var VERSION7 = true ? "3.
|
|
6291
|
+
var VERSION7 = true ? "3.2.0-alpha.3" : "beta";
|
|
6213
6292
|
|
|
6214
6293
|
// ../textures/src/lib/parsers/basis-module-loader.ts
|
|
6215
|
-
var VERSION8 = true ? "3.
|
|
6294
|
+
var VERSION8 = true ? "3.2.0-alpha.3" : "beta";
|
|
6216
6295
|
var BASIS_CDN_ENCODER_WASM = `https://unpkg.com/@loaders.gl/textures@${VERSION8}/dist/libs/basis_encoder.wasm`;
|
|
6217
6296
|
var BASIS_CDN_ENCODER_JS = `https://unpkg.com/@loaders.gl/textures@${VERSION8}/dist/libs/basis_encoder.js`;
|
|
6218
6297
|
var loadBasisTranscoderPromise;
|
|
@@ -6693,7 +6772,7 @@
|
|
|
6693
6772
|
const basisFile = new BasisFile(new Uint8Array(data));
|
|
6694
6773
|
try {
|
|
6695
6774
|
if (!basisFile.startTranscoding()) {
|
|
6696
|
-
|
|
6775
|
+
throw new Error("Failed to start basis transcoding");
|
|
6697
6776
|
}
|
|
6698
6777
|
const imageCount = basisFile.getNumImages();
|
|
6699
6778
|
const images = [];
|
|
@@ -6719,22 +6798,22 @@
|
|
|
6719
6798
|
const decodedSize = basisFile.getImageTranscodedSizeInBytes(imageIndex, levelIndex, basisFormat);
|
|
6720
6799
|
const decodedData = new Uint8Array(decodedSize);
|
|
6721
6800
|
if (!basisFile.transcodeImage(decodedData, imageIndex, levelIndex, basisFormat, 0, 0)) {
|
|
6722
|
-
|
|
6801
|
+
throw new Error("failed to start Basis transcoding");
|
|
6723
6802
|
}
|
|
6724
6803
|
return {
|
|
6725
6804
|
width,
|
|
6726
6805
|
height,
|
|
6727
6806
|
data: decodedData,
|
|
6728
6807
|
compressed,
|
|
6729
|
-
|
|
6730
|
-
|
|
6808
|
+
format,
|
|
6809
|
+
hasAlpha
|
|
6731
6810
|
};
|
|
6732
6811
|
}
|
|
6733
6812
|
function parseKTX2File(KTX2File, data, options) {
|
|
6734
6813
|
const ktx2File = new KTX2File(new Uint8Array(data));
|
|
6735
6814
|
try {
|
|
6736
6815
|
if (!ktx2File.startTranscoding()) {
|
|
6737
|
-
|
|
6816
|
+
throw new Error("failed to start KTX2 transcoding");
|
|
6738
6817
|
}
|
|
6739
6818
|
const levelsCount = ktx2File.getLevels();
|
|
6740
6819
|
const levels = [];
|
|
@@ -6742,7 +6821,7 @@
|
|
|
6742
6821
|
levels.push(transcodeKTX2Image(ktx2File, levelIndex, options));
|
|
6743
6822
|
break;
|
|
6744
6823
|
}
|
|
6745
|
-
return levels;
|
|
6824
|
+
return [levels];
|
|
6746
6825
|
} finally {
|
|
6747
6826
|
ktx2File.close();
|
|
6748
6827
|
ktx2File.delete();
|
|
@@ -6754,14 +6833,14 @@
|
|
|
6754
6833
|
const decodedSize = ktx2File.getImageTranscodedSizeInBytes(levelIndex, 0, 0, basisFormat);
|
|
6755
6834
|
const decodedData = new Uint8Array(decodedSize);
|
|
6756
6835
|
if (!ktx2File.transcodeImage(decodedData, levelIndex, 0, 0, basisFormat, 0, -1, -1)) {
|
|
6757
|
-
|
|
6836
|
+
throw new Error("Failed to transcode KTX2 image");
|
|
6758
6837
|
}
|
|
6759
6838
|
return {
|
|
6760
6839
|
width,
|
|
6761
6840
|
height,
|
|
6762
6841
|
data: decodedData,
|
|
6763
6842
|
compressed,
|
|
6764
|
-
alphaFlag,
|
|
6843
|
+
hasAlpha: alphaFlag,
|
|
6765
6844
|
format
|
|
6766
6845
|
};
|
|
6767
6846
|
}
|
|
@@ -7147,7 +7226,7 @@
|
|
|
7147
7226
|
containerFormat: "ktx2",
|
|
7148
7227
|
module: "encoder"
|
|
7149
7228
|
};
|
|
7150
|
-
return await parseBasis(arrayBuffer, options);
|
|
7229
|
+
return (await parseBasis(arrayBuffer, options))[0];
|
|
7151
7230
|
}
|
|
7152
7231
|
return parseCompressedTexture(arrayBuffer);
|
|
7153
7232
|
}
|
|
@@ -7881,7 +7960,10 @@
|
|
|
7881
7960
|
tile.content.texture = await parse(arrayBuffer2, loader, options2);
|
|
7882
7961
|
}
|
|
7883
7962
|
} else if (loader === CompressedTextureLoader || loader === BasisLoader) {
|
|
7884
|
-
|
|
7963
|
+
let texture = await load(arrayBuffer2, loader, tile.textureLoaderOptions);
|
|
7964
|
+
if (loader === BasisLoader) {
|
|
7965
|
+
texture = texture[0];
|
|
7966
|
+
}
|
|
7885
7967
|
tile.content.texture = {
|
|
7886
7968
|
compressed: true,
|
|
7887
7969
|
mipmaps: false,
|
|
@@ -7905,6 +7987,7 @@
|
|
|
7905
7987
|
return tile;
|
|
7906
7988
|
}
|
|
7907
7989
|
const content = tile.content;
|
|
7990
|
+
const contentByteLength = arrayBuffer.byteLength;
|
|
7908
7991
|
let attributes;
|
|
7909
7992
|
let vertexCount;
|
|
7910
7993
|
let byteOffset = 0;
|
|
@@ -7980,7 +8063,7 @@
|
|
|
7980
8063
|
}
|
|
7981
8064
|
}
|
|
7982
8065
|
content.vertexCount = vertexCount;
|
|
7983
|
-
content.byteLength =
|
|
8066
|
+
content.byteLength = contentByteLength;
|
|
7984
8067
|
return tile;
|
|
7985
8068
|
}
|
|
7986
8069
|
function updateAttributesMetadata(attributes, decompressedGeometry) {
|
|
@@ -8033,38 +8116,38 @@
|
|
|
8033
8116
|
byteOffset
|
|
8034
8117
|
};
|
|
8035
8118
|
}
|
|
8036
|
-
function normalizeAttributes(arrayBuffer, byteOffset, vertexAttributes,
|
|
8119
|
+
function normalizeAttributes(arrayBuffer, byteOffset, vertexAttributes, attributeCount, attributesOrder) {
|
|
8037
8120
|
const attributes = {};
|
|
8038
8121
|
for (const attribute of attributesOrder) {
|
|
8039
8122
|
if (vertexAttributes[attribute]) {
|
|
8040
8123
|
const { valueType, valuesPerElement } = vertexAttributes[attribute];
|
|
8041
|
-
|
|
8042
|
-
|
|
8124
|
+
if (byteOffset + attributeCount * valuesPerElement * sizeOf(valueType) <= arrayBuffer.byteLength) {
|
|
8125
|
+
const buffer = arrayBuffer.slice(byteOffset);
|
|
8126
|
+
let value;
|
|
8127
|
+
if (valueType === "UInt64") {
|
|
8128
|
+
value = parseUint64Values(buffer, attributeCount * valuesPerElement, sizeOf(valueType));
|
|
8129
|
+
} else {
|
|
8130
|
+
const TypedArrayType = getConstructorForDataFormat(valueType);
|
|
8131
|
+
value = new TypedArrayType(buffer, 0, attributeCount * valuesPerElement);
|
|
8132
|
+
}
|
|
8133
|
+
attributes[attribute] = {
|
|
8134
|
+
value,
|
|
8135
|
+
type: GL_TYPE_MAP[valueType],
|
|
8136
|
+
size: valuesPerElement
|
|
8137
|
+
};
|
|
8138
|
+
switch (attribute) {
|
|
8139
|
+
case "color":
|
|
8140
|
+
attributes.color.normalized = true;
|
|
8141
|
+
break;
|
|
8142
|
+
case "position":
|
|
8143
|
+
case "region":
|
|
8144
|
+
case "normal":
|
|
8145
|
+
default:
|
|
8146
|
+
}
|
|
8147
|
+
byteOffset = byteOffset + attributeCount * valuesPerElement * sizeOf(valueType);
|
|
8148
|
+
} else if (attribute !== "uv0") {
|
|
8043
8149
|
break;
|
|
8044
8150
|
}
|
|
8045
|
-
const buffer = arrayBuffer.slice(byteOffset);
|
|
8046
|
-
let value;
|
|
8047
|
-
if (valueType === "UInt64") {
|
|
8048
|
-
value = parseUint64Values(buffer, count * valuesPerElement, sizeOf(valueType));
|
|
8049
|
-
} else {
|
|
8050
|
-
const TypedArrayType = getConstructorForDataFormat(valueType);
|
|
8051
|
-
value = new TypedArrayType(buffer, 0, count * valuesPerElement);
|
|
8052
|
-
}
|
|
8053
|
-
attributes[attribute] = {
|
|
8054
|
-
value,
|
|
8055
|
-
type: GL_TYPE_MAP[valueType],
|
|
8056
|
-
size: valuesPerElement
|
|
8057
|
-
};
|
|
8058
|
-
switch (attribute) {
|
|
8059
|
-
case "color":
|
|
8060
|
-
attributes.color.normalized = true;
|
|
8061
|
-
break;
|
|
8062
|
-
case "position":
|
|
8063
|
-
case "region":
|
|
8064
|
-
case "normal":
|
|
8065
|
-
default:
|
|
8066
|
-
}
|
|
8067
|
-
byteOffset = byteOffset + count * valuesPerElement * sizeOf(valueType);
|
|
8068
8151
|
}
|
|
8069
8152
|
}
|
|
8070
8153
|
return { attributes, byteOffset };
|
|
@@ -8215,7 +8298,7 @@
|
|
|
8215
8298
|
}
|
|
8216
8299
|
|
|
8217
8300
|
// src/i3s-content-loader.ts
|
|
8218
|
-
var VERSION9 = true ? "3.
|
|
8301
|
+
var VERSION9 = true ? "3.2.0-alpha.3" : "beta";
|
|
8219
8302
|
var I3SContentLoader = {
|
|
8220
8303
|
name: "I3S Content (Indexed Scene Layers)",
|
|
8221
8304
|
id: "i3s-content",
|