| | |
| | | |
| | | <script> |
| | | let yunxuanLayer = null |
| | | import mapMenu from '../js/index.js' |
| | | export default { |
| | | name: "", |
| | | components: {}, |
| | |
| | | // }) |
| | | }, |
| | | methods: { |
| | | init3DMap() { |
| | | //地图初始化 |
| | | // window.sgworld = new SmartEarth.SGWorld("Centermapdiv", { |
| | | // licenseServer: window.sceneConfig.licenseServer, |
| | | // }) |
| | | // window.sgworld = new SmartEarth.SGWorld( |
| | | // "Centermapdiv", |
| | | // function () { } |
| | | // ) |
| | | window.sgworld = new SmartEarth.SGWorld("Centermapdiv", { |
| | | |
| | | licenseServer: window.sceneConfig.licenseServer, |
| | | }); |
| | | window.viewer = window.Viewer = window.sgworld._Viewer; |
| | | initData() { |
| | | if (is_production) { |
| | | Viewer.imageryLayers.removeAll(); |
| | | } |
| | | // Viewer.imageryLayers._layers[0].show = false |
| | | sgworld.Navigate.jumpTo({ //跳转视角 |
| | | destination: new Cesium.Cartesian3.fromDegrees(110, 32, 50000000) |
| | |
| | | }) |
| | | }, 1000); |
| | | |
| | | // Viewer.imageryLayers.addImageryProvider( |
| | | // new Cesium.UrlTemplateImageryProvider({ |
| | | // url: gaoDeBaseUrl[0].url, |
| | | // }) |
| | | // ) |
| | | // Viewer.imageryLayers._layers[1].show = false |
| | | |
| | | // Viewer.imageryLayers.addImageryProvider( |
| | | // new Cesium.UrlTemplateImageryProvider({ |
| | | // url: gaoDeBaseUrl[1].url, |
| | | // }) |
| | | // ) |
| | | // Viewer.imageryLayers.addImageryProvider( |
| | | // new Cesium.UrlTemplateImageryProvider({ |
| | | // url: gaoDeBaseUrl[2].url, |
| | | // }) |
| | | // ) |
| | | if (is_production) { |
| | | var base_ulr = window.sceneConfig.baseUrl; |
| | | if (base_ulr.indexOf('{host}') > -1) { |
| | | base_ulr = base_ulr.replace("{host}", iisHost) |
| | | } |
| | | Viewer.imageryLayers.addImageryProvider( |
| | | new Cesium.UrlTemplateImageryProvider({ |
| | | url: base_ulr, |
| | | maximumLevel: 5 |
| | | }) |
| | | ); |
| | | window.BaseMapLayer = Viewer.imageryLayers.addImageryProvider( |
| | | new Cesium.UrlTemplateImageryProvider({ |
| | | url: base_ulr, |
| | | }) |
| | | ); |
| | | var base_ulr_sl = window.sceneConfig.baseUrl_sl; |
| | | if (base_ulr_sl.indexOf('{host}') > -1) { |
| | | base_ulr_sl = base_ulr_sl.replace("{host}", iisHost) |
| | | } |
| | | window.BaseMapLayer = Viewer.imageryLayers.addImageryProvider( |
| | | new Cesium.UrlTemplateImageryProvider({ |
| | | url: base_ulr_sl, |
| | | |
| | | }) |
| | | ); |
| | | Viewer.imageryLayers._layers[2].show = false |
| | | } else { |
| | | Viewer.imageryLayers.addImageryProvider( |
| | | new Cesium.UrlTemplateImageryProvider({ |
| | | url: gaoDeBaseUrl[0].url, |
| | | }) |
| | | ) |
| | | |
| | | // Viewer.imageryLayers.addImageryProvider( |
| | | // new Cesium.UrlTemplateImageryProvider({ |
| | | // url: gaoDeBaseUrl[1].url, |
| | | // }) |
| | | // ) |
| | | // Viewer.imageryLayers.addImageryProvider( |
| | | // new Cesium.UrlTemplateImageryProvider({ |
| | | // url: gaoDeBaseUrl[2].url, |
| | | // }) |
| | | // ) |
| | | Viewer.imageryLayers._layers[1].show = false |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | Viewer._enableInfoOrSelection = false |
| | | //显示fps |
| | |
| | | //背景透明 |
| | | Viewer.scene.backgroundColor = new Cesium.Color(0.0, 0.0, 0.0, 0.0) |
| | | }, |
| | | init3DMap() { |
| | | //地图初始化 |
| | | // window.sgworld = new SmartEarth.SGWorld("Centermapdiv", { |
| | | // licenseServer: window.sceneConfig.licenseServer, |
| | | // }) |
| | | // window.sgworld = new SmartEarth.SGWorld( |
| | | // "Centermapdiv", |
| | | // function () { } |
| | | // ) |
| | | window.sgworld = new SmartEarth.SGWorld("Centermapdiv", { |
| | | |
| | | licenseServer: window.sceneConfig.licenseServer, |
| | | }); |
| | | window.viewer = window.Viewer = window.sgworld._Viewer; |
| | | var data = mapMenu.init(); |
| | | data.then((res) => { |
| | | if (!res) { |
| | | mapMenu.addGaoDeMap(); |
| | | } |
| | | this.initData(); |
| | | }) |
| | | }, |
| | | }, |
| | | } |
| | | </script> |
| | |
| | | height: 100%; |
| | | width: 100%; |
| | | } |
| | | |
| | | #Centermapdiv { |
| | | height: 100%; |
| | | width: 100%; |