import mapClick from "./mapClick"; import store from "@/store"; import configTool from "@/assets/js/tool/configTool"; import mapPlan from "./tool/mapPlan"; const mapView = { init() { window.earthCtrl = new SmartEarth.EarthCtrl("cesiumContainer", { // printLog: false }); window.Viewer = earthCtrl._Viewer; window.Cesium = SmartEarth.Cesium; earthCtrl.camera.stop(); //取消飞行状态 // 关闭深度检测 Viewer.scene.globe.depthTestAgainstTerrain = false; window.widget = Viewer.widget; earthCtrl.showFPS = true; // 飞行定位 // configTool.setMapFly({ // lon: 120.862482, // lat: 44.7786221, // alt: 300000, // heading: 6.283185307179586, // pitch: -1.5707963267948966, // roll: 0 // }); try { Viewer.scene.postRender.addEventListener(() => { }); } catch (e) { if (window.widget._showRenderLoopErrors) { var title = "开始时间: " + mapPlan.startTime + "结束时间: " + mapPlan.formatDate(); window.widget.showErrorPanel(title, undefined, e); } } mapClick.Init(); } }; export default mapView;