jxdnsong
2023-04-05 be147d2a99d60a30b20fade742e85b45f06172ae
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2023-03-24 17:20:14
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2023-03-24 17:21:08
 * @FilePath: \forest-fire\src\utils\plot\edit\EditPoint.js
 * @Description: 
 * 
 * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved. 
 */
/**
 * @Author: Caven
 * @Date: 2020-08-30 22:04:36
 */
 
import Edit from './Edit'
 
class EditPoint extends Edit {
    constructor(overlay) {
        super(overlay)
        this._position = undefined
    }
 
    /**
     *
     * @private
     */
    _mountedHook () {
        this.curEditTool.tooltipMess = '右击结束编辑'
        this._position = this._delegate.position.getValue(global.DC.Namespace.Cesium.JulianDate.now())
        this._delegate.position = new global.DC.Namespace.Cesium.CallbackProperty(() => {
            return this._position
        })
        this._layer.entities.add(this._delegate)
    }
 
    /**
     *
     * @private
     */
    _stopedHook () {
        this._overlay.position = global.DC.Transform.transformCartesianToWGS84(this._position)
        this._overlay.show = true
        this._options.onEditStop && this._options.onEditStop(this._overlay)
    }
 
    /**
     *
     * @param pickedAnchor
     * @param position
     * @private
     */
    _onAnchorMoving ({ pickedAnchor, position }) {
        this._position = position
    }
}
 
export default EditPoint