-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[core] Fix placement for updated buckets #15308
Conversation
cc @tobrun |
@pozdnyakov There is a visible flickering in the second gif file. |
The flickering looks like it might be caused by the parent tile loading before the other tiles. Maybe the previous placement delay covered that up. This downside of this change is that placement will run more frequently and placement can be expensive. If a map is already dropping frames this might make it drop even more frames. If it's fast enough this should be a great change. In -js we currently have to split placement across multiple frames and make it less frequent to avoid jankiness. I'm currently trying to tweak this to make placement more frequent during zooming to get rid of the label bunching effect that happens when you zoom out fast. mapbox/mapbox-gl-js#8628 But if this is fast enough in -native then doing it more frequently should be great! |
b5550f1
to
8344118
Compare
@ansis @alexshalamov Thanks for your comments!
True, the fading label is from the parent tile, same behavior however can be observed with the current implementation as well.
To mitigate this, the latest commit invokes the new placement only when new buckets are registered. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
b7a038f
to
6c57b96
Compare
How to measure impact of this patch on zooming and panning? We could get rough estimate using iOS demo app FPS counter, on low end phone. |
Buckets update initiates new placement, so that newly added symbols are placed and shown immediately.
6c57b96
to
4ee7d99
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Metrics collected with this branch did not discover any negative performance impact caused by the patch. |
Before this change, just loaded buckets could not be placed until the new placement was created in a 300 ms period, and it caused a latency in symbols appearance.

Now buckets load initiates new placement, so that newly added symbols get placed immediately.
Before:
After:

(Transition duration is set to 1 s for better visibility)
Another positive impact is that a
Placement
instance does not have to set opacity for the symbols, which it did not place. So,updateBucketOpacities()
call now does not mutate the placement, tagging #14638