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

Fix hide of Click options layers #660

Merged
merged 2 commits into from
Mar 26, 2024
Merged

Fix hide of Click options layers #660

merged 2 commits into from
Mar 26, 2024

Conversation

cmanciero
Copy link
Collaborator

Display click layers when switching back to Click option in Analyze Area on Data Globe

Description

Currently when switching from Click to another option and back, the last selected option is deselected. This fix will keep that option active when going back to Click tab

Testing instructions

Access the Analyze Area tab for the Data globe. Choose "Search" selection type and then select "Click" selection type. You will noticed that the regions are still able to be highlighted and clicked on

Copy link

vercel bot commented Mar 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
half-earth ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 25, 2024 6:41pm

@Bluesmile82
Copy link
Collaborator

There is still a problem as you noticed with the highlight on the layer when we clear the selection. This is because we didn't contemplate the option of this layer being removed.

In the feature-highlight-layer component which is the responsible of painting the outline (its an empty component that renders null but adds this effect to the graphic layer) we set the graphics layer with the effects on click and hover and add them to the map.

https://github.com/Vizzuality/half-earth-v3/blob/analyze-area-toggle/src/containers/layers/feature-highlight-layer/index.js#L40

But it seems that once we clean up we don't delete this graphics layer so when we reinit it we have the graphic layer but the border graphics are not set.

Could you check this and find a solution? Maybe we could delete this graphic layer or reassign the graphics to it.

@cmanciero
Copy link
Collaborator Author

@Bluesmile82 I updated the code to add the GraphicLayer back if going from Clearing Selections and back to choosing a layer

@Bluesmile82 Bluesmile82 merged commit 2f5a43a into develop Mar 26, 2024
2 checks passed
@Bluesmile82 Bluesmile82 deleted the analyze-area-toggle branch March 26, 2024 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants