| | |
| | | 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 }) |
| | |
| | | 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() |
| | | } |
| | | } |