| | |
| | | * @param {*} positions 位置信息(范围信息) |
| | | * @param {*} item 基地对应的所有信息(接口返回的数据) |
| | | */ |
| | | addPolygon (positions, item) { |
| | | addPolygon (item) { |
| | | const that = this |
| | | |
| | | const center = this.getCenter(positions) |
| | | // const center = this.getCenter(positions) |
| | | const center = [item.longitude, item.latitude] |
| | | |
| | | const divIcon = new global.DC.DivIcon( |
| | | new global.DC.Position(center[0], center[1], 0), |
| | |
| | | * 设置中心点 |
| | | * @param {*} name 对应站点(基地范围)的中心点 --- 对应的名字 |
| | | */ |
| | | setCenter (name) { |
| | | let center |
| | | addLayers.forEach(item => { |
| | | if (name == item.name) { |
| | | center = item.center |
| | | } |
| | | }) |
| | | setCenter (farmObj) { |
| | | // let center |
| | | // addLayers.forEach(item => { |
| | | // if (name == item.name) { |
| | | // center = item.center |
| | | // } |
| | | // }) |
| | | |
| | | if (center == '') { |
| | | this.$message({ |
| | | message: '当前基地暂未绘制', |
| | | type: 'warning' |
| | | }) |
| | | return |
| | | } |
| | | // if (center == '') { |
| | | // this.$message({ |
| | | // message: '当前基地暂未绘制', |
| | | // type: 'warning' |
| | | // }) |
| | | // return |
| | | // } |
| | | |
| | | global.viewer.camera.flyTo({ |
| | | // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州 |
| | | // fromDegrees()方法,将经纬度和高程转换为世界坐标 |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromDegrees( |
| | | center[0], center[1], 3000.0 |
| | | farmObj.longitude, farmObj.latitude, 3000.0 |
| | | ), |
| | | orientation: { |
| | | // 指向 |
| | |
| | | }, |
| | | |
| | | setView () { |
| | | let position |
| | | // let position |
| | | // |
| | | // position = this.currentDetails.position.replace(/POLYGON\(\(/g, '') |
| | | // position = position.replace(/\)\)/g, '') |
| | | // |
| | | // const arr = position.split(',') |
| | | // var brr = [] |
| | | // |
| | | // arr.forEach(it => { |
| | | // brr.push(it.split(' ')) |
| | | // }) |
| | | |
| | | position = this.currentDetails.position.replace(/POLYGON\(\(/g, '') |
| | | position = position.replace(/\)\)/g, '') |
| | | this.$refs.modalForm.addPolygon(this.currentDetails) |
| | | |
| | | const arr = position.split(',') |
| | | var brr = [] |
| | | |
| | | arr.forEach(it => { |
| | | brr.push(it.split(' ')) |
| | | }) |
| | | |
| | | this.$refs.modalForm.addPolygon(brr, this.currentDetails) |
| | | |
| | | this.$refs.modalForm.setCenter(this.currentDetails.farmName) |
| | | this.$refs.modalForm.setCenter(this.currentDetails) |
| | | }, |
| | | |
| | | getSourceList (param) { |
| | |
| | | setCenter (item) { |
| | | this.ncListShow = false |
| | | // this.farmId = item.id |
| | | this.AllDataUpdate() |
| | | this.$refs.modalForm.setCenter(item.farmName) |
| | | // this.AllDataUpdate() |
| | | this.$refs.modalForm.setCenter(item) |
| | | }, |
| | | |
| | | setSiteCenter (item, show) { |
| | |
| | | getFarmList () { |
| | | getFarmList().then(res => { |
| | | res.data.data.forEach(item => { |
| | | item.position = item.position.replace(/POLYGON\(\(/g, '') |
| | | item.position = item.position.replace(/\)\)/g, '') |
| | | |
| | | const arr = item.position.split(',') |
| | | var brr = [] |
| | | arr.forEach(it => { |
| | | brr.push(it.split(' ')) |
| | | }) |
| | | this.$refs.modalForm.addPolygon(brr, item) |
| | | // item.position = item.position.replace(/POLYGON\(\(/g, '') |
| | | // item.position = item.position.replace(/\)\)/g, '') |
| | | // |
| | | // const arr = item.position.split(',') |
| | | // var brr = [] |
| | | // arr.forEach(it => { |
| | | // brr.push(it.split(' ')) |
| | | // }) |
| | | this.$refs.modalForm.addPolygon(item) |
| | | }) |
| | | |
| | | this.farmNumArray = res.data.data |