| | |
| | | import { getToken } from "@/utils/auth"; |
| | | //配置文件地址 |
| | | import config from "../../../../public/config/config"; |
| | | // import config from "../../../../public/config/config"; |
| | | import store from "@/store"; |
| | | const server = { |
| | | layerList: [], |
| | | graticules: null, |
| | | addTreeData(treeNode) { |
| | | if (!treeNode.checked) { |
| | | this.delLayer(treeNode.id); |
| | |
| | | } else { |
| | | this.addUrlAddress(treeNode); //无代理 |
| | | } |
| | | |
| | | if (this.graticules) { |
| | | window.Viewer.imageryLayers.raiseToTop(this.graticules.imageryLayer); |
| | | } |
| | | }, |
| | | showlonlatLine() { |
| | | if (!this.graticules) { |
| | | SmartEarth.Cesium.Ellipsoid.WGS84 = new SmartEarth.Cesium.Ellipsoid(1737400.0, 1737400.0, 1737400.0) |
| | | |
| | | this.graticules = new SmartEarth.Cesium.Graticules( |
| | | earthCtrl.Viewer, |
| | | SmartEarth.Cesium.Color.PALEGREEN |
| | | ); |
| | | // graticules.makeCoordAxiss(); |
| | | var that = this; |
| | | earthCtrl.Viewer.scene.preUpdate.addEventListener(function () { |
| | | that.graticules.update(); |
| | | }); |
| | | } else { |
| | | this.graticules.enabled = !this.graticules.enabled |
| | | } |
| | | |
| | | |
| | | }, |
| | | //代理地址 |
| | | addProxyAddress(res) { |
| | |
| | | var url = this.getLayrUrl(res); |
| | | window.terrainLayer = new Cesium.CesiumTerrainProvider({ |
| | | url: url, |
| | | tilingScheme: new Cesium.GeographicTilingScheme({ |
| | | ellipsoid: Cesium.Ellipsoid.MOON, |
| | | }), |
| | | |
| | | }); |
| | | Viewer.terrainProvider = window.terrainLayer; |
| | | Viewer.scene.globe.terrainExaggeration = 1.0000001; |
| | | this.layerList.push({ id: res.id, type: "dem" }); |
| | | }, |
| | | //加载WMS服务 |
| | |
| | | }); |
| | | layer.name = `Wms_Layer${res.id}`; |
| | | let img_layer = window.Viewer.imageryLayers.addImageryProvider(layer); |
| | | |
| | | this.layerList.push({ id: res.id, layerData: img_layer, type: "wmts" }); |
| | | }, |
| | | addGeoServerMmsLayers(layer, url) { |
| | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (!gindex) return |
| | | var str = html.substr(html.indexOf('<td>'), html.lastIndexOf('</td>') - html.indexOf('<td>') + 5).replaceAll(' ', '').replaceAll('\n', '').split('</td>') |
| | | var gid = parseInt(str[gindex].replaceAll( |