| 12 | } |
| 13 | |
| 14 | export default class floatPoint{ |
| 15 | #viewer: Viewer; |
| 16 | #worldDegrees: worldDegreesType; |
| 17 | #style: styleType; |
| 18 | #entity: Entity|undefined; |
| 19 | |
| 20 | /** |
| 21 | * @description: 浮动点 |
| 22 | * @param {Viewer} viewer viewer |
| 23 | * @param {worldDegreesType} worldDegrees 位置,经纬度和高 |
| 24 | * @param {styleType} style (可选)样式 |
| 25 | * @return {*} |
| 26 | */ |
| 27 | constructor(viewer: Viewer, worldDegrees: worldDegreesType, style:styleType={}){ |
| 28 | this.#viewer = viewer; |
| 29 | this.#worldDegrees = worldDegrees; |
| 30 | this.#style = Object.assign(this.defaultStyle, style); |
| 31 | this.#entity = new Cesium.Entity(); |
| 32 | } |
| 33 | |
| 34 | /** |
| 35 | * @description: 创建 |
| 36 | * @return {*} |
| 37 | */ |
| 38 | async init(){ |
| 39 | this.#viewer.entities.add(this.#entity!); |
| 40 | this.#createPoint(); |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * @description: 销毁 |
| 45 | * @return {*} |
| 46 | */ |
| 47 | destroy(){ |
| 48 | this.#viewer.entities.remove(this.#entity!); |
| 49 | this.#entity = undefined; |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * @description: 设置可见性 |
| 54 | * @param {boolean} show 是否可见 |
| 55 | * @return {*} |
| 56 | */ |
| 57 | setVisible(show: boolean){ |
| 58 | this.#entity!.show = show; |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * @description: 获取可见性 |
| 63 | * @return {boolean} |
| 64 | */ |
| 65 | getVisible(){ |
| 66 | return this.#entity!.show; |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | * @description: 创建特效 |
| 71 | * @return {*} |
nothing calls this directly
no outgoing calls
no test coverage detected