# ESPoi3D（ESPoi3D）

> 分类：**单点对象** | 引擎：Cesium/UE | 基类：否
> 继承链：`Destroyable -> ESSceneObject -> ESVisualObject -> ESObjectWithLocation -> ESPoi3D`

ESPoi3D 是用于在三维场景中创建和管理 POI（兴趣点）对象的可视化对象。

## JSON 示例

```json
{
            "id": "poi3d_xxx",
            "type": "ESPoi3D",
            "name": "3D点标记",
            "position": [116.39, 39.9, 0],
            "mode": "triangle"
        }
```

## 属性

| 属性 | 类型 | 默认值 | 说明 | 来源 |
| --- | --- | --- | --- | --- |
| `allowPicking` | boolean | false | 是否允许拾取 默认false | ESVisualObject |
| `collision` | boolean | true | 是否开启碰撞监测 默认true ,主要是UE使用 | ESVisualObject |
| `devTags` | string[] \| undefined | undefined | 对象类型名称相关的开发标签数组，使用 reactArrayWithUndefined 进行响应式处理，默认为 undefined。 | ESSceneObject |
| `execOnceFuncStr` | string \| undefined | undefined | 一次性执行函数的字符串表示，默认为 undefined。 | ESSceneObject |
| `extras` | JsonValue | undefined | 扩展属性 JSON，必须整体赋值，使用 reactJson 进行响应式处理，默认为 undefined。 | ESSceneObject |
| `flyInParam` | ESJFlyInParam \| undefined | undefined | 飞入参数 | ESVisualObject |
| `flyToParam` | ESJFlyToParam \| undefined | undefined | 飞向参数 | ESVisualObject |
| `maxVisibleDistance` | number | 0 | 最大可视距离 | ESObjectWithLocation |
| `minVisibleDistance` | number | 0 | 最小可视距离 | ESObjectWithLocation |
| `mode` | 'triangle' \| 'diamond' | 'triangle' | 模式 三角形，菱形 | ESPoi3D |
| `name` | string | "未命名场景对象" | 对象名称，默认为 '未命名场景对象'。 | ESSceneObject |
| `pointed` | boolean | false | 点样式是否启用，默认false | ESObjectWithLocation |
| `pointStyle` | ESJPointStyle | {             size: 1,             sizeType: 'screen',             color: [1, 1, 1, 1],             material: '',             materialParams: {},             outlineColor: [1, 0, 0, 1],             outlineWidth: 2,         } | 点样式 | ESObjectWithLocation |
| `position` | ESJVector3D | [0, 0, 0] | 位置点 [经,纬,高] | ESObjectWithLocation |
| `positionOffset` | ESJVector3D | [0, 0, 0] | 偏移属性 [x,y,z] | ESObjectWithLocation |
| `ref` | string \| undefined | undefined | 对象引用，设置后可通过对象管理器 objm.$refs.xxx 快速获取到对象，默认为 undefined。 | ESSceneObject |
| `rotation` | ESJVector3D | [0, 0, 0] | 姿态 [h,p,r] | ESObjectWithLocation |
| `scale` | ESJVector3D | [1, 1, 1] | 缩放 [x,y,z] | ESObjectWithLocation |
| `show` | boolean | true | 是否显示 默认true | ESVisualObject |
| `style` | typeof ESPoi3D.defaults.style | {             "UI_Color": [0.09803921568627451, 0.40784313725490196, 0.8, 1],             "FX_Color": [0.09803921568627451, 0.40784313725490196, 0.8, 1],         } | 样式 | ESPoi3D |
| `toDestroyFuncStr` | string \| undefined | undefined | 销毁函数的字符串表示，默认为 undefined。 | ESSceneObject |
| `updateFuncStr` | string \| undefined | undefined | 更新函数的字符串表示，默认为 undefined。 | ESSceneObject |

## 方法

