OSINT Monitor Layer + Erdbeben in Katastrophen zusammengefuehrt
MONITOR LAYER (neu): - Neuer Top-Layer "OSINT Monitor" im Panel - Zeigt geoparsete Standorte aus Monitor-Lagen auf dem Globus - Farbkodiert: rot=Hauptgeschehen, orange=Reaktionen, blau=Beteiligte - Labels mit Ortsname + Artikelanzahl bei Zoom - 2min Refresh, GeoJSON vom Monitor Public API KATASTROPHEN (erweitert): - Erdbeben-Layer in Katastrophen integriert (kein separater Toggle mehr) - Laedt NASA EONET + USGS parallel - Erdbeben als farbige Punkte (rot=frisch, gelb=alt) mit M-Label - Katastrophen-Toggle zeigt jetzt alles: Waldbraende, Vulkane, Stuerme, Fluten UND Erdbeben
Dieser Commit ist enthalten in:
@@ -28,15 +28,41 @@ const DisastersLayer = {
|
||||
var loadEl = document.getElementById('loading-disasters');
|
||||
var statusEl = document.getElementById('status-disasters');
|
||||
if (loadEl) loadEl.classList.add('active');
|
||||
if (statusEl) { statusEl.textContent = 'Lade Ereignisse...'; statusEl.classList.add('active'); }
|
||||
fetch('/api/disasters')
|
||||
if (statusEl) { statusEl.textContent = 'Lade Ereignisse + Erdbeben...'; statusEl.classList.add('active'); }
|
||||
// Lade beides parallel: NASA EONET + USGS Erdbeben
|
||||
Promise.all([
|
||||
fetch('/api/disasters').then(function(r) { return r.json(); }).catch(function() { return {events:[]}; }),
|
||||
fetch('/api/quakes').then(function(r) { return r.json(); }).catch(function() { return {features:[]}; }),
|
||||
])
|
||||
.then(function(results) {
|
||||
var eonetData = results[0];
|
||||
var quakeData = results[1];
|
||||
self._renderAll(eonetData, quakeData);
|
||||
var total = (eonetData.events || []).length + (quakeData.features || []).length;
|
||||
self._count = total;
|
||||
if (statusEl) statusEl.textContent = total + ' Ereignisse';
|
||||
})
|
||||
.catch(function(e) { console.warn('Disasters error:', e); if (statusEl) statusEl.textContent = 'Fehler'; })
|
||||
.finally(function() { if (loadEl) loadEl.classList.remove('active'); setTimeout(function() { if (statusEl) statusEl.classList.remove('active'); }, 5000); });
|
||||
},
|
||||
|
||||
_renderAll(eonetData, quakeData) {
|
||||
if (!this._dataSource) return;
|
||||
this._dataSource.entities.removeAll();
|
||||
|
||||
// NASA EONET Events
|
||||
var events = eonetData.events || [];
|
||||
this._renderEonet(events);
|
||||
|
||||
// USGS Erdbeben
|
||||
var quakes = quakeData.features || [];
|
||||
this._renderQuakes(quakes);
|
||||
},
|
||||
|
||||
_renderEonet(events) {
|
||||
var self = this;
|
||||
.then(function(r) { return r.json(); })
|
||||
.then(function(data) {
|
||||
if (!self._dataSource) return;
|
||||
self._dataSource.entities.removeAll();
|
||||
var events = data.events || [];
|
||||
self._count = events.length;
|
||||
var icons = {
|
||||
var icons = {
|
||||
'wildfires': { color: '#ff4400', symbol: '🔥', label: 'Waldbrand' },
|
||||
'volcanoes': { color: '#ff0000', symbol: '🌋', label: 'Vulkan' },
|
||||
'severeStorms': { color: '#aa44ff', symbol: '🌀', label: 'Sturm' },
|
||||
@@ -78,9 +104,43 @@ const DisastersLayer = {
|
||||
'</div>',
|
||||
});
|
||||
});
|
||||
if (statusEl) statusEl.textContent = events.length + ' Ereignisse';
|
||||
})
|
||||
.catch(function(e) { console.warn('Disasters error:', e); if (statusEl) statusEl.textContent = 'Fehler'; })
|
||||
.finally(function() { if (loadEl) loadEl.classList.remove('active'); setTimeout(function() { if (statusEl) statusEl.classList.remove('active'); }, 5000); });
|
||||
},
|
||||
|
||||
_renderQuakes(features) {
|
||||
var self = this;
|
||||
var now = Date.now();
|
||||
features.forEach(function(f) {
|
||||
var c = f.geometry.coordinates;
|
||||
var p = f.properties;
|
||||
var mag = p.mag || 1;
|
||||
var ageH = (now - p.time) / 3600000;
|
||||
var color = ageH < 1 ? '#ff0000' : ageH < 6 ? '#ff6600' : ageH < 12 ? '#ffaa00' : '#ffdd00';
|
||||
self._dataSource.entities.add({
|
||||
position: Cesium.Cartesian3.fromDegrees(c[0], c[1], 0),
|
||||
point: {
|
||||
pixelSize: Math.max(mag * 2.5, 4),
|
||||
color: Cesium.Color.fromCssColorString(color),
|
||||
outlineColor: Cesium.Color.fromCssColorString(color).withAlpha(0.4),
|
||||
outlineWidth: 2,
|
||||
heightReference: Cesium.HeightReference.NONE,
|
||||
},
|
||||
label: {
|
||||
text: 'M' + mag.toFixed(1),
|
||||
font: '10px monospace',
|
||||
fillColor: Cesium.Color.fromCssColorString(color),
|
||||
outlineColor: Cesium.Color.BLACK,
|
||||
outlineWidth: 2,
|
||||
style: Cesium.LabelStyle.FILL_AND_OUTLINE,
|
||||
pixelOffset: new Cesium.Cartesian2(0, -12),
|
||||
scale: 0.7,
|
||||
distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 2000000),
|
||||
},
|
||||
description: '<div style="font-family:monospace;font-size:13px;padding:8px">' +
|
||||
'<strong style="color:' + color + '">ERDBEBEN M' + mag.toFixed(1) + '</strong><br>' +
|
||||
'<span style="color:#e0e0e0">' + (p.place || '?') + '</span><br>' +
|
||||
'<span style="color:#888">Tiefe: ' + (c[2] || '?') + ' km | ' +
|
||||
new Date(p.time).toLocaleString('de-DE') + '</span></div>',
|
||||
});
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren