nismod / irv-jamaica

Jamaica Systemic Resilience Assessment Tool
MIT License
0 stars 0 forks source link

refactor(frontend): interaction layer state #45

Closed eatyourgreens closed 1 week ago

eatyourgreens commented 1 week ago

Build interaction layer state dynamically from the interaction group config. hoverLayerStates is a map of layer IDs to layer hover states and layer hover targets.

const layerStates = useRecoilValue(layerHoverStates);
const { isHovered, target } = layerStates.get('hazards');

Move interaction state from src/lib/data-map/interactions to src/state/interactions.