diff --git a/backend/src/Command/GenerateTilesCommand.php b/backend/src/Command/GenerateTilesCommand.php index 80e8b9b..a33d024 100644 --- a/backend/src/Command/GenerateTilesCommand.php +++ b/backend/src/Command/GenerateTilesCommand.php @@ -63,7 +63,11 @@ class GenerateTilesCommand extends Command private function queryObservationsGeoJSON(): ?string { $rows = $this->connection->fetchAllAssociative( - "SELECT ST_AsGeoJSON(geometry) AS geometry, COALESCE(afai_mean, 0) AS afai + "SELECT ST_AsGeoJSON(geometry) AS geometry, + COALESCE(afai_mean, 0) AS afai, + source, + confidence, + ROUND(COALESCE(coverage_area, 0)::numeric, 1) AS coverage_km2 FROM sargassum_observation WHERE detected_at >= NOW() - INTERVAL '30 days' AND coverage_area > 0 @@ -71,7 +75,10 @@ class GenerateTilesCommand extends Command ); return $this->buildFeatureCollection($rows, [ - 'afai' => static fn($r) => (float) $r['afai'], + 'afai' => static fn($r) => (float) $r['afai'], + 'source' => static fn($r) => $r['source'], // 'Sentinel-2' | 'Sentinel-3' + 'confidence' => static fn($r) => (float) $r['confidence'], + 'coverage_km2' => static fn($r) => (float) $r['coverage_km2'], ]); } diff --git a/frontend/src/components/Legend/Legend.css b/frontend/src/components/Legend/Legend.css index fd668ac..4877dcf 100644 --- a/frontend/src/components/Legend/Legend.css +++ b/frontend/src/components/Legend/Legend.css @@ -39,8 +39,9 @@ border: 2px solid #333; flex-shrink: 0; } -.legend__swatch--obs { background: #f4a020; } -.legend__swatch--fore { background: #818cf8; } +.legend__swatch--obs-s2 { background: #f4720a; } +.legend__swatch--obs-s3 { background: #d4b830; opacity: 0.7; } +.legend__swatch--fore { background: #818cf8; } .legend__divider { height: 2px; diff --git a/frontend/src/components/Legend/Legend.jsx b/frontend/src/components/Legend/Legend.jsx index 12b6908..145798c 100644 --- a/frontend/src/components/Legend/Legend.jsx +++ b/frontend/src/components/Legend/Legend.jsx @@ -5,8 +5,12 @@ export default function Legend() {