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

Replace query marker fade animation with css #5307

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

AntonKhorev
Copy link
Collaborator

Fixes #5305.

Currently query markers are animated using javascript which requires managing timed events. We don't do it correctly, we don't cancel them when markers are removed. That's why #5305 happens.

This PR replaces the javascript animation with the css which doesn't require any event handlers. I could have added animation end events to remove the marker layer but once faded out it doesn't affect anything and it's cleaned up in page.unload.

Copy link
Member

@tomhughes tomhughes left a comment

Choose a reason for hiding this comment

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

This is great, but despite the time being set the same it definitely seems to run faster to me? It's hard to actually time it but it seems like it might be close to twice as fast maybe because the javascript introduces extra delays running the function?

I think we should probably increase the time in the CSS to somewhere nearer 1500 to get closer to the same behaviour.

@AntonKhorev
Copy link
Collaborator Author

Increased to 1500ms. Javascript event listeners run in the same thread with everything else including getting query results over the net.

@tomhughes
Copy link
Member

This looks good now, thanks.

@tomhughes tomhughes merged commit 3a1b4cb into openstreetmap:master Nov 8, 2024
22 checks passed
@AntonKhorev AntonKhorev deleted the css-query-animation branch November 8, 2024 08:19
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.

Query highlight flickers when existing query is still loading
2 participants