diff --git a/modules/layers/src/point-cloud-layer/point-cloud-layer.ts b/modules/layers/src/point-cloud-layer/point-cloud-layer.ts index 7ed5c0231d9..0c2176f1d83 100644 --- a/modules/layers/src/point-cloud-layer/point-cloud-layer.ts +++ b/modules/layers/src/point-cloud-layer/point-cloud-layer.ts @@ -26,10 +26,16 @@ import {pointCloudUniforms, PointCloudProps} from './point-cloud-layer-uniforms' import vs from './point-cloud-layer-vertex.glsl'; import fs from './point-cloud-layer-fragment.glsl'; import source from './point-cloud-layer.wgsl'; +import type {Mesh} from '@loaders.gl/schema'; const DEFAULT_COLOR = [0, 0, 0, 255] as const; const DEFAULT_NORMAL = [0, 0, 1] as const; +export type LoadersGLPointCloudData = Partial & { + header: {vertexCount: number}; + attributes: Mesh['attributes']; +}; + const defaultProps: DefaultProps = { sizeUnits: 'pixels', pointSize: {type: 'number', min: 0, value: 10}, // point radius in pixels @@ -70,7 +76,7 @@ export type PointCloudLayerProps = _PointCloudLayerProps /** Properties added by PointCloudLayer. */ type _PointCloudLayerProps = { - data: LayerDataSource; + data: LayerDataSource | LoadersGLPointCloudData; /** * The units of the point size, one of `'meters'`, `'common'`, and `'pixels'`. * @default 'pixels'