-
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
Enable data-driven values for text-font #5698
Conversation
@jfirebaugh I was thinking we would impose this restriction at the level of spec validation (and so in GL JS as well), not just in -native. |
Oh, yeah, that's probably a good idea. |
c36e346
to
4be6d2c
Compare
0b52219
to
199010d
Compare
199010d
to
e6af221
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.
Nice.
We could at some point elaborate possibleValues()
for at
and var
, but 👍 for keeping it conservative for now.
"layout": { | ||
"text-font": ["let", "p", ["array", "string", ["get", "text-font"]], ["var", "p"]], | ||
"text-field": "{foo}" | ||
} |
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: let's include "text-font"
in the id for these layers, since that's what they're testing.
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.
Do you think this is necessary given that text-font
is in the fixture file name?
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.
Oh! Whoops -- I'd assumed without looking that this was in the functions
fixture. 👍 as is
Hmm, validation also needs to prohibit |
Oof, I always forget about those. Another option would be to require data-driven values to be expressions (not functions) |
I thought about that, but I think it might be confusing for a long-existing property to have that restriction. We did do it for |
Hm, yeah good point -- I suppose if someone was already using a zoom-only stop function, they'd expect to be able to upgrade it to a zoom-and-property stop function after this. |
@jfirebaugh looks great – thanks for pushing on this. Can't wait to test out some expression values for |
@jfirebaugh
|
@jplante Yes, the API docs need to be updated -- thanks for noting that!
No, identity functions aren't supported for |
Enables support for data-driven
text-font
values. Fixes #5568.The port to native will need to take into account mapbox/mapbox-gl-native#9939 -- my proposed resolution is described in mapbox/mapbox-gl-native#9939 (comment).