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: onMouseEnter & onMouseLeave trigger between joined layers (#1671) #2126

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Jungzl
Copy link
Contributor

@Jungzl Jungzl commented Feb 23, 2023

fix #1671

return 0;
}
return features.filter(
(feature, index) => features.findIndex(f => f.layer.id === feature.layer.id) === index
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is very inefficient. Use new Set(ids).size

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


if (!isHovering && wasHovering) {
if (hoveringLayersCount < hoveredLayersCount) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this correct, though? What if the layer count is the same but one layer is replaced by another?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

don't know if it's ok to call pointEvents twice in one callback

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.

onMouseEnter isn't triggered when moving between layers from different sources
2 participants