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 decluttering opacity, zIndex and circles #15614

Merged
merged 2 commits into from Mar 14, 2024

Conversation

ahocevar
Copy link
Member

@ahocevar ahocevar commented Mar 5, 2024

Working on a fix for #15611 (point symbols disappearing on vector layers with opacity != 1) I created a new rendering test, which revealed two more issues:

  • Circle geometries are not rendered when decluttering
  • Styles with negative zIndex are rendered after styles with positive zIndex.

All these are fixed now.

Fixes #15611.

Copy link

github-actions bot commented Mar 5, 2024

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

@ahocevar ahocevar marked this pull request as draft March 5, 2024 22:46
@ahocevar ahocevar force-pushed the declutter-opacity-circle-zindex branch from 67cff23 to 4ca4308 Compare March 5, 2024 23:02
@ahocevar ahocevar marked this pull request as ready for review March 5, 2024 23:09
Comment on lines 429 to 431
for (const key in deferredZIndexContexts) {
deferredZIndexContexts[key].forEach((zIndexContext) => {
const zs = Object.keys(deferredZIndexContexts).sort(ascending);
for (let i = 0, ii = zs.length; i < ii; ++i) {
deferredZIndexContexts[zs[i]].forEach((zIndexContext) => {
Copy link
Member Author

Choose a reason for hiding this comment

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

Sorting makes sure that styles with negative zIndex will be rendered before styles with positive zIndex.

Copy link
Member

@tschaub tschaub Mar 14, 2024

Choose a reason for hiding this comment

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

Do we care that a z-index of -1 will be sorted before -10 (and 10 before 2)?

Copy link
Member Author

@ahocevar ahocevar Mar 14, 2024

Choose a reason for hiding this comment

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

Oh, thanks for spotting this. I just committed a fix. Postitive numbers were already sorted properly though, because the ascending() sort function takes care of that.

@ahocevar ahocevar force-pushed the declutter-opacity-circle-zindex branch from 4ca4308 to 821001b Compare March 5, 2024 23:15
@ahocevar ahocevar merged commit 894440e into openlayers:main Mar 14, 2024
8 checks passed
@ahocevar ahocevar deleted the declutter-opacity-circle-zindex branch March 14, 2024 22:13
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.

setOpacity on Vector Layer with 'declutter' set causes layer to disappear.
2 participants