From 5a93ff9c70a25e09d77aff8e9175022b63b3060f Mon Sep 17 00:00:00 2001
From: wangjuncheng <1>
Date: 星期五, 18 七月 2025 10:54:23 +0800
Subject: [PATCH] 1

---
 src/utils/water.js |   46 ++++++++++++++++++++++++++--------------------
 1 files changed, 26 insertions(+), 20 deletions(-)

diff --git a/src/utils/water.js b/src/utils/water.js
index 59a2f68..3d7de0b 100644
--- a/src/utils/water.js
+++ b/src/utils/water.js
@@ -12,7 +12,7 @@
     enableWaterArrowFlow(false);
     water.destroy();
     water = null;
-    console.log("Water simulation destroyed.");
+    // console.log("Water simulation destroyed.");
   }
 }
 
@@ -47,7 +47,7 @@
   ];
 
   const levelCount = colorStops.length;
-  const minAllowed = 0.005; // 鏈�灏忓厑璁稿��
+  const minAllowed = 0.05; // 鏈�灏忓厑璁稿��
   const threshold = 1; // 灏忓�间笌澶у�煎垎鐣岀偣
 
   let effectiveMin = Math.max(minFlowRate, minAllowed); // 鏈�灏忎笉鑳藉皬浜� 0.01
@@ -78,9 +78,7 @@
   }
 
   waterLegendData.value = waterHeightLevels;
-  console.log(waterLegendData.value, "鍥句緥鏁版嵁");
-
-  
+  // console.log(waterLegendData.value, "鍥句緥鏁版嵁");
   water = await earthCtrl.simulate.createWaterSimulateLayer({
     baseUrl,
     interval,
@@ -92,11 +90,19 @@
     colorRender,
     sizeIndex: 0,
   });
-  enableWaterArrowFlow(false);
+  //闃叉缂╂斁瀵艰嚧鍦板舰鍙樺姩鍘嬬洊姘撮潰锛屾按闈㈠鍔犺缃�
+  water.clampMinHeight = 0; //鐩告満鐩稿浜庢按闈㈡渶灏忛珮搴�
+  water.clampMaxHeight = 1000; //鐩告満鐩稿浜庢按闈㈡渶澶ч珮搴�
+  water.offsetMinHeight = 0; //姘村亸绉绘渶灏忛珮搴�
+  water.offsetMaxHeight = 100; //姘村亸绉绘渶澶ч珮搴�
+  // 鏄惁寮�鍚澶�
+  enableWaterArrowFlow(false); 
+  // 鏄惁寮�鍚按闈㈤槾褰�
   toggleWaterShadow(false);
-  console.log(
-    `浠跨湡妯℃嫙鍙傛暟锛氳姹傝矾寰� ${baseUrl}, 甯ч棿闂撮殧 ${interval}ms, 鏄惁寮�鍚笓棰樻覆鏌� ${colorRender}`
-  );
+
+  // console.log(
+  //   `浠跨湡妯℃嫙鍙傛暟锛氳姹傝矾寰� ${baseUrl}, 甯ч棿闂撮殧 ${interval}ms, 鏄惁寮�鍚笓棰樻覆鏌� ${colorRender}`
+  // );
 }
 /**
  * 鍒濆鍖栨按浣撴ā鎷熻鍥�
@@ -118,12 +124,12 @@
   // console.log("Camera view initialized for water simulation.");
 }
 /**
- * 鏇存柊姘撮鑹�
+ * 鏇存崲姘撮�忔槑搴�
  */
-export function updateWaterColor(color) {
+export function updateWaterColor(color, alpha) {
   if (water) {
     water.color = Cesium.Color.fromCssColorString(color);
-    console.log("鍒囨崲棰滆壊涓猴細",color);
+    water.alphaByDepth = alpha;
   } else {
     console.warn("No water simulation to pause.");
   }
@@ -134,7 +140,7 @@
 export function pauseWaterSimulation() {
   if (water) {
     water.pause();
-    console.log("鏆傚仠浠跨湡");
+    // console.log("鏆傚仠浠跨湡");
   } else {
     console.warn("No water simulation to pause.");
   }
@@ -146,7 +152,7 @@
 export function resumeWaterSimulation() {
   if (water) {
     water.resume();
-    console.log("缁х画浠跨湡");
+    // console.log("缁х画浠跨湡");
   } else {
     console.warn("No water simulation to resume.");
   }
@@ -165,9 +171,9 @@
       return;
     }
     // const idx = Math.floor(Math.random() * imageList.length); //闅忔満绱㈠紩璺宠浆锛屽疄闄呬腑鐢ㄤ笉鍒帮紝鍙敤浣滄紨绀�
-    console.log(
-      `Jumping to timestamp: count:[${imageList.length}], index:[${closestIndex}]`
-    );
+    // console.log(
+    //   `Jumping to timestamp: count:[${imageList.length}], index:[${closestIndex}]`
+    // );
     water.setTime(imageList[closestIndex]);
   } else {
     console.warn("No water simulation to set time for.");
@@ -181,7 +187,7 @@
 export function toggleWaterColorRender(enabled) {
   if (water) {
     water.colorRender = enabled;
-    console.log(`鏄惁寮�鍚笓棰樻覆鏌� ${enabled}`);
+    // console.log(`鏄惁寮�鍚笓棰樻覆鏌� ${enabled}`);
   } else {
     console.warn("No water simulation to toggle color rendering.");
   }
@@ -196,7 +202,7 @@
   if (water) {
     // 榛樿鍏抽棴鐘舵��
     water.flowEnabled = enabled; // 鍋囪 SDK 鏀寔姝ゅ睘鎬�
-    console.log(`绠ご娴佸悜鍔ㄧ敾宸�${enabled ? "寮�鍚�" : "鍏抽棴"}`);
+    // console.log(`绠ご娴佸悜鍔ㄧ敾宸�${enabled ? "寮�鍚�" : "鍏抽棴"}`);
   } else {
     console.warn("鏈壘鍒版按浣撴ā鎷熷浘灞傦紝璇峰厛鍚姩娲按妯℃嫙");
   }
@@ -218,7 +224,7 @@
       earthCtrl.shadowMap.maximumDistance = 10000.0; //鏈�澶ц窛绂�
       earthCtrl.shadowMap.pointLightRadius = 50.0; //鐐瑰厜婧愬崐寰�
     }
-    console.log(`闃村奖鏁堟灉宸�${enabled ? "寮�鍚�" : "鍏抽棴"}`);
+    // console.log(`闃村奖鏁堟灉宸�${enabled ? "寮�鍚�" : "鍏抽棴"}`);
   } catch (error) {
     console.error("璁剧疆闃村奖澶辫触:", error);
   }

--
Gitblit v1.9.3