| | |
| | | * @Author: shuishen 1109946754@qq.com |
| | | * @Date: 2022-08-18 17:00:30 |
| | | * @LastEditors: shuishen 1109946754@qq.com |
| | | * @LastEditTime: 2023-02-22 17:44:18 |
| | | * @LastEditTime: 2023-02-23 17:31:31 |
| | | * @FilePath: \srs-police-affairs\src\components\map\index.vue |
| | | * @Description: 公用地图组件 |
| | | * |
| | |
| | | </div> |
| | | |
| | | <map-popup></map-popup> |
| | | |
| | | <assemble-box></assemble-box> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | that.layerPolylineAdd(params.layerName, params.positions, params.material, params.width, params.params, params.incident) |
| | | }) |
| | | |
| | | this.$EventBus.$on('getOverLayerID', (params) => { |
| | | that.getOverLayerID(params.layerName, params.ids, params.cb) |
| | | }) |
| | | |
| | | this.$EventBus.$on('layerShow', (params) => { |
| | | that.layerShow(params.layerName, params.flag) |
| | | }) |
| | |
| | | }, |
| | | |
| | | /** |
| | | * @description: 通过ID获取图层 |
| | | * @return {*} |
| | | */ |
| | | getOverLayerID (layerName, ids = [], cb) { |
| | | |
| | | const data = ids.reduce((pre, cur) => { |
| | | |
| | | if ( |
| | | layersObjcect[layerName].getOverlay(cur.overlayId) |
| | | && layersObjcect[layerName].getOverlay(cur.overlayId) != undefined |
| | | && layersObjcect[layerName].getOverlay(cur.overlayId) != null |
| | | && layersObjcect[layerName].getOverlay(cur.overlayId) != '' |
| | | ) { |
| | | pre.push(layersObjcect[layerName].getOverlay(cur.overlayId).attrParams) |
| | | } else { |
| | | layersObjcect[layerName].eachOverlay(item => { |
| | | if (item.overlayId == cur.overlayId) |
| | | pre.push(item.attrParams) |
| | | }) |
| | | } |
| | | |
| | | return pre |
| | | |
| | | }, []) |
| | | |
| | | cb(data) |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 图层显示隐藏 |
| | | * @param {*} layerName 图层名称 |
| | | * @param {*} flag 显示隐藏 |