- imagery.js: WMTS-Support fuer NASA GIBS + 4 neue Quellen (MODIS Terra, VIIRS SNPP, GOES East/West) - firms.js: Neuer VIIRS Thermal Anomalies Layer (375m, tagesaktuell, Braende/Industriewaerme) - nightlights.js: NRT-Upgrade (dynamisches Datum statt hardcodiert 2024-01-01) - index.html: Optgroups im Imagery-Select, FIRMS-Checkbox, Script-Tag - app.js: FIRMS Toggle - globe.css: dot-firms Farbe Alle NASA-Daten kostenlos via GIBS WMTS, kein API-Key noetig. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
40 Zeilen
1.4 KiB
JavaScript
40 Zeilen
1.4 KiB
JavaScript
/**
|
|
* Nachtlicht-Layer: NASA VIIRS Black Marble Nighttime Lights (NRT).
|
|
* Verwendet tagesaktuelle Daten statt statischem Datum.
|
|
*/
|
|
const NightlightsLayer = {
|
|
_viewer: null,
|
|
_layer: null,
|
|
|
|
start: function(viewer) {
|
|
if (this._layer) return;
|
|
this._viewer = viewer;
|
|
// NRT-Daten brauchen ~12-24h Processing, daher Datum von gestern
|
|
var yesterday = new Date(Date.now() - 86400000).toISOString().slice(0, 10);
|
|
this._layer = viewer.imageryLayers.addImageryProvider(
|
|
new Cesium.WebMapTileServiceImageryProvider({
|
|
url: "https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/VIIRS_Black_Marble/default/" + yesterday + "/500m/{TileMatrix}/{TileRow}/{TileCol}.png",
|
|
layer: "VIIRS_Black_Marble",
|
|
style: "default",
|
|
tileMatrixSetID: "500m",
|
|
tileMatrixLabels: [
|
|
"0", "1", "2", "3", "4", "5", "6", "7", "8",
|
|
],
|
|
format: "image/png",
|
|
tilingScheme: new Cesium.GeographicTilingScheme(),
|
|
tileWidth: 512,
|
|
tileHeight: 512,
|
|
credit: "NASA VIIRS Black Marble (NRT)",
|
|
})
|
|
);
|
|
this._layer.alpha = 0.85;
|
|
},
|
|
|
|
stop: function() {
|
|
if (this._layer && this._viewer) {
|
|
this._viewer.imageryLayers.remove(this._layer);
|
|
this._layer = null;
|
|
}
|
|
},
|
|
};
|