Skip to content

Don't check hover if hovering features are empty#179

Open
utilmind wants to merge 4 commits into
robertleeplummerjr:masterfrom
utilmind:master
Open

Don't check hover if hovering features are empty#179
utilmind wants to merge 4 commits into
robertleeplummerjr:masterfrom
utilmind:master

Conversation

@utilmind
Copy link
Copy Markdown
Contributor

@utilmind utilmind commented Jun 2, 2025

Otherwise, an error may occur in the inBounds() function when it checks if some point is within the bounds but the bounds are empty.

This fixes possible issue with glify.lines() layers.

utilmind added 4 commits June 2, 2025 19:10
Otherwise, an error may occur in the inBounds() function when it checks if some point is within the bounds but the bounds are empty.
+ performance optimization for tryHover method
@utilmind
Copy link
Copy Markdown
Contributor Author

New patch contains a fix for issue #182. So hover handlers now correctly implemented for glify.lines(). Plus added some performance optimizations, like cached bounding rectangle with all features, etc.

@utilmind
Copy link
Copy Markdown
Contributor Author

utilmind commented Jul 22, 2025

Actually that check, if (inBounds(e.latlng, instance.incBounds(sensitivityHover))) can be removed completely.

In my particular implementation users working only on the part of map filled with features, so we don't need to check whether mouse hovers the rectangle with features. The features are certainly always in view in my case.

So maybe it worth to add another additional option, something like "checkHoverBounds" and do that inBounds() check only when option is turned on (true).

So for my particular implementation this inBounds() is not necessary. Personally I would remove it completely. However I fixed it only because it was already part of the code. Now it performs properly.

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.

1 participant