Allow icon-image
to accept a value that means "no icon-image"
#6935
Labels
cross-platform 📺
Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.)
Motivation
Right now, if you don't want to include an icon for a symbol layer, you simply don't assign an
icon-image
value. However, there are situations where you want to assign an expression value foricon-image
that includes a "no icon image" assignment for just some zoom levels or some conditions.Design Alternatives
icon-opacity
to control visibility of icons within a style layer (which is what we currently do in our core styles).""
). However, this will be treated like any other string that doesn't exist in the spritesheet (i.e. will soon throw a warning, per validate sprite URL is defined when a style uses sprite-dependent properties #6823).Design
Per conversation with @jfirebaugh, perhaps it would make sense to special case
null
values to mean "no icon image" (the alternative perhaps being to special case empty strings). Currently,icon-image
will not accept null values.Mock-Up
Example expressions:
Concepts
Using
null
values to represent "no icon" is different to howtext-field
works, which accepts (and defaults to) empty strings to mean "no text".Implementation
Not sure what the critical implementation considerations are for this.
/cc @mapbox/gl-core @mapbox/maps-design @mapbox/studio
The text was updated successfully, but these errors were encountered: