智慧农业大数据平台
guanqb
2022-08-24 54c402021a8aa0bd4454797c0583b2a1ff254ff4
src/components/map/index.vue
@@ -244,9 +244,9 @@
            // })
        },
        /**
         * 添加农场点及范围的方法
         * 添加基地点及范围的方法
         * @param {*} positions 位置信息(范围信息)
         * @param {*} item 农场对应的所有信息(接口返回的数据)
         * @param {*} item 基地对应的所有信息(接口返回的数据)
         */
        addPolygon (positions, item) {
            const that = this
@@ -317,11 +317,17 @@
            polygon.setStyle({
                material: global.DC.Namespace.Cesium.Color.fromBytes(
                    129, 255, 84,
                    200
                    400
                )
            })
            polygon.on(global.DC.MouseEventType.CLICK, (e) => {
                polygon.setStyle({
                    material: global.DC.Namespace.Cesium.Color.fromBytes(
                        129, 255, 0,
                        200
                    )
                })
                that.$parent.plotDetailsPopupShow(e.overlay.attrParams)
            })
@@ -400,7 +406,7 @@
        /**
         * 设置中心点
         * @param {*} name 对应站点(农场范围)的中心点 --- 对应的名字
         * @param {*} name 对应站点(基地范围)的中心点 --- 对应的名字
         */
        setCenter (name) {
            let center
@@ -412,7 +418,7 @@
            if (center == '') {
                this.$message({
                    message: '当前农场暂未绘制',
                    message: '当前基地暂未绘制',
                    type: 'warning'
                })
                return
@@ -523,12 +529,12 @@
            }
            return centerLonLat
        },
        // 隐藏农场标记图层
        // 隐藏基地标记图层
        hiddenFarmLayer () {
            farmLogoLayer.show = false
            farmRegionLayer.show = false
        },
        // 显示农场标记图层
        // 显示基地标记图层
        showFarmLayer () {
            farmLogoLayer.show = true
            farmRegionLayer.show = true