shuishen
2022-09-20 9d967228f25d0eb4635c4438576b139f2d8fe257
绘制线段
2 files modified
52 ■■■■■ changed files
src/components/map/index.vue 31 ●●●●● patch | view | raw | blame | history
src/views/home/index.vue 21 ●●●● patch | view | raw | blame | history
src/components/map/index.vue
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2022-08-18 17:00:30
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2022-09-20 16:25:50
 * @LastEditTime: 2022-09-20 17:07:27
 * @FilePath: \srs-police-affairs\src\components\map\index.vue
 * @Description: 公用地图组件
 * 
@@ -341,6 +341,10 @@
            that.layerPolygonAdd(params.layerName, params.positions, params.material)
        })
        this.$EventBus.$on('layerPolylineAdd', (params) => {
            that.layerPolylineAdd(params.layerName, params.positions, params.material, params.width)
        })
        this.$EventBus.$on('layerShow', (params) => {
            that.layerShow(params.layerName, params.flag)
        })
@@ -514,6 +518,31 @@
        },
        /**
         * 图层线添加
         * @param {*} layerName 图层名称
         * @param {*} positions 图层位置数据
         * @param {*} material 颜色
         * @param {*} width 宽度
         */
        layerPolylineAdd (layerName, positions, material, width) {
            if (!layersObjcect[layerName] || layersObjcect[layerName] == null) {
                this.mapAddLayer(layerName, 'VectorLayer')
                layersObjcect[layerName].allowDrillPicking = true
            }
            let polyline = new global.DC.Polyline(positions)
            polyline.setStyle({
                width: width,
                material: material,
                clampToGround: false
            })
            layersObjcect[layerName].addOverlay(polyline)
        },
        /**
         * 图层显示隐藏
         * @param {*} layerName 图层名称
         * @param {*} flag 显示隐藏
src/views/home/index.vue
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2022-08-18 16:18:17
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2022-09-20 14:41:50
 * @LastEditTime: 2022-09-20 16:58:31
 * @FilePath: \srs-police-affairs\src\views\home\index.vue
 * @Description: 小区-栋-层-房屋
 * 
@@ -636,11 +636,19 @@
            option && myChart.setOption(option)
        },
        // 模型的点击事件
        tilesetClick (e) {
            console.log(e)
            this.$router.push({ path: '/lyout/house', query: { id: '1' } })
        },
        houseChange (e) {
            if (e == true) {
                this.$EventBus.$emit('addMxTileset', {
                    titlesetName: 'sdTilesetLayer',
                    titlesetUrl: "/sd/tileset.json"
                    titlesetUrl: "/sd/tileset.json",
                    incident: this.tilesetClick
                })
            } else {
                this.$EventBus.$emit('removeMxTileset', {
@@ -716,6 +724,7 @@
                })
            }
        },
        getChooseData () {
            let arr1 = ['一区', '二区', '三区']
            let arr2 = ['1所', '2所', '3所']
@@ -748,7 +757,13 @@
        twoSelected (item1, item2) {
            console.log(item2)
            this.threeChooseData = this.twoChooseData[item1]
        }
        },
        threeSelected (newData, oldData) {
            if (this.houseLayerShow == false) {
                this.houseLayerShow = true
                this.houseChange(this.houseLayerShow)
            }
        },
    },
    destroyed () {