| | |
| | | <script> |
| | | |
| | | // import SelectName from '@/components/selectName' |
| | | import { viewdata } from '@/assets/viewdata.js' |
| | | import { getRemoteDetailsList,getFormat } from '@/assets/viewdata.js' |
| | | let baselayerElc = null |
| | | let num = 0 |
| | | export default { |
| | |
| | | rollerCloseShow: false, |
| | | screenShow: false, |
| | | location: '', |
| | | farmSelectList: viewdata, |
| | | currentTitle: viewdata[0].name, |
| | | timeLineList: viewdata[0].childItem, |
| | | currentObj: viewdata[0].childItem[0], |
| | | // farmSelectList: viewdata, |
| | | // currentTitle: viewdata[0].name, |
| | | // timeLineList: viewdata[0].childItem, |
| | | // currentObj: viewdata[0].childItem[0], |
| | | farmSelectList: null, |
| | | currentTitle: null, |
| | | timeLineList: null, |
| | | currentObj: null, |
| | | currentInd: 0 |
| | | } |
| | | }, |
| | | mounted () { |
| | | created () { |
| | | this.settingViewdata() |
| | | }, |
| | | mounted () { |
| | | if (global.viewer != null) { |
| | | global.viewer = null |
| | | } |
| | |
| | | |
| | | global.viewer.use(new global.DC.Measure()) |
| | | |
| | | _this.$nextTick(() => { |
| | | if (viewdata.length > 0) { |
| | | _this.settingViewdata(viewdata) |
| | | } |
| | | }); |
| | | // _this.$nextTick(() => { |
| | | // if (viewdata.length > 0) { |
| | | // _this.settingViewdata() |
| | | // } |
| | | // }); |
| | | |
| | | // global.viewer.locationBar.enable = true |
| | | } |
| | |
| | | |
| | | // global.viewer.imageryLayers.removeAll() |
| | | }, |
| | | settingViewdata(viewdata) { |
| | | viewdata.forEach(item => { |
| | | global.viewer.imageryLayers.addImageryProvider( |
| | | new global.DC.Namespace.Cesium.UrlTemplateImageryProvider({ |
| | | url: item.selectItem.url, |
| | | maximumLevel: 18 |
| | | }) |
| | | ) |
| | | settingViewdata() { |
| | | getRemoteDetailsList().then(res => { |
| | | var dataTmp = [] |
| | | dataTmp = getFormat(res.data.data,dataTmp) |
| | | dataTmp.forEach(item => { |
| | | global.viewer.imageryLayers.addImageryProvider( |
| | | new global.DC.Namespace.Cesium.UrlTemplateImageryProvider({ |
| | | url: item.selectItem.url, |
| | | maximumLevel: 18 |
| | | }) |
| | | ) |
| | | }) |
| | | // this.farmSelectList = dataTmp |
| | | // this.currentTitle = dataTmp[0].name |
| | | // this.timeLineList = dataTmp[0].childItem |
| | | // this.currentObj = dataTmp[0].childItem[0] |
| | | |
| | | this.farmSelectList=dataTmp |
| | | this.currentTitle= dataTmp[0].name |
| | | this.timeLineList= dataTmp[0].childItem |
| | | this.currentObj= dataTmp[0].selectItem |
| | | this.currentInd = dataTmp[0].selectItem.index |
| | | // 初始化地图坐标 默认显示第一个基地 |
| | | global.viewer.camera.setView({ |
| | | // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州 |
| | | // fromDegrees()方法,将经纬度和高程转换为世界坐标 |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromDegrees( |
| | | dataTmp[0].latitude, dataTmp[0].longitude, 1800.0 |
| | | ), |
| | | orientation: { |
| | | // 指向 |
| | | heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0), |
| | | // 视角 |
| | | pitch: global.DC.Namespace.Cesium.Math.toRadians(-90), |
| | | roll: 0.0 |
| | | } |
| | | }) |
| | | }) |
| | | // 初始化地图坐标 默认显示第一个基地 |
| | | global.viewer.camera.setView({ |
| | | // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州 |
| | | // fromDegrees()方法,将经纬度和高程转换为世界坐标 |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromDegrees( |
| | | viewdata[0].latitude, viewdata[0].longitude, 1800.0 |
| | | ), |
| | | orientation: { |
| | | // 指向 |
| | | heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0), |
| | | // 视角 |
| | | pitch: global.DC.Namespace.Cesium.Math.toRadians(-90), |
| | | roll: 0.0 |
| | | } |
| | | }) |
| | | |
| | | |
| | | } |
| | | } |
| | | } |