diff --git a/src/components/Map/MapViewer/MapViewerVector/utils/shapes/elements/isFeatureInCompartment.ts b/src/components/Map/MapViewer/MapViewerVector/utils/shapes/elements/isFeatureInCompartment.ts index 15f6c6add2f1eaa414b21e7b843e6982306a51e8..9c113735db91f0dfffab55054a803472b6b1a00c 100644 --- a/src/components/Map/MapViewer/MapViewerVector/utils/shapes/elements/isFeatureInCompartment.ts +++ b/src/components/Map/MapViewer/MapViewerVector/utils/shapes/elements/isFeatureInCompartment.ts @@ -7,10 +7,11 @@ export default function isFeatureInCompartment( feature: Feature, ): boolean { const compartmentId: undefined | null | number = feature.get('compartmentId'); + if (!compartmentId) { return false; } - if (compartmentId === parentCompartmentId) { + if (compartmentId === parentCompartmentId || compartmentId === feature.get('id')) { return true; } const compartmentFeature = vectorSource.getFeatureById(compartmentId);