mirror of
https://github.com/BigBodyCobain/Shadowbroker.git
synced 2026-09-17 06:35:29 +02:00
fix(map): apply vessel data filters to the carrier layer
Carrier icons and labels are built on the main thread from the raw ship array, separately from the worker that draws every other vessel, so the Data Filters vessel name / type selection never reached them. Filtering to yachts left the aircraft carriers on the map. Move the ship filter predicate into a shared helper used by both the worker and the carrier builder so all ship sources honour the same selection. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
46f6b7891f
commit
9df81bf636
@@ -3,6 +3,7 @@
|
||||
import { classifyAircraft } from '@/utils/aircraftClassification';
|
||||
import type { Flight, Ship, SigintSignal } from '@/types/dashboard';
|
||||
import type { FlightLayerConfig } from '@/components/map/geoJSONBuilders';
|
||||
import { filterShipsByActiveFilters } from '@/components/map/shipFilters';
|
||||
|
||||
type BoundsTuple = [number, number, number, number];
|
||||
type FC = GeoJSON.FeatureCollection | null;
|
||||
@@ -523,16 +524,7 @@ function applyFilters(activeFilters: Record<string, string[]> | undefined) {
|
||||
}
|
||||
|
||||
// ── Ships ──
|
||||
let ships = dynamicData.ships;
|
||||
if (ships && (has('ship_name') || has('ship_type'))) {
|
||||
const nameSet = has('ship_name') ? set('ship_name') : null;
|
||||
const typeSet = has('ship_type') ? set('ship_type') : null;
|
||||
ships = ships.filter((s: any) => {
|
||||
if (nameSet && !nameSet.has(s.name)) return false;
|
||||
if (typeSet && !typeSet.has(s.type)) return false;
|
||||
return true;
|
||||
});
|
||||
}
|
||||
const ships = dynamicData.ships ? filterShipsByActiveFilters(dynamicData.ships, f) : dynamicData.ships;
|
||||
|
||||
return { commercial, private_, jets, military, tracked, ships };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user