Skip to content
Snippets Groups Projects

feat(vector-map): treating complexes in the same way as compartments

Merged Miłosz Grocholewski requested to merge feat/MIN-119-complexes-in-semantic-view into development
3 files
+ 107
1
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -5,6 +5,7 @@ import Feature from 'ol/Feature';
import VectorSource from 'ol/source/Vector';
import { Extent } from 'ol/extent';
import { COMPLEX_SBO_TERMS } from '@/components/Map/MapViewer/MapViewerVector/MapViewerVector.constants';
import isFeatureInCompartment from '@/components/Map/MapViewer/MapViewerVector/utils/shapes/elements/isFeatureInCompartment';
export default function handleSemanticView({
vectorSource,
@@ -21,6 +22,10 @@ export default function handleSemanticView({
compartmentId: number | null;
complexId?: number | null;
}): { cover: boolean; hide: boolean; largestExtent: Extent | null } {
const featureId = feature.getId();
if (!featureId) {
return { cover: false, hide: false, largestExtent: null };
}
const type = feature.get('type');
const getMapExtent = feature.get('getMapExtent');
let coverRatio = 1;
@@ -47,7 +52,7 @@ export default function handleSemanticView({
intersectingFeature.get('type') === 'COMPARTMENT' &&
intersectingFeature.get('zIndex') > feature.get('zIndex') &&
intersectingFeature.get('filled') &&
intersectingFeature.get('compartmentId') !== feature.getId()
!isFeatureInCompartment(+featureId, vectorSource, intersectingFeature)
) {
const intersectingFeatureExtent = intersectingFeature.getGeometry()?.getExtent();
if (intersectingFeatureExtent) {
Loading