原文链接及内容
示例介绍:场景中加载 NASA GIBS 的 MODIS Terra 真彩色影像图层,覆盖 2015-07-30 至 2017-06-16 的时间范围,每天切换一帧影像。图层透明度设置为 0.5,以便显示底层的地理信息。Cesium 的时钟和时间轴配置为播放时间动画,时间跨度约两年,播放速度为 7200 倍,适合快速查看天气变化。
效果如下图所示:
注:下面的动图采用了clock.multiplier = 7200 * 12
进行了录制。
示例代码如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 const viewer = new Cesium .Viewer ("cesiumContainer" , { geocoder : false , homeButton : false , navigationHelpButton : false , navigationInstructionsInitiallyVisible : false , animation : false , timeline : true , fullscreenButton : false , skyBox : false , sceneModePicker : false , baseLayerPicker : false , shouldAnimate : true , }); viewer.cesiumWidget .creditContainer .style .display = "none" ; function dataCallback (interval, index ) { let time; if (index === 0 ) { time = Cesium .JulianDate .toIso8601 (interval.stop ); } else { time = Cesium .JulianDate .toIso8601 (interval.start ); } return { Time : time, }; } const times = Cesium .TimeIntervalCollection .fromIso8601 ({ iso8601 : "2015-07-30/2017-06-16/P1D" , leadingInterval : true , trailingInterval : true , isStopIncluded : false , dataCallback : dataCallback, }); const provider = new Cesium .WebMapTileServiceImageryProvider ({ url : "https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/MODIS_Terra_CorrectedReflectance_TrueColor/default/{Time}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpg" , layer : "MODIS_Terra_CorrectedReflectance_TrueColor" , style : "default" , tileMatrixSetID : "250m" , maximumLevel : 5 , format : "image/jpeg" , clock : viewer.clock , times : times, credit : "NASA Global Imagery Browse Services for EOSDIS" , }); const layer = new Cesium .ImageryLayer (provider);layer.alpha = 0.5 ; viewer.imageryLayers .add (layer); const start = Cesium .JulianDate .fromIso8601 ("2015-07-30" );const stop = Cesium .JulianDate .fromIso8601 ("2017-06-17" );viewer.timeline .zoomTo (start, stop); const clock = viewer.clock ;clock.startTime = start; clock.stopTime = stop; clock.currentTime = start; clock.clockRange = Cesium .ClockRange .LOOP_STOP ; clock.multiplier = 7200 ;