Repository navigation
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
anandthakker
left a comment
There was a problem hiding this comment.
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.
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.
Do you think this is necessary given that text-font is in the fixture file name?
There was a problem hiding this comment.
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-fontvalues. 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).