1
wangjuncheng
2025-04-29 50a7a0eda3810e97bb19f9b989b727d834bcc24c
src/utils/water.js
@@ -19,16 +19,16 @@
 * @param {number} options.interval - 水体模拟的时间间隔(单位:毫秒)
 */
export function createWaterPrimitive(options = {}) {
  const { interval = 1000 } = options; // 默认 interval 为 1000
  const { baseUrl = "/simu/c2h1dc", interval = 1000 } = options; // 默认 baseUrl 和 interval
  water = earthCtrl.simulate.createWaterSimulateLayer({
    baseUrl: "/simu/c2h1dc", // 仿真服务 URL
    interval, // 动态设置 interval
    baseUrl,     // 仿真服务 URL
    interval,    // 动态设置 interval
    color: new SmartEarth.Cesium.Color.fromCssColorString("#D4F2E7"),
    loop: false, // 是否循环播放
    callback: timeCallback, // 回调函数
  });
  console.log(`Water simulation started with interval: ${interval}ms`);
  console.log(`Water simulation started with baseUrl: ${baseUrl}, interval: ${interval}ms`);
}
/**
@@ -103,5 +103,5 @@
 * @param {number} timeStamp - 当前时间戳
 */
function timeCallback(timeStamp) {
  console.log(`Current timestamp: ${timeStamp}`);
  // console.log(`Current timestamp: ${timeStamp}`);
}