Skip to content

Document that polygons must have a fill for full hit detection #16698 #16701

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

Merged

Conversation

m-mohr
Copy link
Contributor

@m-mohr m-mohr commented Mar 6, 2025

Document that polygons must have a fill if pixels inside the polygon should be hit detected

See #16698 and #7750 for details.

Copy link

github-actions bot commented Mar 6, 2025

📦 Preview the website for this branch here: https://deploy-preview-16701--ol-site.netlify.app/.

@mike-000
Copy link
Contributor

mike-000 commented Mar 6, 2025

That also applies to RegularShape and Text (fill and backgroundFill) styling. As with polygons you will find it mentioned in upgrade notes, but that is also not in the main documentation.

@m-mohr
Copy link
Contributor Author

m-mohr commented Mar 6, 2025

Hmm... so maybe like this?

For polygons, text and regular shapes without a (background) fill, only the stroke will be used for hit detection.
Such features must have a fill applied to ensure that pixels within the fill are considered for detection.
The fill can be transparent.

Copy link
Contributor

@jahow jahow left a comment

Choose a reason for hiding this comment

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

Looking good, thanks @m-mohr!

edit: I think the description is good as it is, it conveys the idea that there is a different between no fill and transparent fill in a concise way

@jahow jahow merged commit 743b3dd into openlayers:main Mar 11, 2025
8 checks passed
@m-mohr m-mohr deleted the docs-transparent-fill-for-hit-detection branch March 11, 2025 11:30
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

3 participants