-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Labels
Description
per #6289 (comment)
In the recent addition of data-driven styling support for *-pattern
properties, feature-state
dependent expressions do not work. The removal of the possibleOutputs
state (#6289 (comment)) makes it possible that the icons needed forfeature-state
related paint array updates may not be available in the tile's ImageAtlas
at update time.
We haven't run into this before because the other data-driven properties that require glyph/icon assets are layout
properties which don't support feature-state
expressions yet.
I see a couple options on how to fix this:
- request new images in the
CrossFadedCompositeBinder#updatePaintArrays
method that runs on the main thread when feature states are updated/changed and update the tile's ImageAtlas- 👎 binder would need access to
ImageManager
, binder would have to send the new ImageAtlas to the tile somehow
- 👎 binder would need access to
- pass available feature-states to the buckets at parse time so the expressions can be evaluated with feature state and all needed images can be requested
- 👎 additional payload on worker thread transfer, doesn't cover the case where no features have the state value that is used in the expression when it is set as a paint property
- reintroduce
possibleOutputs
state and require thatfeature-state
dependent expressions forcross-faded-data-driven
properties be contained as literals- 👎 lots of special-case logic and behavior, might be confusing/unexpected to users
- not support
feature-state
expressions forcross-faded-data-driven
properties- 👎 this is the current behavior, but it fails silently
leaning towards the first option here, but curious if anyone has a different preference or another idea.
cc @asheemmamoowala @jfirebaugh
marcoqu, chapmanjacobd, ZacVawterKodiak and misaugstad