fix: 한국 필터 토글 시 선박 표시 복원 + 필터별 개별 탐지 카운트
- anyKoreaFilterOn 시 filteredShips(필터 결과) 전달, 비활성 시 allShips(전체) 전달 - 상단 배너: 합산 "N척 탐지" → 필터별 개별 카운트 (불법어선 3척, 다크베셀 5척 등) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
부모
459a0e3d6e
커밋
18b827ced0
@ -189,7 +189,8 @@ export function KoreaMap({ ships, allShips, aircraft, satellites, layers, osintF
|
|||||||
);
|
);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// 줌 레벨별 아이콘/심볼 스케일 배율 — z4=1.0x 기준, 2단계씩 상향
|
const anyKoreaFilterOn = koreaFilters.illegalFishing || koreaFilters.illegalTransship || koreaFilters.darkVessel || koreaFilters.cableWatch || koreaFilters.dokdoWatch || koreaFilters.ferryWatch;
|
||||||
|
|
||||||
// 줌 레벨별 아이콘/심볼 스케일 배율 — z4=0.8x, z6=1.0x 시작, 2단계씩 상향
|
// 줌 레벨별 아이콘/심볼 스케일 배율 — z4=0.8x, z6=1.0x 시작, 2단계씩 상향
|
||||||
const zoomScale = useMemo(() => {
|
const zoomScale = useMemo(() => {
|
||||||
if (zoomLevel <= 4) return 0.8;
|
if (zoomLevel <= 4) return 0.8;
|
||||||
@ -568,7 +569,13 @@ export function KoreaMap({ ships, allShips, aircraft, satellites, layers, osintF
|
|||||||
/>
|
/>
|
||||||
</Source>
|
</Source>
|
||||||
|
|
||||||
{layers.ships && <ShipLayer ships={allShips ?? ships} militaryOnly={layers.militaryOnly} analysisMap={vesselAnalysis?.analysisMap} hiddenShipCategories={hiddenShipCategories} hiddenNationalities={hiddenNationalities} />}
|
{layers.ships && <ShipLayer
|
||||||
|
ships={anyKoreaFilterOn ? ships : (allShips ?? ships)}
|
||||||
|
militaryOnly={layers.militaryOnly}
|
||||||
|
analysisMap={vesselAnalysis?.analysisMap}
|
||||||
|
hiddenShipCategories={hiddenShipCategories}
|
||||||
|
hiddenNationalities={hiddenNationalities}
|
||||||
|
/>}
|
||||||
{/* Transship suspect labels — Marker DOM, inline styles kept for dynamic border color */}
|
{/* Transship suspect labels — Marker DOM, inline styles kept for dynamic border color */}
|
||||||
{transshipSuspects.size > 0 && ships.filter(s => transshipSuspects.has(s.mmsi)).map(s => (
|
{transshipSuspects.size > 0 && ships.filter(s => transshipSuspects.has(s.mmsi)).map(s => (
|
||||||
<Marker key={`ts-${s.mmsi}`} longitude={s.lng} latitude={s.lat} anchor="bottom">
|
<Marker key={`ts-${s.mmsi}`} longitude={s.lng} latitude={s.lat} anchor="bottom">
|
||||||
@ -671,14 +678,29 @@ export function KoreaMap({ ships, allShips, aircraft, satellites, layers, osintF
|
|||||||
{layers.osint && <OsintMapLayer osintFeed={osintFeed} currentTime={currentTime} />}
|
{layers.osint && <OsintMapLayer osintFeed={osintFeed} currentTime={currentTime} />}
|
||||||
{layers.eez && <EezLayer />}
|
{layers.eez && <EezLayer />}
|
||||||
|
|
||||||
{/* Filter Status Banner */}
|
{/* Filter Status Banner — 필터별 개별 탐지 카운트 */}
|
||||||
{(() => {
|
{(() => {
|
||||||
const active = (Object.keys(koreaFilters) as (keyof KoreaFiltersState)[]).filter(k => koreaFilters[k]);
|
const active = (Object.keys(koreaFilters) as (keyof KoreaFiltersState)[]).filter(k => koreaFilters[k]);
|
||||||
if (active.length === 0) return null;
|
if (active.length === 0) return null;
|
||||||
|
const filterCount: Record<string, number> = {
|
||||||
|
illegalFishing: (allShips ?? ships).filter(s => {
|
||||||
|
if (s.mtCategory !== 'fishing' || s.flag === 'KR') return false;
|
||||||
|
return classifyFishingZone(s.lat, s.lng).zone !== 'OUTSIDE';
|
||||||
|
}).length,
|
||||||
|
illegalTransship: transshipSuspects.size,
|
||||||
|
darkVessel: ships.filter(s => {
|
||||||
|
const dto = vesselAnalysis?.analysisMap.get(s.mmsi);
|
||||||
|
return dto?.algorithms.darkVessel.isDark || (s.lastSeen && currentTime - s.lastSeen > 3600000);
|
||||||
|
}).length,
|
||||||
|
cableWatch: cableWatchSuspects.size,
|
||||||
|
dokdoWatch: dokdoWatchSuspects.size,
|
||||||
|
ferryWatch: (allShips ?? ships).filter(s => s.mtCategory === 'passenger').length,
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<div className="absolute top-2.5 left-1/2 -translate-x-1/2 z-20 flex gap-1.5 backdrop-blur-lg">
|
<div className="absolute top-2.5 left-1/2 -translate-x-1/2 z-20 flex gap-1.5 backdrop-blur-lg">
|
||||||
{active.map(k => {
|
{active.map(k => {
|
||||||
const color = FILTER_COLOR[k];
|
const color = FILTER_COLOR[k];
|
||||||
|
const count = filterCount[k] ?? 0;
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
key={k}
|
key={k}
|
||||||
@ -690,12 +712,10 @@ export function KoreaMap({ ships, allShips, aircraft, satellites, layers, osintF
|
|||||||
>
|
>
|
||||||
<span className="text-[13px]">{FILTER_ICON[k]}</span>
|
<span className="text-[13px]">{FILTER_ICON[k]}</span>
|
||||||
{t(FILTER_I18N_KEY[k])}
|
{t(FILTER_I18N_KEY[k])}
|
||||||
|
<span className="ml-0.5 text-white/80">{count}척</span>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
<div className="rounded-lg px-3 py-1.5 font-mono text-xs font-bold flex items-center bg-kcg-glass border border-kcg-border-light text-white">
|
|
||||||
{t('korea.detected', { count: ships.length })}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})()}
|
})()}
|
||||||
|
|||||||
불러오는 중...
Reference in New Issue
Block a user