| | |
| | | monitoringLayer: null, |
| | | panoramaLayer: null |
| | | } |
| | | let polygonObj = {} |
| | | |
| | | let tilesetLayer = null |
| | | |
| | |
| | | }) |
| | | |
| | | this.$EventBus.$on('layerPolygonAdd', (params) => { |
| | | that.layerPolygonAdd(params.layerName, params.positions, params.material, params.distanceDisplayCondition) |
| | | if ('polygonName' in params) { |
| | | that.layerPolygonAdd(params.layerName, params.positions, params.material, params.distanceDisplayCondition, params.polygonName) |
| | | } else { |
| | | that.layerPolygonAdd(params.layerName, params.positions, params.material, params.distanceDisplayCondition, 'polygon') |
| | | } |
| | | }) |
| | | |
| | | this.$EventBus.$on('layerPolylineAdd', (params) => { |
| | |
| | | }) |
| | | |
| | | this.$EventBus.$on('flytoLayer', (params) => { |
| | | that.flytoLayer(params.layerName, params.duration) |
| | | that.flytoLayer(params.polygonName, params.duration) |
| | | }) |
| | | |
| | | }, |
| | |
| | | * @param {*} material 颜色 |
| | | * @param {*} distanceDisplayCondition 可见距离 |
| | | */ |
| | | layerPolygonAdd (layerName, positions, material, distanceDisplayCondition) { |
| | | layerPolygonAdd (layerName, positions, material, distanceDisplayCondition, polygonName) { |
| | | if (!layersObjcect[layerName] || layersObjcect[layerName] == null) { |
| | | this.mapAddLayer(layerName, 'VectorLayer') |
| | | |
| | | layersObjcect[layerName].allowDrillPicking = true |
| | | } |
| | | |
| | | let polygon = new global.DC.Polygon(positions) |
| | | |
| | | polygon.setStyle({ |
| | | // let polygon = new global.DC.Polygon(positions) |
| | | // let polygonObj = {}//要在全局定义 |
| | | polygonObj[polygonName] = new global.DC.Polygon(positions) |
| | | // polygon.setStyle({ |
| | | polygonObj[polygonName].setStyle({ |
| | | material: material, |
| | | distanceDisplayCondition: distanceDisplayCondition, |
| | | perPositionHeight: true, |
| | | }) |
| | | |
| | | layersObjcect[layerName].addOverlay(polygon) |
| | | // layersObjcect[layerName].addOverlay(polygon) |
| | | layersObjcect[layerName].addOverlay(polygonObj[polygonName]) |
| | | }, |
| | | |
| | | /** |
| | |
| | | // sdTilesetLayer |
| | | |
| | | /** |
| | | * 飞到指定图层 |
| | | * @param {*} layerName 图层名称 |
| | | * 飞到指定范围 |
| | | * @param {*} polygonName 范围名称 |
| | | * @param {*} duration 时间 |
| | | */ |
| | | flytoLayer (layerName, duration = 3) { |
| | | global.viewer.flyTo(layersObjcect[layerName], duration) |
| | | flytoLayer (polygonName, duration = 3) { |
| | | global.viewer.flyTo(polygonObj[polygonName], duration) |
| | | }, |
| | | |
| | | /** |