export default {
    point: {
        positions: []
    },
    // 绘制点
    drawPoint(viewer, callback) {
        let that = this;
        viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK);
        let handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
        handler.setInputAction(function (event) {
            let clickPosition = viewer.scene.camera.pickEllipsoid(event.position);
            let point = viewer.entities.add({
                position: clickPosition,
                point: {
                    color: Cesium.Color.RED,
                    pixelSize: 10
                }
            });
            if (callback) {
                callback(point)
            }
        }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
    },
}