From fae8224eef57a54b3328d0b5447c531bc9d679c5 Mon Sep 17 00:00:00 2001 From: j8seangel Date: Wed, 4 Sep 2024 15:52:05 +0200 Subject: [PATCH] uniqueFeatureInteraction in fourwings clusters --- apps/fishing-map/features/map/popups/PopupByCategory.tsx | 5 ++++- .../src/layers/fourwings/clusters/FourwingsClustersLayer.ts | 1 + libs/deck-layers/src/layers/fourwings/fourwings.types.ts | 5 +++-- libs/deck-layers/src/layers/rulers/rulers.types.ts | 2 +- libs/deck-layers/src/types.ts | 1 + 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/apps/fishing-map/features/map/popups/PopupByCategory.tsx b/apps/fishing-map/features/map/popups/PopupByCategory.tsx index 75d81535c0..bc3db30eca 100644 --- a/apps/fishing-map/features/map/popups/PopupByCategory.tsx +++ b/apps/fishing-map/features/map/popups/PopupByCategory.tsx @@ -75,7 +75,10 @@ function PopupByCategory({ interaction, type = 'hover' }: PopupByCategoryProps) return (
- {Object.entries(featureByCategory)?.map(([featureCategory, features]) => { + {Object.entries(featureByCategory)?.map(([featureCategory, allCategoryFeatures]) => { + const features = allCategoryFeatures.some((feature) => feature.uniqueFeatureInteraction) + ? [allCategoryFeatures[0]] + : allCategoryFeatures switch (featureCategory) { case DataviewCategory.Activity: case DataviewCategory.Detections: { diff --git a/libs/deck-layers/src/layers/fourwings/clusters/FourwingsClustersLayer.ts b/libs/deck-layers/src/layers/fourwings/clusters/FourwingsClustersLayer.ts index 2003db4309..8eac2932dc 100644 --- a/libs/deck-layers/src/layers/fourwings/clusters/FourwingsClustersLayer.ts +++ b/libs/deck-layers/src/layers/fourwings/clusters/FourwingsClustersLayer.ts @@ -133,6 +133,7 @@ export class FourwingsClustersLayer extends CompositeLayer< subcategory: this.props.subcategory, startTime: this.props.startTime, endTime: this.props.endTime, + uniqueFeatureInteraction: true, expansionZoom, } return { ...info, object } diff --git a/libs/deck-layers/src/layers/fourwings/fourwings.types.ts b/libs/deck-layers/src/layers/fourwings/fourwings.types.ts index 9faf9071f0..a109d7c3e0 100644 --- a/libs/deck-layers/src/layers/fourwings/fourwings.types.ts +++ b/libs/deck-layers/src/layers/fourwings/fourwings.types.ts @@ -1,5 +1,5 @@ import { ColorRampsIds } from '../../utils' -import { DeckLayerProps } from '../../types' +import { DeckLayerProps, DeckPickingObject } from '../../types' import { HEATMAP_HIGH_RES_ID, HEATMAP_ID, @@ -65,7 +65,8 @@ export type BaseFourwingsLayerProps = DeckLayerProps<{ }> export type FourwingsPickingInfo = FourwingsHeatmapPickingInfo | FourwingsPositionsPickingInfo -export type FourwingsPickingObject = +export type FourwingsPickingObject = DeckPickingObject< | FourwingsHeatmapPickingObject | FourwingsHeatmapStaticPickingObject | FourwingsPositionsPickingObject +> diff --git a/libs/deck-layers/src/layers/rulers/rulers.types.ts b/libs/deck-layers/src/layers/rulers/rulers.types.ts index 16851b8f0f..bf461d9ac4 100644 --- a/libs/deck-layers/src/layers/rulers/rulers.types.ts +++ b/libs/deck-layers/src/layers/rulers/rulers.types.ts @@ -30,5 +30,5 @@ export type RulersLayerProps = GeoJsonLayerProps & { } export type RulerFeature = Feature -export type RulerPickingObject = RulerFeature & DeckPickingObject<{}> +export type RulerPickingObject = DeckPickingObject export type RulerPickingInfo = PickingInfo diff --git a/libs/deck-layers/src/types.ts b/libs/deck-layers/src/types.ts index 0aa5b6e5f4..facf9d9b19 100644 --- a/libs/deck-layers/src/types.ts +++ b/libs/deck-layers/src/types.ts @@ -35,6 +35,7 @@ export type DeckPickingObject = { color?: string category: DeckLayerCategory subcategory?: DeckLayerSubcategory + uniqueFeatureInteraction?: boolean } & G export type AnyDeckLayer =