| | |
| | | <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 |
| | | } |
| | | }, |
| | | |
| | | created () { |
| | | // this.leftRollerLayers = [ |
| | | // { |
| | | // title: '2022年6月影像', |
| | | // url: 'http://arcgis.jxpskj.com:6080/arcgis/rest/services/nanchengdom/MapServer/WMTS', |
| | | // layer: 'nanchengdom', |
| | | // style: 'default', |
| | | // tileMatrixSetID: 'default028mm', |
| | | // format: 'image/png', |
| | | // tilingScheme: new global.DC.Namespace.Cesium.GeographicTilingScheme(), |
| | | // maximumLevel: 19, |
| | | // tileMatrixLabels: [ |
| | | // '0', |
| | | // '1', |
| | | // '2', |
| | | // '3', |
| | | // '4', |
| | | // '5', |
| | | // '6', |
| | | // '7', |
| | | // '8', |
| | | // '9', |
| | | // '10', |
| | | // '11', |
| | | // '12', |
| | | // '13', |
| | | // '14', |
| | | // '15', |
| | | // '16', |
| | | // '17', |
| | | // '18', |
| | | // '19' |
| | | // ] |
| | | // }, |
| | | // { |
| | | // title: '2022年7月影像', |
| | | // url: 'http://arcgis.jxpskj.com:6080/arcgis/rest/services/nanchengdomjuly/MapServer/WMTS', |
| | | // layer: 'nanchengdomjuly', |
| | | // style: 'default', |
| | | // tileMatrixSetID: 'default028mm', |
| | | // format: 'image/png', |
| | | // tilingScheme: new global.DC.Namespace.Cesium.GeographicTilingScheme(), |
| | | // maximumLevel: 19, |
| | | // tileMatrixLabels: [ |
| | | // '0', |
| | | // '1', |
| | | // '2', |
| | | // '3', |
| | | // '4', |
| | | // '5', |
| | | // '6', |
| | | // '7', |
| | | // '8', |
| | | // '9', |
| | | // '10', |
| | | // '11', |
| | | // '12', |
| | | // '13', |
| | | // '14', |
| | | // '15', |
| | | // '16', |
| | | // '17', |
| | | // '18', |
| | | // '19' |
| | | // ] |
| | | // }] |
| | | |
| | | // this.rightRollerLayers = [{ |
| | | // title: '2022年6月影像', |
| | | // url: 'http://arcgis.jxpskj.com:6080/arcgis/rest/services/nanchengdom/MapServer/WMTS', |
| | | // layer: 'nanchengdom', |
| | | // style: 'default', |
| | | // tileMatrixSetID: 'default028mm', |
| | | // format: 'image/png', |
| | | // tilingScheme: new global.DC.Namespace.Cesium.GeographicTilingScheme(), |
| | | // maximumLevel: 19, |
| | | // tileMatrixLabels: [ |
| | | // '0', |
| | | // '1', |
| | | // '2', |
| | | // '3', |
| | | // '4', |
| | | // '5', |
| | | // '6', |
| | | // '7', |
| | | // '8', |
| | | // '9', |
| | | // '10', |
| | | // '11', |
| | | // '12', |
| | | // '13', |
| | | // '14', |
| | | // '15', |
| | | // '16', |
| | | // '17', |
| | | // '18', |
| | | // '19' |
| | | // ] |
| | | // }, { |
| | | // title: '2022年7月影像', |
| | | // url: 'http://arcgis.jxpskj.com:6080/arcgis/rest/services/nanchengdomjuly/MapServer/WMTS', |
| | | // layer: 'nanchengdomjuly', |
| | | // style: 'default', |
| | | // tileMatrixSetID: 'default028mm', |
| | | // format: 'image/png', |
| | | // tilingScheme: new global.DC.Namespace.Cesium.GeographicTilingScheme(), |
| | | // maximumLevel: 19, |
| | | // tileMatrixLabels: [ |
| | | // '0', |
| | | // '1', |
| | | // '2', |
| | | // '3', |
| | | // '4', |
| | | // '5', |
| | | // '6', |
| | | // '7', |
| | | // '8', |
| | | // '9', |
| | | // '10', |
| | | // '11', |
| | | // '12', |
| | | // '13', |
| | | // '14', |
| | | // '15', |
| | | // '16', |
| | | // '17', |
| | | // '18', |
| | | // '19' |
| | | // ] |
| | | // }] |
| | | }, |
| | | mounted () { |
| | | created () { |
| | | this.settingViewdata() |
| | | }, |
| | | mounted () { |
| | | if (global.viewer != null) { |
| | | global.viewer = null |
| | | } |
| | | |
| | | var _this = this |
| | | function initViewer () { |
| | | global.viewer = new global.DC.Viewer('viewer-container', { |
| | | contextOptions: { |
| | |
| | | // 影像 |
| | | global.viewer.imageryLayers.addImageryProvider( |
| | | new global.DC.Namespace.Cesium.UrlTemplateImageryProvider({ |
| | | url: 'http://t{s}.tianditu.gov.cn/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=e9533f5acb2ac470b07f406a4d24b4f0', |
| | | url: 'http://t{s}.tianditu.gov.cn/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=e45274b0235bb913eceb393aabbf9c9c', |
| | | subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'], |
| | | format: 'image/jpeg', |
| | | show: true, |
| | |
| | | }) |
| | | ) |
| | | |
| | | viewdata.forEach(item => { |
| | | global.viewer.imageryLayers.addImageryProvider( |
| | | new global.DC.Namespace.Cesium.UrlTemplateImageryProvider({ |
| | | url: item.childItem[0].url, |
| | | maximumLevel: 18 |
| | | }) |
| | | ) |
| | | }) |
| | | // var layerOne = new global.DC.Namespace.Cesium.UrlTemplateImageryProvider({ |
| | | // url: 'http://59.55.128.155:9003/image/wmts/x6FjrhkG/{z}/{x}/{y}', |
| | | // // url: 'http://59.55.128.155:9003/image/wmts/vNjFuYLb/{z}/{x}/{y}', |
| | | // maximumLevel: 18 |
| | | // }) |
| | | // |
| | | // global.viewer.imageryLayers.addImageryProvider(layerOne) |
| | | |
| | | // global.viewer.flyTo(layerOne) |
| | | |
| | | // http://arcgis.jxpskj.com:6080/arcgis/rest/services/nanchengdom/MapServer |
| | | |
| | | // 矢量电子 |
| | | // global.viewer.imageryLayers.addImageryProvider( |
| | | // new global.DC.Namespace.Cesium.UrlTemplateImageryProvider({ |
| | | // url: 'http://t{s}.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=e9533f5acb2ac470b07f406a4d24b4f0', |
| | | // subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'], |
| | | // format: 'image/jpeg', |
| | | // show: true, |
| | | // maximumLevel: 18 |
| | | // }) |
| | | // ) |
| | | |
| | | // global.viewer.imageryLayers.addImageryProvider( |
| | | // new global.DC.Namespace.Cesium.UrlTemplateImageryProvider({ |
| | | // url: 'http://t{s}.tianditu.gov.cn/DataServer?T=cva_w&x={x}&y={y}&l={z}&tk=e9533f5acb2ac470b07f406a4d24b4f0', |
| | | // subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'], |
| | | // format: 'image/jpeg', |
| | | // show: true, |
| | | // maximumLevel: 18 |
| | | // }) |
| | | // ) |
| | | |
| | | global.viewer.use(new global.DC.Measure()) |
| | | // 初始化地图坐标 默认显示第一个基地 |
| | | 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 |
| | | } |
| | | }) |
| | | |
| | | // _this.$nextTick(() => { |
| | | // if (viewdata.length > 0) { |
| | | // _this.settingViewdata() |
| | | // } |
| | | // }); |
| | | |
| | | // global.viewer.locationBar.enable = true |
| | | } |
| | | |
| | | |
| | | |
| | | global.DC.ready(initViewer) |
| | | }, |
| | |
| | | // 遥感监测多时相基地下拉事件 |
| | | selectItem (item, index) { |
| | | this.timeLineList = item.childItem |
| | | this.currentObj = this.timeLineList[0] |
| | | this.currentInd = 0 |
| | | if(this.timeLineList.some(e=>{return e.type == "0"})){ |
| | | for(var i = 0; i<this.timeLineList.length;i++){ |
| | | if(this.timeLineList[i].type == "0"){ |
| | | this.currentObj = this.timeLineList[i] |
| | | this.currentInd = i |
| | | break |
| | | } |
| | | } |
| | | }else{ |
| | | this.currentObj = this.timeLineList[0] |
| | | this.currentInd = 0 |
| | | } |
| | | this.goToDcBylatlon(item.latitude, item.longitude) |
| | | }, |
| | | // 遥感监测卷帘左基地下拉事件 |
| | |
| | | this.$refs.rightRoller.clearLayer() |
| | | |
| | | // global.viewer.imageryLayers.removeAll() |
| | | }, |
| | | 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 |
| | | } |
| | | }) |
| | | }) |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | margin-left: 30px; |
| | | width: 40px; |
| | | height: 40px; |
| | | background: url(/img/icon/roller-close.png) no-repeat; |
| | | background: url(../../../public/img/icon/roller-close.png) no-repeat; |
| | | background-size: 100% 100%; |
| | | } |
| | | |