From a609fc88cec4d74460b5255bdfdd430fb6a6ffa2 Mon Sep 17 00:00:00 2001 From: TreeWish <1131093754@qq.com> Date: 星期四, 16 二月 2023 11:07:53 +0800 Subject: [PATCH] 修改初始化定位 --- src/components/Screen/mapsdk.vue | 43 ++++++++++++++++++++++++------------------- 1 files changed, 24 insertions(+), 19 deletions(-) diff --git a/src/components/Screen/mapsdk.vue b/src/components/Screen/mapsdk.vue index c5c6f6c..2894c7b 100644 --- a/src/components/Screen/mapsdk.vue +++ b/src/components/Screen/mapsdk.vue @@ -1,16 +1,15 @@ <template> - <div class="ParentCentermapdiv"> + <div class="ParentCentermapdiv"> <div id="Centermapdiv"></div> </div> </template> <script> - export default { name: "", components: {}, data() { - return{} + return {} }, mounted() { this.init3DMap() @@ -25,10 +24,22 @@ window.Viewer = window.sgworld._Viewer Viewer.imageryLayers._layers[0].show = false //瀹氫綅 + // Viewer.camera.flyTo({ + // destination: Cesium.Cartesian3.fromDegrees(110, 33, 25000000), + // }) Viewer.camera.flyTo({ - destination: Cesium.Cartesian3.fromDegrees(110, 33, 25000000), + destination: { + x: -3919623.6069864673, + y: 13752070.475126158, + z: 8307291.863719194, + }, + orientation: { + heading: 6.283185307179582, + roll: 0, + pitch: -1.5707039123519846, + }, + }) - }); Viewer.imageryLayers.addImageryProvider( new Cesium.UrlTemplateImageryProvider({ url: gaoDeBaseUrl[0].url, @@ -46,8 +57,6 @@ }) ) - - Viewer._enableInfoOrSelection = false //鏄剧ずfps Viewer.scene.debugShowFramesPerSecond = false @@ -58,7 +67,6 @@ //寮�鍚繁搴︽娴� sgworld.Analysis.depthTestAgainstTerrain(true) - Viewer.terrainProvider = new Cesium.CesiumTerrainProvider({ url: demLayer, }) @@ -66,23 +74,20 @@ //鏀瑰彉澶╃┖棰滆壊涓洪粦鑹� Viewer.scene.skyBox.show = false //鍏抽棴澶╃┖鐩掞紝鍚﹀垯浼氭樉绀哄ぉ绌洪鑹� //鑳屾櫙閫忔槑 - Viewer.scene.backgroundColor = new Cesium.Color(0.0, 0.0, 0.0, 0.0); + Viewer.scene.backgroundColor = new Cesium.Color(0.0, 0.0, 0.0, 0.0) }, - - } - + }, } </script> <style scoped lang="scss"> -.ParentCentermapdiv{ +.ParentCentermapdiv { display: fixed; height: 100%; - width: 100%; + width: 100%; } - #Centermapdiv{ - height: 100%; - width: 100%; - } - +#Centermapdiv { + height: 100%; + width: 100%; +} </style> -- Gitblit v1.9.3