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

ol/layer/VectorTile clip layer based on a vector source, the labels is not be clipped #11654

Open
songyumeng opened this issue Oct 16, 2020 · 6 comments

Comments

@songyumeng
Copy link
Contributor

Describe the bug
ol/layer/VectorTile clip layer based on a vector source, just like layer-clipping-vector,but labels is not be clipped.
BTW, In ol/layer/VectorLayer with labels clip is worked

To Reproduce
Steps to reproduce the behavior:

  1. Go to demo

Expected behavior
ol/layer/VectorTile clip layer based on a vector source, the labels is also clipped

@ahocevar
Copy link
Member

Because of the way decluttering works, this behavior is expected when the layer is configured with declutter: true. But without decluttering, clipping should work as expected.

@songyumeng
Copy link
Contributor Author

But without decluttering, clipping should work as expected.

I think maybe the reason is fire postrender before the text is rendered.
https://github.com/openlayers/openlayers/blob/main/src/ol/renderer/canvas/VectorTileLayer.js#L648

Because of the way decluttering works, this behavior is expected when the layer is configured with declutter: true

Is there any way to make this behavior worked when declutter: true

@mike-000
Copy link
Contributor

See #11606 for a workaround. With the new per-layer decluttering logic prerenderdeclutter and postrenderdeclutter events could also be added?

@ahocevar
Copy link
Member

With the new per-layer decluttering logic prerenderdeclutter and postrenderdeclutter events could also be added?

Like I said already in #11606 (comment), I think It should be enough to trigger the postrender event after renderDeclutter(), when there are declutter executor groups.

@mike-000
Copy link
Contributor

Yes, as long as className is used where appropriate that would be sufficient.

@songyumeng
Copy link
Contributor Author

hi,
Is there any new progress?
I tried the latest version v6.5.0 and still have this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants