-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Conversation
@ivovandongen, thanks for your PR! By analyzing the history of the files in this pull request, we identified @jfirebaugh, @tmpsantos and @kkaefer to be potential reviewers. |
The current way of reloading introduces some flickering on symbols (most notably labels) as all sources for current symbol layers are reloaded. Not sure if there is around this so that only sources are updated that actually reference the sprite image in the currently loaded tiles. cc @jfirebaugh |
As I noted in #6536 (comment), I believe we should prohibit the use of |
Agreed. The title of the PR is somewhat misleading (changing now). This is actually fixing a case where you remove an image and later add one with the same id. |
@jfirebaugh If you want, I can add an exception in the case where an image is added for an existing id to prevent confusion there (now there is a log warning, only in the case the dimensions don't match). |
Yeah, but there's a symbol layer that references that ID the whole time right? It's functionally the same as updating an existing image. Basically, I think the same rules should apply here as in #6612 (comment) -- no removing an image that's in use. |
Yes
I agree on the principle. However, I do see people running in to this quite quickly when using this api. The first example I made, I ran into it myself. Wondering why the image didn't update. It also adds the need to always update the source and the sprite instead of just the sprite. How about adding an explicit update call then indeed? This would be the most intuitive to use. This does leave us with the original issues: what to do on So the changes would be:
|
The problem is that rendering is in an undefined state in the interval between removing the image from the We could allow in place updates where the image dimensions do not change. This case should not require reloading tiles, only updating the texture and repainting. |
Fixes #6536