cve-connector
Version:
UE Web 开发套件
86 lines (81 loc) • 2.67 kB
TypeScript
import type { Coordinates, Offset, TagMap } from './common'
import type { CustomParams, FeatureParams } from './params'
export interface PolylineData<S extends PolylineStyle> {
/**
* 坐标数组
* - [longitude, latitude, altitude][]
* - 若未指定 altitude 值,则取默认值 0
* - 当未指定 altitude 值时,建议将参数 isHeightBasedSurface 设置为 true,并结合参数 offset 使用
*/
Coordinates: Coordinates[]
/** 是否启用选择后飞行 */
EnableFlyTo?: boolean
/** 聚焦过渡时长 */
FlyToDuration?: number
/**
* 聚焦时是否定位至距要素的指定距离处
* - 若为true,则定位至SpecifiedDistance属性指示的距离
*/
FlyToSpecifiedDistance?: boolean
/**
* 聚焦时是否定位至距要素的指定位置处
* - 若为true,则定位至SpecifiedPosition属性指示的距离
*/
FlyToSpecifiedPosition?: boolean
Id?: string
/**
* 指示 Feature 生成时,其高度是否基于场景上表面
* - 若为 true,则高度为各点平面坐标处与场景上表面的交点加上 offset 参数的 z 值
*/
IsHeightBasedSurface?: boolean
Name?: string
/** [x, y, z] 基于坐标的偏移量(米),其中 z 值代表绘制的平面所处高度 */
Offset?: Offset
/** 其他参数 */
Parameters?: PointParams[S]
/** 构建线时顺序是否反转 */
Reverse?: boolean
/** 聚焦时,相机距要素的距离 */
SpecifiedDistance?: number
/** 聚焦时,相机位置 */
SpecifiedPosition?: number[]
/** 'Arrow01' | 'Custom' | 'Dash01' | 'Gradient01' | 'OD01' | 'OD02' | 'Solid01' */
Style: S
/** 数据标签 */
Tags?: TagMap
}
/** Polyline Parameters,不同 PolylineStyle 对应的补充参数接口 */
export interface PolylineParams {
Arrow01: Partial<
Pick<
FeatureParams,
PolylineParamsCommonKeys | 'FlowSpeed' | 'Scale' | 'Texture'
>
>
Custom: CustomParams
Dash01: Partial<
Pick<FeatureParams, PolylineParamsCommonKeys | 'FlowSpeed' | 'Ratio'>
>
Gradient01: Partial<Pick<FeatureParams, PolylineParamsCommonKeys>>
Solid01: Partial<Pick<FeatureParams, PolylineParamsCommonKeys>>
ODLine01: Partial<
Pick<FeatureParams, PolylineParamsCommonKeys | 'HorizontalFactor' | 'VerticalFactor'>
>
}
type PolylineParamsCommonKeys =
| 'Animate'
| 'AnimateDuration'
| 'AnimateSpeed'
| 'Color'
| 'Direction'
| 'IsLoop'
| 'ShapeStyle'
| 'Smoothness'
| 'Width'
export type PolylineStyle =
| 'Arrow01'
| 'Custom'
| 'Dash01'
| 'Gradient01'
| 'Solid01'
| 'ODLine01'