fix: ne pas injecter afai:null dans les propriétés GeoJSON

MapLibre considère null comme "propriété présente" → le filtre !has
ne prenait pas le relais → tous les polygones étaient masqués.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Gwadaking
2026-04-02 16:36:57 -04:00
parent 3f1e49bb3b
commit 6bf6762dac
4 changed files with 769 additions and 5 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -8,7 +8,7 @@
<link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Fredoka+One&family=Fredoka:wght@400;500;600&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Fredoka+One&family=Fredoka:wght@400;500;600&display=swap" rel="stylesheet">
<script type="module" crossorigin src="/assets/index-DwKkpLRn.js"></script> <script type="module" crossorigin src="/assets/index-CyPsbTID.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-RGvCvNm_.css"> <link rel="stylesheet" crossorigin href="/assets/index-RGvCvNm_.css">
</head> </head>
<body> <body>

View File

@@ -237,10 +237,9 @@ export default function SargassesMap({ onSpotSelect, selectedSpotId, activeStep,
.map(i => ({ .map(i => ({
type: 'Feature', type: 'Feature',
geometry: i.geometry, geometry: i.geometry,
properties: { // Ne pas injecter afai si absent : MapLibre traite null comme "has=true"
// afai absent → null → filtre "!has" prend le relais (affichage normal) // ce qui ferait échouer le filtre > 0 et masquerait le polygone.
afai: typeof i.afaiIndex === 'number' ? i.afaiIndex : null, properties: typeof i.afaiIndex === 'number' ? { afai: i.afaiIndex } : {},
},
})); }));
return features.length ? { type: 'FeatureCollection', features } : null; return features.length ? { type: 'FeatureCollection', features } : null;
}; };