智慧农业后台管理页面
guoshilong
2022-09-26 7a4320204682aa29e36477260c0de6b873d84b6c
src/components/map/plotMap.vue
@@ -43,7 +43,6 @@
        }
        function initViewer (lat,lon) {
            console.log(11111111111)
            global.viewer = new global.DC.Viewer('viewer-container', {
                contextOptions: {
                    webgl: {
@@ -54,7 +53,6 @@
                },
                sceneMode: 2
            })
            console.log(global,22222222222)
            farmRegionLayer = new global.DC.VectorLayer('farmRegionLayer')
            global.viewer.addLayer(farmRegionLayer)
@@ -348,23 +346,27 @@
                // })
                // farmLogoLayer.addOverlay(divIcon)
            }
            const polygon = new global.DC.Polygon(positions)
            polygon.attrParams = item
            polygon.setStyle({
                material: global.DC.Namespace.Cesium.Color.fromBytes(
                    129, 255, 84,
                    200
                )
            })
            if(positions){
                const polygon = new global.DC.Polygon(positions)
                polygon.attrParams = item
                polygon.setStyle({
                    material: global.DC.Namespace.Cesium.Color.fromBytes(
                        129, 255, 84,
                        200
                    )
                })
            polygon.on(global.DC.MouseEventType.CLICK, (e) => {
                that.$parent.plotDetailsPopupShow(e.overlay.attrParams)
                that.drawLandPolyLine(positions)
            })
                polygon.on(global.DC.MouseEventType.CLICK, (e) => {
                    that.$parent.plotDetailsPopupShow(e.overlay.attrParams)
                    that.drawLandPolyLine(positions)
                })
            plotRegionLayer.addOverlay(polygon)
            addPlotLayers.push({ center, name: item.landName, id: item.id })
                plotRegionLayer.addOverlay(polygon)
                addPlotLayers.push({ center, name: item.landName, id: item.id })
            }
        },
        /**
         * 地块画线