CLIM-1235: Map Legend hidden by Location Modal #644
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Problem
When both the map legend and location modal are open simultaneously, the location modal overlaps the legend, obscuring it completely. This occurs because both UI components use
z-30and are positioned from the right side of the map, causing theLocationModal(which renders after the Legend in the DOM) to paint on top.Solution
Implement Redux state management for map UI overlays, allowing the
LocationModalto dynamically adjust its position based on whether the legend is open or closed.Implementation Details
1. Redux State Architecture -
MapOverlayStateInterfaceMapOverlayStateinterface to represent UI overlay componentsisOpen: booleanproperty to track open/closed statewidth,height,x,y,bounds2. Redux Store Updates (
map-slice.ts)legend: MapOverlayStateto track legend panel statelocationModal: MapOverlayStateto track location modal state (prepared for future use)setLegendOpen(boolean)action to control legend statesetLocationModalOpen(boolean)action (prepared for future use)3. Component Refactoring
MapLegend Component:
useStateto Redux forisOpenstatesetLegendOpen()instead of callingsetIsOpen()LocationModal Component:
state.map.legend.isOpenfrom Reduxmd:right-28(~112px from right edge)md:right-[480px](~480px from right edge)Behavior
LocationModalpositioning adjusts dynamically based on legend stateFuture Enhancements
The
MapOverlayStateinterface architecture supports:DOMRectboundssetLocationModalOpen()action for consistent state managementTesting Checklist
LocationModalrepositions correctlyRelated ticket
Related PRs