| | |
| | | <script> |
| | | // import axios from 'axios' |
| | | import NCregion from '@/assets/region' |
| | | import {getSensings} from '@/api/remote/remote' |
| | | |
| | | // 图层变量做声明 |
| | | var farmRegionLayer = null |
| | |
| | | maximumLevel: 18 |
| | | }) |
| | | ) |
| | | |
| | | // http://arcgis.jxpskj.com:6080/arcgis/rest/services/nanchengdom/MapServer |
| | | |
| | | // arcgis服务添加 |
| | | global.viewer.imageryLayers.addImageryProvider( |
| | | new global.DC.Namespace.Cesium.WebMapTileServiceImageryProvider({ |
| | | url: 'http://arcgis.jxpskj.com:6080/arcgis/rest/services/nanchengyjjddom/MapServer/WMTS', |
| | | // url: 'http://arcgis.jxpskj.com:6080/arcgis/rest/services/nanchengdom/MapServer/WMTS', |
| | | layer: 'nanchengyjjddom', |
| | | 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' |
| | | ] |
| | | getSensings("SHOW").then(res=>{ |
| | | res.data.data.forEach(e=>{ |
| | | global.viewer.imageryLayers.addImageryProvider( |
| | | new global.DC.Namespace.Cesium.UrlTemplateImageryProvider({ |
| | | url: e.reUrl, |
| | | maximumLevel: 18 |
| | | }) |
| | | ) |
| | | }) |
| | | ) |
| | | |
| | | // arcgis服务添加 |
| | | global.viewer.imageryLayers.addImageryProvider( |
| | | new global.DC.Namespace.Cesium.WebMapTileServiceImageryProvider({ |
| | | url: 'http://arcgis.jxpskj.com:6080/arcgis/rest/services/nanchengdom/MapServer/WMTS', |
| | | // 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' |
| | | ] |
| | | }) |
| | | ) |
| | | }) |
| | | |
| | | // 矢量电子 |
| | | // global.viewer.imageryLayers.addImageryProvider( |
| | |
| | | * @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: { |
| | | // 指向 |