| 方法 | 参数 | 返回 | 说明 | 来源 |
| --- | --- | --- | --- | --- |
| `addToViewer(viewer: ESViewer)` | viewer: ESViewer | - | 将对象添加到指定视口中。<br>**参数**：viewer - 要添加对象的视口。 | ESSceneObject |
| `automaticLanding()` | - | - | 自动落地。 先禁用碰撞检测，一段时间后触发自动落地事件并恢复碰撞检测状态。 | ESObjectWithLocation |
| `calcFlyInParam()` | - | - | 触发计算飞入参数事件 | ESVisualObject |
| `calcFlyToParam()` | - | - | 触发计算飞向参数事件 | ESVisualObject |
| `createAttachedObject(createViewerPropSceneObject: (viewer: ESViewer) => Destroyable | undefined)` | createViewerPropSceneObject: (viewer: ESViewer) => Destroyable \| undefined | - | 创建与视口关联的对象，并返回一个销毁函数，用于手动销毁关联对象。<br>**参数**：createViewerPropSceneObject - 一个函数，用于创建与视口关联的对象。<br>**返回**：一个销毁函数，调用该函数可以销毁所有关联对象。 | ESSceneObject |
| `emptyFlyInParam()` | - | - | 清空飞入参数 | ESVisualObject |
| `emptyFlyToParam()` | - | - | 清空飞向参数 | ESVisualObject |
| `flush()` | - | - | 刷新对象，触发刷新事件。 | ESSceneObject |
| `flyIn(duration: number = 1)` | duration: number = 1 | - | 触发飞入事件<br>**参数**：duration - 飞入持续时间，默认为 1 | ESVisualObject |
| `flyTo(duration: number = 1)` | duration: number = 1 | - | 触发飞向事件<br>**参数**：duration - 飞向持续时间，默认为 1 | ESVisualObject |
| `getBoundSphere(viewer: ESViewer)` | viewer: ESViewer | - | 获取对象的边界球<br>**参数**：viewer - 视图器对象<br>**返回**：包含边界球信息的 Promise | ESVisualObject |
| `getESProperties()` | - | - | 获取ES属性<br>**返回**：ES属性 | ESPoi3D |
| `registerAttachedObject(createViewerPropSceneObject: (viewer: ESViewer) => Destroyable | undefined)` | createViewerPropSceneObject: (viewer: ESViewer) => Destroyable \| undefined | - | 注册与视口关联的对象，当对象被添加到视口或从视口移除时，会自动创建或销毁关联对象。<br>**参数**：createViewerPropSceneObject - 一个函数，用于创建与视口关联的对象。 | ESSceneObject |
| `registerAttachedObjectForContainer(createContainerPropSceneObject: (viewer: ESViewer, container: HTMLDivElement) => Destroyable | undefined)` | createContainerPropSceneObject: (viewer: ESViewer, container: HTMLDivElement) => Destroyable \| undefined | - | 注册与视口容器关联的对象，当对象被添加到视口或从视口移除时，会自动创建或销毁关联对象。<br>**参数**：createContainerPropSceneObject - 一个函数，用于创建与视口容器关联的对象。 | ESSceneObject |
| `reload()` | - | - | - | ESSceneObject |
| `removefromViewer(viewer: ESViewer)` | viewer: ESViewer | - | 将对象从指定视口中移除。<br>**参数**：viewer - 要移除对象的视口。 | ESSceneObject |
| `smoothMove(Destination: ESJVector3D, Time: number)` | Destination: ESJVector3D, Time: number | - | 平滑移动到指定位置。<br>**参数**：Destination - 目标位置，格式为[经度, 纬度, 高度]；Time - 平滑移动所需的时间，单位为秒 | ESObjectWithLocation |
| `smoothMoveKeepPitch(Destination: ESJVector3D, Time: number)` | Destination: ESJVector3D, Time: number | - | 保持俯仰角平滑移动到指定位置。<br>**参数**：Destination - 目标位置，格式为[经度, 纬度, 高度]；Time - 平滑移动所需的时间，单位为秒 | ESObjectWithLocation |
| `smoothMoveOnGround(Lon: number, Lat: number, Time: number, Ground: string)` | Lon: number, Lat: number, Time: number, Ground: string | - | 贴地平滑移动。<br>**参数**：Lon - 目标位置的经度；Lat - 目标位置的纬度；Time - 平滑移动所需的时间，单位为秒；Ground - 地面类型，UE特有属性 | ESObjectWithLocation |
| `smoothMoveRelatively(RelativePosition: ESJVector3D, Time: number)` | RelativePosition: ESJVector3D, Time: number | - | 相对平滑移动。<br>**参数**：RelativePosition - 相对位置，格式为[经度, 纬度, 高度]；Time - 平滑移动所需的时间，单位为秒 | ESObjectWithLocation |
| `smoothMoveRelativelyWithRotation(RelativePosition: ESJVector3D, NewRotation: ESJVector3D, Time: number)` | RelativePosition: ESJVector3D, NewRotation: ESJVector3D, Time: number | - | 相对平滑偏移到指定位置和姿态。<br>**参数**：RelativePosition - 相对位置，格式为[经度, 纬度, 高度]；NewRotation - 目标姿态，格式为[偏航角, 俯仰角, 翻转角]；Time - 平滑移动所需的时间，单位为秒 | ESObjectWithLocation |
| `smoothMoveWithRotation(Destination: ESJVector3D, NewRotation: ESJVector3D, Time: number)` | Destination: ESJVector3D, NewRotation: ESJVector3D, Time: number | - | 平滑偏移到指定位置和姿态。<br>**参数**：Destination - 目标位置，格式为[经度, 纬度, 高度]；NewRotation - 目标姿态，格式为[偏航角, 俯仰角, 翻转角]；Time - 平滑移动所需的时间，单位为秒 | ESObjectWithLocation |
| `smoothMoveWithRotationOnGround(NewRotation: ESJVector3D, Lon: number, Lat: number, Time: number, Ground: string)` | NewRotation: ESJVector3D, Lon: number, Lat: number, Time: number, Ground: string | - | 贴地平滑偏移到指定位置和姿态。<br>**参数**：NewRotation - 目标姿态，格式为[偏航角, 俯仰角, 翻转角]；Lon - 目标位置的经度；Lat - 目标位置的纬度；Time - 平滑移动所需的时间，单位为秒；Ground - 地面类型，ue特有属性 | ESObjectWithLocation |
| `supportEditingModes()` | - | - | 获取当前对象支持的编辑模式<br>**返回**：支持的编辑模式数组 | ESVisualObject |
| `updateEditing()` | - | - | 更新编辑状态的方法，具体实现由子类完成 | ESVisualObject |

