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 click/hover on lines: use minDistance and optimize functions #157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

trafficonese
Copy link
Contributor

Somehow with all the newly merged PR's the click/hover function for Lines returns worse results.
That is because currently only the last found feature is returned.

I changed that and included a new variable minDistance, so that the feature with the smallest distance will be returned.

Some optimizations for tryClick and tryHover for Lines:

  • moved the checkClick, checkHover functions outside the loops.
  • new chosenWeightFn outside the second for-loop, to not repeatedly check the data type.
  • used Set instead of Array for oldHoveredFeatures and newHoveredFeatures

@trafficonese
Copy link
Contributor Author

@robertleeplummerjr Could you maybe look into this?

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.

None yet

1 participant