diff --git a/Oxkintok_t.html b/Oxkintok_t.html index c6c46d9..cf889f8 100644 --- a/Oxkintok_t.html +++ b/Oxkintok_t.html @@ -379,10 +379,11 @@ // viewer.scene.view.position.set(position); // } - function createNewViewModel({name, tooltip, layer, id, format}) { + function createNewViewModel({name, tooltip, layer, id, format, units, min, max, legend = true}) { const now = Cesium.JulianDate.now(); const past = Cesium.JulianDate.now(); - Cesium.JulianDate.addDays(now, -2, past); + Cesium.JulianDate.addDays(now, -7, now); + Cesium.JulianDate.addDays(now, -9, past); const times = Cesium.TimeIntervalCollection.fromIso8601({ iso8601: `${Cesium.JulianDate.toIso8601(past, 0)}/${Cesium.JulianDate.toIso8601(now, 0)}`, leadingInterval: true, @@ -399,7 +400,7 @@ const provider = new Cesium.WebMapTileServiceImageryProvider({ url: `https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/${layer}/default/{Time}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.${format}`, - layer: "MODIS_Terra_CorrectedReflectance_TrueColor", + layer: layer, style: "default", tileMatrixSetID: id, maximumLevel: 5, @@ -409,9 +410,24 @@ credit: "NASA Global Imagery Browse Services for EOSDIS", tilingScheme: gibs.GeographicTilingScheme() }); + // update legend + if (legend) { + var qs = document.querySelector.bind(document); + qs('.scale .legend-title').textContent = units + qs('.legend-colorbar').setAttribute('src', `images/${layer}.png`); + qs('.legend-max').innerHTML = max; + qs('.legend-min').innerHTML = min; + qs('#legend .single').style.display = 'none'; + qs('#legend .scale').style.display = 'block'; + qs('#legend').style.display = 'block'; + } else { + var qs = document.querySelector.bind(document); + qs('#legend').style.display = 'none'; + } // Make the weather layer semi-transparent to see the underlying geography. provider.defaultAlpha = .5; return [providerViewModels[1].creationCommand(), provider] + } }) providerViewModels.push(providerViewModel); @@ -423,7 +439,8 @@ tooltip: "Realtime weather data from NASA Global Imagery", layer: "MODIS_Terra_CorrectedReflectance_TrueColor", id: "250m", - format: "jpg" + format: "jpg", + legend: false }); createNewViewModel({ @@ -431,61 +448,22 @@ tooltip: "Realtime aerosols data", layer: "MODIS_Terra_Aerosol", id: "2km", - format: "png" + format: "png", + units: "Optical Depth", + min: "0.0", + max: "⩾ 5.0", }); - - - let fireProviderViewModel = new Cesium.ProviderViewModel({ + createNewViewModel({ name: "Infrared", - tooltip: "Realtime weather data from NASA Global Imagery", - category: "Other", - iconUrl: "libs/Cesium/Widgets/Images/ImageryProviders/bingAerial.png", - creationFunction: () => { - const provider = new Cesium.WebMapTileServiceImageryProvider({ - url: - "https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/GOES-East_ABI_Band13_Clean_Infrared/default/{Time}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png", - layer: "GOES-East_ABI_Band13_Clean_Infrared", - style: "default", - tileMatrixSetID: "2km", - maximumLevel: 5, - format: "image/png", - clock: cesiumViewer.clock, - times: times, - credit: "NASA Global Imagery Browse Services for EOSDIS", - tilingScheme: gibs.GeographicTilingScheme() - }); - // Make the weather layer semi-transparent to see the underlying geography. - provider.defaultAlpha = .5; - provider.readyPromise.then(() => { - const start = Cesium.JulianDate.fromIso8601("2022-11-08"); - const stop = Cesium.JulianDate.fromIso8601("2022-11-09"); - - cesiumViewer.timeline.zoomTo(start, stop); - clock.startTime = start; - clock.stopTime = stop; - clock.currentTime = start; - clock.clockRange = Cesium.ClockRange.LOOP_STOP; - clock.multiplier = 7200; - }); - // update legend - var qs = document.querySelector.bind(document); - qs('.scale .legend-title').textContent = "Temperature" - qs('.legend-colorbar').setAttribute('src', "images/GOES-East_ABI_Band13_Clean_Infrared.png"); - qs('.legend-max').innerHTML = "57"; - qs('.legend-min').innerHTML = "-92"; - qs('#legend .single').style.display = 'none'; - qs('#legend .scale').style.display = 'block'; - qs('#legend').style.display = 'block'; - return [providerViewModels[1].creationCommand(), provider] - } + tooltip: "Infrared", + layer: "GOES-East_ABI_Band13_Clean_Infrared", + id: "2km", + format: "png", + units: "Temperature", + min: "-92℃", + max: "> 57℃" }) - // providerViewModels.push(weatherProviderViewModel); - // providerViewModels.push(aerosolProviderViewModel); - // providerViewModels.push(fireProviderViewModel); - // cesiumViewer.baseLayerPicker.viewModel.imageryProviderViewModels = providerViewModels; - - let cp = new Cesium.Cartesian3(4303414.154026048, 552161.235598733, 4660771.704035539); cesiumViewer.camera.setView({ destination: cp, @@ -495,7 +473,7 @@ roll: 0.0 } }); - + function dataCallback(interval, index) { let time; if (index === 0) { diff --git a/images/MODIS_Terra_Aerosol.png b/images/MODIS_Terra_Aerosol.png new file mode 100644 index 0000000000000000000000000000000000000000..2cd78e0900f6755ea80654b7d30449af8aea3eae GIT binary patch literal 593 zcmV-X0Px%3rR#lRCr$PoI!HKAPhx6K2xvRn|0kQblI$v#&keH!6qGN#$;GL&t$Oiw<5k# zB#>Gs4j6!eDH(86YK2lT00Y7}nFKH}DFYbiq%Q`wU;yJ}4#2>q3}Bp-z8KVkfoz-} zDqsKx=3<~2=jC#d_dn@#mlV$L@!AeM4}I;uaIMX~9`0Eg`Md9O?k9f2;at9M+hs95 z40{CA$7LBo-XmExW?dz}N~=%pYHa0e@1;kWa<7A_WyI&7!Fb7CO^@X!xtp|HtpvNv`i?rh>#OY6dW_SI732IfWQ=ofq!?%8 zweg&I&J>N{InM}5&yYb_TZhVowS={-In%n8HK(mXS#!4QOTt>h+GbOUu$Hiv-C8z; zc003pPCTb=VLwRKkV+wyLMnwkC#jT8P7}|G=frbviWy46JQO%kgkWoMQYmMoLC%mt zDuq-^3g=UCDaP4d_l4gr%J*_PUtL8+`CgT7p?oiv>z!V{XB2b501V8+z^ndb>_gJq zfI*Lv8&pO1{)NFw%gIPSUiNQFMh#+=T#U2-OA6l@=V2eqWWl=~nJlB`$tby&(mOIT fFfafEuV>&FXBl1HUvZaz00000NkvXXu0mjf$~YM# literal 0 HcmV?d00001