-
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
Image expression #8684
Image expression #8684
Conversation
cc @mapbox/map-design-team @mapbox/studio @kkaefer |
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.
@ryanhamley Just a few minor comments.
Question, do you plan to add support for default image that is not in a sprite sheet? Or, would it be handled via onStyleImageMissing callback?
Another question is that, what happens when developer removes image from a sprite sheet while worker is parsing tile? It looks like availableImages and images that are in sprite sheet could be out-of-sync and image
operator would not fall-back to default value (e.g., when used in coalesce).
8a1401a
to
0b5daae
Compare
@@ -140,4 +140,3 @@ export default class ImageAtlas { | |||
|
|||
register('ImagePosition', ImagePosition); | |||
register('ImageAtlas', ImageAtlas); | |||
|
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.
nit: no change needed
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.
This was automatically added by my editor. It's pretty standard to end files with a new line isn't it? Most of our other files have a trailing new line.
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! 🎉
@alexshalamov I'm adding an additional step in a follow-up PR to determine the first requested image in an expression (reading from left to right and assuming that the first image requested is the "most desirable" option) which evaluates to
I think this is analogous to what happens if you asynchronously load an image with |
Launch Checklist
This PR implements a new
Image
expression type andimage
operator as discussed in #8052 particularly #8052 (comment)image
expression operator to allow for determining an image's availability before requesting it@mapbox/studio
and/or@mapbox/maps-design
if this PR includes style spec changes@mapbox/gl-native
if this PR includes shader changes or needs a native portChangelog
Add
image
expression operator which determines if a requested image is available in the map's style or not