-
Notifications
You must be signed in to change notification settings - Fork 46
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
Update show/hide icon #114
Conversation
When layer is visible, you will see eye closed icon on layer panel, next to layer name. This shows that you can hide layer by clicking this button ( eyeClosed ) When layer is hidden, you will see eye (opened) icon on layer panel, next to layer name. This shows that you can show layer by clicking this button ( eyeClosed ) In following up PR, we will add tool tip to all buttons. |
115e792
to
868c253
Compare
@@ -140,6 +143,12 @@ const LayerControlPanel = memo(({ maplibreRef, setLayers, layers }: Props) => { | |||
setIsLayerConfigVisible(true); | |||
}; | |||
|
|||
const [layerVisiblity, setLayerVisibility] = useState(new Map()); | |||
layers.forEach((layer) => { | |||
layerVisiblity.set(layer.id, layer.visibility == LAYER_VISIBILITY.VISIBLE); |
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.
layerVisiblity.set(layer.id, layer.visibility == LAYER_VISIBILITY.VISIBLE); | |
layerVisiblity.set(layer.id, layer.visibility === LAYER_VISIBILITY.VISIBLE); |
@@ -140,6 +143,12 @@ const LayerControlPanel = memo(({ maplibreRef, setLayers, layers }: Props) => { | |||
setIsLayerConfigVisible(true); | |||
}; | |||
|
|||
const [layerVisiblity, setLayerVisibility] = useState(new Map()); |
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.
Typo: layerVisibility
Can we define the type to the Map?
useState(new Map<string, boolean>([]))
Based on action eye closed or eye icon will be displayed. Signed-off-by: Vijayan Balasubramanian <[email protected]>
Description
Based on hide/show layer available, eye closed or eye icon will be displayed.
Signed-off-by: Vijayan Balasubramanian [email protected]
Issues Resolved
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.