无人机管理后台前端(已迁走)
张含笑
2025-11-07 60b29d7e60c326d4f1d32848b7c3563b9023b170
feat:填充色
2 files modified
37 ■■■■■ changed files
src/views/layerManagement/components/utils.js 35 ●●●●● patch | view | raw | blame | history
src/views/layerManagement/index.vue 2 ●●● patch | view | raw | blame | history
src/views/layerManagement/components/utils.js
@@ -180,35 +180,7 @@
    
        
    }
    // 清除不在范围内的点
    removeLastInvalidPoint() {
        const posLen = this.curPolygon.positions.length
        if (posLen === 0) return
        let targetPointId = ''
        let removeCount = 0
        if (posLen === 2) {
            removeCount = 2
            targetPointId = `${DrawPolygon.ENTITY_NAMES.POINT_ID_PREFIX}0`
        } else if (posLen > 2) {
            removeCount = 1
            const pointIndex = posLen - 2
            targetPointId = `${DrawPolygon.ENTITY_NAMES.POINT_ID_PREFIX}${pointIndex}`
        }
        this.curPolygon.positions.splice(posLen - removeCount, removeCount)
        const invalidPoint = this.editPolygonPointDataSource.entities.getById(targetPointId)
        if (invalidPoint) {
            this.editPolygonPointDataSource.entities.remove(invalidPoint)
        }
        if (this.curPolygon.positions.length === 0 && this.polygonEntity) {
            this.editPolygonDataSource.entities.remove(this.polygonEntity)
            this.polygonEntity = null
        }
    }
    // 添加一个点
    addPosition(position, isAdd = true) {
        // 第一个点要重复压入一次,形成动态绘制效果
@@ -449,12 +421,7 @@
        this.notify('getPolygonPositions', [])
        this.startDrawing()
    }
    // 删除图斑
    delSpot() {
        this.removeEntities()
        this.isPreviewMode = true
        this.startDrawing()
    }
    // 删除端点
    delPoint() {
        if (this.curPolygon.positions.length <= 3) {
src/views/layerManagement/index.vue
@@ -245,7 +245,7 @@
        material:borderColor,
        clampToGround: true,
      },
      zIndex: 99, // 层级,确保在其他图层上方显示
      zIndex: 99,
    });
  });
  focusOnAllFeatures();