二维GIS高程
This commit is contained in:
		| @ -5,7 +5,8 @@ | ||||
| <script setup> | ||||
| import { workScheduleDel } from '@/api/progress/plan'; | ||||
| import { renderFacilitiesToCesium } from '@/views/gisHome/js/renderFacilities'; | ||||
| let sdk = null; | ||||
| import axios from 'axios'; | ||||
| import md5 from 'js-md5'; | ||||
|  | ||||
| const initFacilities = async () => { | ||||
|   const res = await workScheduleDel('1933358821565095951'); | ||||
| @ -16,8 +17,8 @@ const initFacilities = async () => { | ||||
|  | ||||
| // 初始化 Cesium 地球 | ||||
| const createEarth = () => { | ||||
|   sdk = new YJ.YJEarth('olMap'); | ||||
|  | ||||
|   let sdk = new YJ.YJEarth('olMap'); | ||||
|   window.sdk = sdk; | ||||
|   YJ.Global.setDefaultView(sdk, { | ||||
|     destination: { lng: 100, lat: 30, alt: 22099000 }, | ||||
|     orientation: { | ||||
| @ -39,13 +40,39 @@ const createEarth = () => { | ||||
|   new YJ.Tools(sdk).flyHome(0); | ||||
| }; | ||||
|  | ||||
| const handletilList = async () => { | ||||
|   // axios.post('http://192.168.110.2:8895/yjearth4.0/api/v1/source/list').then((res) => { | ||||
|   //   console.log(res); | ||||
|   // }); | ||||
|   window.tileset = new YJ.Obj.Tileset(window.sdk, { | ||||
|     id: 'b8d2d39c10f4e5568e647fde175d652b' | ||||
|     //       host: getAddress(), | ||||
|     //       show: true, | ||||
|     //       position: position, | ||||
|     //       ...node.detail, | ||||
|     //       name: node.source_name, | ||||
|   }); | ||||
|   window.terrain = new YJ.Obj.Terrain(window.sdk, { | ||||
|     id: 'e904acb32aaa8b872c64866ebaaaf5e2' | ||||
|   }); | ||||
|   await tileset.on(); | ||||
|  | ||||
|   tileset.flyTo(); // terrain.on(); | ||||
| }; | ||||
|  | ||||
| onMounted(async () => { | ||||
|   // 最早执行 | ||||
|   window.CESIUM_BASE_URL = '/Cesium/'; | ||||
|   console.log(md5('admin_admin123')); | ||||
|  | ||||
|   await YJ.on(); | ||||
|   await YJ.on({ | ||||
|     username: 'admin', | ||||
|     password: md5('admin_admin123'), | ||||
|     host: 'http://192.168.110.2:8895/' | ||||
|   }); | ||||
|   createEarth(); | ||||
|   await initFacilities(); | ||||
|   await handletilList(); | ||||
|   // await initFacilities(); | ||||
|   console.log(YJ); | ||||
| }); | ||||
| </script> | ||||
|  | ||||
		Reference in New Issue
	
	Block a user