UNPKG

cve-connector

Version:
73 lines (69 loc) 3.55 kB
import type { Coordinates, Offset, TagMap } from './common' import type { CustomParams, FeatureParams } from './params' export interface PointData<S extends PointStyle> { /** * 经纬度及高程 * - [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] 基于坐标的偏移量(米) */ Offset?: Offset /** 其他参数 */ Parameters?: PointParams[S] /** 聚焦时,相机距要素的距离 */ SpecifiedDistance?: number /** 聚焦时,相机位置 */ SpecifiedPosition?: number[] /** 'Custom' | 'Marker01' | 'Marker02' | 'Label01' | 'Label02' | 'Label03' */ Style: S /** 数据标签 */ Tags?: TagMap /** 组件的显示层级,值越大,层级越高,默认为-100 */ WidgetZOrder?: number /** 组件的基准点,[0,0] 为左上角,[1,1] 为右下角,默认值为 [0.5,1] */ WidgetPivot?: number[] /** 组件淡化的终止距离 */ WidgetFadeEndDistance?: number /** 组件淡化的终止透明度 */ WidgetFadeEndOpacity?: number /** 组件淡化的起始距离 */ WidgetFadeStartDistance?: number } /** Point Parameters,不同 PointStyle 对应的补充参数接口 */ export interface PointParams { Custom: CustomParams Icon01: Partial<Pick<FeatureParams, 'ImageHover' | 'ImageNormal' | 'ImageSize'>> Label01: Partial<Pick<FeatureParams, 'FontSize' | 'ImageBackgroundColor' | 'ImageNormal' | 'ImageSize'>> Label02: Partial<Pick<FeatureParams, 'FontSize' | 'ImageHover' | 'ImageNormal' | 'ImageSize' | 'LabelDefaultVisible'>> Label03: Partial<Pick<FeatureParams, 'FontSize' | 'ImageHover' | 'ImageNormal' | 'ImagePositioner' | 'ImagePositionerSize' | 'ImageSize' | 'IsFixedLabelWidth' | 'IsFixedLabelHeight' | 'LabelWidth' | 'LabelHeight' | 'LabelMargin' | 'PositionerMargin'>> Marker01: Partial<Pick<FeatureParams, 'Color' | 'DurationPerBounce' | 'Emissive' | 'HeightPerBounce' | 'RotationPerSecond' | 'Size'>> Marker02: Partial<Pick<FeatureParams, 'CircleAmount' | 'Color' | 'Duration' | 'Emissive' | 'Size'>> Text01: Partial<Pick<FeatureParams, 'BackgroundColor' | 'Color' | 'FontSize'>> Web01: Partial<Pick<FeatureParams, 'BackdropBlur' | 'DialogSize' | 'URL'>> Web02: Partial<Pick<FeatureParams, 'BackdropBlur' | 'DialogSize' | 'Gap' | 'ImageNormal' | 'ImageSize' | 'URL'>> Web03: Partial<Pick<FeatureParams, 'BackdropBlur' | 'DialogSize' | 'Gap' | 'ImageHover' | 'ImageNormal' | 'ImageSize' | 'URL'>> } export type PointStyle = 'Custom' | 'Icon01' | 'Label01' | 'Label02' | 'Label03' | 'Marker01' | 'Marker02' | 'Text01' | 'Web01' | 'Web02' | 'Web03'