-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Adds map overlay switch on map #1357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Introduces a button to toggle the overlay's visibility. The overlay preference persists across sessions. Memoize MapOverlay to avoid unnecessary re-renders
Refactors the map overlay component to improve code readability and maintainability. - Updates the overlay control to use static getDefaultPosition method. - Updates the overlay styling to use single quotes.
src/map/overlay/MapOverlayButton.js
Outdated
|
||
const statusClass = (status) => `maplibregl-ctrl-icon maplibre-ctrl-overlay maplibre-ctrl-overlay-${status}`; | ||
|
||
class OverlayControl { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this basically a copy of the alarm button? I think we need to figure out how to reuse a button instead of copying.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's true, I'll see tomorrow to redo these two buttons.
Do you usually put them in src/common/components?
Or maybe src/map and I create a new components folder in it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Map components should be under map folder.
Refactors the map notification and overlay buttons into a generic panel button component. This change improves code reusability and simplifies the map interface by using a consistent button style for different map controls.
Simplifies map control button styling by removing the redundant `maplibre-ctrl-background-icon` class. This change improves code readability and maintainability by consolidating the icon styling under a single `maplibre-ctrl-icon` class, making it easier to manage button appearance.
Can we split into 2 PRs:
Also I think the icon shouldn't have a color. |
Done : #1358 ( refactoring ) |
Updates the overlay icon colors to improve visual clarity. The "on" state icon is now black, and the "off" state icon is now gray.
color is now black for enabled and gray for disabled |
Introduces a button to toggle the overlay's visibility. The overlay preference persists across sessions.
Memoize MapOverlay to avoid unnecessary re-renders
Move activeOverlay management from MapOverlay.js to MainMap.jsx to avoid code duplication on MapOverlay.js and MapOverlayButton.js [ new component ]
The button is not rendered when no map overlay is indicated (hence the displacement of the activeOverlay logic).