shuishen
2023-05-08 e24f70ababdee2b4fdce71c6b80a9bc928fa0331
src/utils/tools/EditTool.js
@@ -22,7 +22,7 @@
class EditTool {
    constructor() {
        this._viewer = undefined
        this._anchorLayer = undefined
        this._anchorLayer = new global.DC.Namespace.Cesium.CustomDataSource('tool-three-edit-anchor-layer')
        this._options = {}
        this._plotEvent = new PlotEvent()
        this._tooltipMess = undefined
@@ -245,8 +245,7 @@
     * @returns {EditTool}
     */
    activate (options = {}) {
        this._anchorLayer = new global.DC.Namespace.Cesium.CustomDataSource('edit-anchor-layer')
        this._viewer.dataSources.add(this._anchorLayer)
        this._anchorLayer.entities.removeAll()
        this._viewer.tooltip.enable = true
        this._options = { ...DEF_OPTS, ...options }
@@ -265,7 +264,6 @@
        this._viewer.tooltip.enable = false
        this._anchorLayer.entities.removeAll()
        this._anchors = []
        this._viewer.dataSources.remove(this._anchorLayer)
        return this
    }
@@ -275,6 +273,7 @@
     */
    install (viewer) {
        this._viewer = viewer
        this._viewer.dataSources.add(this._anchorLayer)
        Object.defineProperty(this._viewer, 'curEditTool', {
            value: this,
            writable: true,