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

feat: dispatch layerchange event #721

Merged
merged 3 commits into from
Mar 7, 2024

Conversation

silvester-pari
Copy link
Collaborator

@silvester-pari silvester-pari commented Mar 6, 2024

Implemented changes

This PR adds a generic layerchange event to eox-layercontrol. Currently it triggers when a layer's visibility is changed or the length of layers inside a group is changed; more events could be added in the future.

Usage:

eoxLayerControl.addEventListener("layerchange", (e) => {
  console.log(e.detail.get("id))  
  console.log(e.detail.getVisible())
})

Checklist before requesting a review

@silvester-pari silvester-pari marked this pull request as ready for review March 6, 2024 09:58
Copy link
Collaborator

@viktoraronfarkas viktoraronfarkas left a comment

Choose a reason for hiding this comment

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

looks good, thanks! :)

@silvester-pari silvester-pari merged commit 6f54911 into main Mar 7, 2024
3 checks passed
@silvester-pari silvester-pari deleted the layercontrol/feat/layerchange-event branch March 7, 2024 06:50
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.

Implement event callback for change in layer visibility in LayerControl element
2 participants