Skip to content

Commit

Permalink
uniqueFeatureInteraction in fourwings clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
j8seangel committed Sep 4, 2024
1 parent 2e3c728 commit fae8224
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
5 changes: 4 additions & 1 deletion apps/fishing-map/features/map/popups/PopupByCategory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ function PopupByCategory({ interaction, type = 'hover' }: PopupByCategoryProps)

return (
<div className={styles.content}>
{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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
5 changes: 3 additions & 2 deletions libs/deck-layers/src/layers/fourwings/fourwings.types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ColorRampsIds } from '../../utils'
import { DeckLayerProps } from '../../types'
import { DeckLayerProps, DeckPickingObject } from '../../types'
import {
HEATMAP_HIGH_RES_ID,
HEATMAP_ID,
Expand Down Expand Up @@ -65,7 +65,8 @@ export type BaseFourwingsLayerProps = DeckLayerProps<{
}>

export type FourwingsPickingInfo = FourwingsHeatmapPickingInfo | FourwingsPositionsPickingInfo
export type FourwingsPickingObject =
export type FourwingsPickingObject = DeckPickingObject<
| FourwingsHeatmapPickingObject
| FourwingsHeatmapStaticPickingObject
| FourwingsPositionsPickingObject
>
2 changes: 1 addition & 1 deletion libs/deck-layers/src/layers/rulers/rulers.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ export type RulersLayerProps = GeoJsonLayerProps & {
}

export type RulerFeature = Feature<Point, RulerPointProperties>
export type RulerPickingObject = RulerFeature & DeckPickingObject<{}>
export type RulerPickingObject = DeckPickingObject<RulerFeature>
export type RulerPickingInfo = PickingInfo<RulerPickingObject, { tile?: Tile2DHeader }>
1 change: 1 addition & 0 deletions libs/deck-layers/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export type DeckPickingObject<G> = {
color?: string
category: DeckLayerCategory
subcategory?: DeckLayerSubcategory
uniqueFeatureInteraction?: boolean
} & G

export type AnyDeckLayer<D extends {} = {}> =
Expand Down

0 comments on commit fae8224

Please sign in to comment.