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

Incorrect position in icon-position example #1234

Open
gberaudo opened this issue Sep 30, 2024 · 0 comments
Open

Incorrect position in icon-position example #1234

gberaudo opened this issue Sep 30, 2024 · 0 comments

Comments

@gberaudo
Copy link
Member

The left icon should have its text anchored to the bottom.
This is not the case:
image

This is due to OL returning a null anchor: iconStyle.getAnchor() during first rendering.

If you click "toggle clampToGround", the text will be placed correctly.
image
I think that as soon as the icon is actually loaded by OpenLayers, then subsequent calls to iconStyle.getAnchor() will return a valid anchor.

In order to fix this issue, we should thus track the loading state of the image and (re)create the counterpart geometry when it changes.

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

No branches or pull requests

1 participant