guanqb
2023-02-24 4c3ba5ac5afecbea1a0e1201d0c3f2595be0b734
src/components/map/index.vue
@@ -356,6 +356,10 @@
            that.mapRemoveLayer(params.layerName, params.type)
        })
        this.$EventBus.$on('mapRemovePolygonLayer', (params) => {
            that.mapRemovePolygonLayer(params.layerName, params.polygonName,params.type)
        })
        this.$EventBus.$on('mapClearLayer', (params) => {
            that.mapClearLayer(params.layerName, params.type)
        })
@@ -566,6 +570,20 @@
        },
        /**
         * 删除图层指定面
         * @param {*} layerName 图层名称
         * @param {*} polygonName 面名称
         * @param {*} type 图层类型
         */
         mapRemovePolygonLayer (layerName,polygonName, type) {
            if (type == 'VectorLayer' || type == 'ClusterLayer' || type == 'HeatLayer') {
                if (layersObjcect[layerName] && layersObjcect[layerName] != null&&polygonObj[polygonName]&&polygonObj[polygonName]!=null) {
                    layersObjcect[layerName].removeOverlay(polygonObj[polygonName])
                }
            }
        },
        /**
         * 清空图层
         * @param {*} layerName 图层名称
         * @param {*} type 图层类型