SceneViewpointManager 视点管理
可用于对场景中的视点进行管理,支持视点的创建、编辑、删除和飞行。
<mapgis-3d-scene-viewpoint-manager></mapgis-3d-scene-viewpoint-manager>
基本用法
API
属性
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|---|---|---|---|---|
| commands | 视点命令列表,形如[{id,label,icon,action}],存在内置flyTo、edit、delete命令ID,对于外部命令需要传入完整属性,对内置命令只需要传入ID,action为函数,参数形如(viewpoint) | array | [{id: 'flyTo'},{id: 'edit'},{id: 'delete'}] | |
| viewpoints | 视点列表 | ViewpointGroup[] | [] | |
| toolbar | 工具栏 | slot |
方法
| 名称 | 描述 | 版本 |
|---|---|---|
| getViewpoints | 获取视点列表 | |
| clearState | 清除视点飞行状态 | |
| clear | 清除视点飞行状态和视点数据 |
ViewpointGroup
视点分组。
typescript
export interface ViewpointGroup {
id: string // id
name: string // 名称
items: Viewpoint[] // 视点集合
}Viewpoint
视点对象。
typescript
export interface Viewpoint {
id: string // id
name: string // 名称
image: string // 视点缩略图的路径
duration: number // 视点跳转所需的时间(秒)
// 视点位置
destination: {
x: number
y: number
z: number
}
// 视点朝向
orientation: {
heading: number
pitch: number
roll: number
}
}