Skip to content
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

Merged
merged 1 commit into from
Dec 8, 2022
Merged

Conversation

VijayanB
Copy link
Member

@VijayanB VijayanB commented Dec 8, 2022

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.

@VijayanB VijayanB requested a review from a team December 8, 2022 20:22
@VijayanB
Copy link
Member Author

VijayanB commented Dec 8, 2022

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 )

Screen Shot 2022-12-08 at 12 22 04 PM

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 )

Screen Shot 2022-12-08 at 12 22 11 PM

In following up PR, we will add tool tip to all buttons.

@VijayanB VijayanB force-pushed the eye branch 4 times, most recently from 115e792 to 868c253 Compare December 8, 2022 20:41
@@ -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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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());
Copy link
Member

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]>
@VijayanB VijayanB merged commit 47f933a into opensearch-project:feature/new-maps Dec 8, 2022
@junqiu-lei junqiu-lei added the enhancement New feature or request label Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants