-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Calling setData on geojson sources causes flickering #973
Comments
@edenh yes, because on every setData, you need to send it to the worker, process it and send back. We could make this a bit better by not removing the line until the main thread gets new processed data. For a smoother experience on specific use cases like this where data is very small and coordinates don't get away from the current tile too much, but needs to be rendered fast, we could implement an alternative code path that completely avoids worker communication and tiling. It would need a different API though. @ansis what do you think? |
This would also help us. We have some use cases that require manipulating a very small amount of data via the setData API and flickering/lag is noticeable. |
Grabbing this today. |
@robschley try now! |
@mourner The flicker is gone when using the |
@robschley hmm, can you demonstrate the jumpiness with a JSFiddle? I haven't seen that. |
Instead of using icon, use mapbox marker. The problem with mapbox icon is that its custom setData() method takes sometime to update the source and so the next animation frame is requested before the data is updated in the source.This causes flickering. |
source.setData
is being called on mousemove in this example:The text was updated successfully, but these errors were encountered: