Browse Source

设置初始视角为太湖

baixuanda 2 tháng trước cách đây
mục cha
commit
c14a5b8c35
1 tập tin đã thay đổi với 8 bổ sung5 xóa
  1. 8 5
      WebVue/TaiHufenglang/src/components/Cesium.vue

+ 8 - 5
WebVue/TaiHufenglang/src/components/Cesium.vue

@@ -11,7 +11,9 @@ import "cesium/Build/CesiumUnminified/Widgets/widgets.css";
 const TDTTK = "d9e7aa2ad204aba6aeedea6f5ab48ed9";
 
 onMounted(() => {
-  const viewer = new Cesium.Viewer('cesiumContainer');
+  const viewer = new Cesium.Viewer('cesiumContainer', {
+    timeline: false,
+  });
   // 天地图影像
   const tdtLayer = new Cesium.WebMapTileServiceImageryProvider({
     url: `http://t0.tianditu.com/img_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={TileMatrix}&TILEROW={TileRow}&TILECOL={TileCol}&tk=${TDTTK}`,
@@ -34,14 +36,15 @@ onMounted(() => {
     show: false,
   });
 
- 
+   // 移除默认水印(新增)
+   viewer.cesiumWidget.creditContainer.style.display = "none";
 
-  // 设置初始镜头位置(北京
+  // 设置初始镜头位置(太湖
   viewer.camera.setView({
-    destination: Cesium.Cartesian3.fromDegrees(116.3, 39.9, 100000),
+    destination: Cesium.Cartesian3.fromDegrees(120.169103, 31.226174, 500000),
     orientation: {
       heading: Cesium.Math.toRadians(0),
-      pitch: Cesium.Math.toRadians(-45),
+      pitch: Cesium.Math.toRadians(-90),
     },
   });