import { onMounted, onUnmounted, ref } from "vue";
import { Color, Viewer } from 'cesium';
import { CircleDrawer, DRAW_STATUS, type CircleOptions, } from "cesium-pocket/drawer";
import { ElButton, } from 'element-plus'
const rootContainer: any = ref(null);
const viewer = ref<Viewer | null>(null)
let polygonDrawer: any = null
viewer.value = //你获取的viewer
if (viewer.value && !viewer.value.isDestroyed()) {
const isBtn1Disabled = () => {
return polygonDrawer != null && status.value != DRAW_STATUS.STOPED
const isBtn2Disabled = () => {
return status.value != DRAW_STATUS.DRAWABLE && status.value != DRAW_STATUS.DELETABLE
const isBtn4Disabled = () => {
return status.value != DRAW_STATUS.DRAWABLE && status.value != DRAW_STATUS.EDITABLE && status.value != DRAW_STATUS.DELETABLE
semiMinorAxis: 1.0, // 短半轴(米)
semiMajorAxis: 1.0, // 长半轴(米)— 两者相等即为圆
material: Color.GREEN.withAlpha(0.4), // 填充颜色,半透明
height: 0, // 椭圆所在高度(米),可选
extrudedHeight: 0, // 拉伸高度,>0 会形成圆柱体,设为0则为平面
outlineColor: Color.GREEN
let options: CircleOptions = {
polygonDrawer = new CircleDrawer(viewer.value as Viewer, options)
status.value = polygonDrawer.getStatus()
const drawPolygonEdit = () => {
polygonDrawer.setEditStatus()
status.value = polygonDrawer.getStatus()
const drawPolygonRemove = () => {
status.value = polygonDrawer.getStatus()