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

View File

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