吉安感知网项目-前端
shuishen
2026-02-04 7b0c457d3dffab33253f2eb9b0b9c6c48509c963
feat:固定中国时区12点
1 files modified
27 ■■■■ changed files
applications/drone-command/src/utils/cesium/publicCesium.js 27 ●●●● patch | view | raw | blame | history
applications/drone-command/src/utils/cesium/publicCesium.js
@@ -166,11 +166,7 @@
        this.viewer.shadows = false
        this.viewer.shadowMap.darkness = 0.5
        let time = new Date()
        time.setHours(12, 0, 0, 0)
        let utc = Cesium.JulianDate.fromDate(new Date(time))
        this.viewer.clockViewModel.currentTime = Cesium.JulianDate.addHours(utc, 0, new Cesium.JulianDate())
        this.setFixedNoonLighting()
        // 边界,机巢
        this.boundary = useBoundary(this.viewer, { multiple, dockOptions, boundaryChange, boundaryColor, dockRangeType, useDockHeight })
@@ -904,4 +900,25 @@
            this.viewer?.imageryLayers.remove(imageryLayers)
        }
    }
    setFixedNoonLighting (utcOffsetHours = 8) {
        if (!this.viewer) return
        const now = new Date()
        const utcNoon = Date.UTC(
            now.getUTCFullYear(),
            now.getUTCMonth(),
            now.getUTCDate(),
            12 - Number(utcOffsetHours || 0),
            0,
            0,
            0
        )
        const julian = Cesium.JulianDate.fromDate(new Date(utcNoon))
        this.viewer.clock.currentTime = julian
        this.viewer.clockViewModel.currentTime = julian
        this.viewer.clock.shouldAnimate = false
        this.viewer.clock.multiplier = 0
        this.viewer.clockViewModel.multiplier = 0
        this.viewer.scene.requestRender()
    }
}