## 事件

| 事件 | 说明 | 来源 |
| --- | --- | --- |
| `activeViewerChanged` | - | ESSceneObject |
| `automaticLandingEvent` | 获取自动落地事件的监听器。 | ESObjectWithLocation |
| `calcFlyInParamEvent` | 获取计算飞入参数事件 | ESVisualObject |
| `calcFlyToParamEvent` | 获取计算飞向参数事件 | ESVisualObject |
| `createdEvent` | 获取对象创建事件。 | ESSceneObject |
| `editingChanged` | 获取编辑状态改变事件 | ESVisualObject |
| `flushEvent` | 获取刷新对象事件。 | ESSceneObject |
| `flyInEvent` | 获取飞入事件 | ESVisualObject |
| `flyOverEvent` | 获取飞行结束事件 | ESVisualObject |
| `flyToDistanceChanged` | 获取飞向距离改变事件 | ESVisualObject |
| `flyToEvent` | 获取飞向事件 | ESVisualObject |
| `flyToFlyDurationChanged` | 获取飞向持续时间改变事件 | ESVisualObject |
| `flyToHDeltaChanged` | 获取飞向水平偏移量改变事件 | ESVisualObject |
| `flyToHeadingChanged` | 获取飞向航向改变事件 | ESVisualObject |
| `flyToPDeltaChanged` | 获取飞向垂直偏移量改变事件 | ESVisualObject |
| `flyToPitchChanged` | 获取飞向俯仰角改变事件 | ESVisualObject |
| `pickedEvent` | 获取拾取事件 | ESVisualObject |
| `pointColorChanged` | 获取点颜色变化的事件 | ESObjectWithLocation |
| `pointMaterialChanged` | 获取点材质变化的事件 | ESObjectWithLocation |
| `pointMaterialParamsChanged` | 获取点材质参数变化的事件 | ESObjectWithLocation |
| `pointSizeChanged` | 获取点大小变化的事件 | ESObjectWithLocation |
| `pointSizeTypeChanged` | 获取点大小类型变化的事件 | ESObjectWithLocation |
| `readyEvent` | - | ESSceneObject |
| `reloadEvent` | - | ESSceneObject |
| `smoothMoveEvent` | 获取平滑移动事件。 | ESObjectWithLocation |
| `smoothMoveKeepPitchEvent` | 获取保持俯仰角平滑移动事件。 | ESObjectWithLocation |
| `smoothMoveOnGroundEvent` | 获取贴地平滑移动事件。 | ESObjectWithLocation |
| `smoothMoveRelativelyEvent` | 获取相对平滑移动事件。 | ESObjectWithLocation |
| `smoothMoveRelativelyWithRotationEvent` | 获取相对平滑偏移到指定位置和姿态的事件。 | ESObjectWithLocation |
| `smoothMoveWithRotationEvent` | 获取平滑偏移到指定位置和姿态的事件。 | ESObjectWithLocation |
| `smoothMoveWithRotationOnGroundEvent` | 获取贴地平滑偏移到指定位置和姿态的事件。 | ESObjectWithLocation |
| `statusDisChanged` | 获取对象禁用状态改变的事件监听器。 | ESObjectWithLocation |
| `toDestroyFuncChanged` | 获取销毁函数改变事件。 | ESSceneObject |
| `updateFuncChanged` | 获取更新函数改变事件。 | ESSceneObject |

---
> 本文由 `generate-docs.mjs` 从源码自动生成，请勿手改。修改对象属性/方法后重跑脚本刷新。
