| | |
| | | * @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`); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param {number} timeStamp - 当前时间戳 |
| | | */ |
| | | function timeCallback(timeStamp) { |
| | | console.log(`Current timestamp: ${timeStamp}`); |
| | | // console.log(`Current timestamp: ${timeStamp}`); |
| | | } |