I want to show a complex set of icons: ~100 basetypes with ~30 modifiers. There is no way to predefine ~3000 icons in the PNG sprite and then just pick the right one. I want to define ~130 and combine them freely. That already works by using two independent layers, but then "basetypes" and "modifiers" are on different z-indices so they interfere with each other.
Design 1: make "icon-image" accept an array (has to be implemented on other "icon-" options like "icon-offset" as well)
...
"icon-image": ["{basetype}", "{modifier}"]
...
Design 1a : don´t use an array on every single property but shift it up the to the "paint" and "layout" property.
Design 2: allow the definition of combined icons in the sprite JSON
...
"basetype":{"x":0,"y":0,"width":20,"height":40,"pixelRatio":1},
"modifier":{"x":20,"y":0,"width":20,"height":20,"pixelRatio":1},
"combined":{"icons":["basetype","modifier"], "offset":[[0,0],[0,20]]}
...
Advantages Design 1: dynamic styling
Drawbacks Design 1: complex due to multiplication of icon-properties by number of icons
Advantages Design 2: combined icons would show up like normal icons in the stylesheet
Drawbacks Design 2: need for hard coded combined icons
/cc @mapbox/gl
Combining this with the very similar #4436. Note the nice example there:

is it even possible to realize?
and how many changes need to be done in the render methods?
Expressions open up the door for a different design alternative: some kind of symbol-layout expression that's used to compose icons and runs of text into a single 'rich symbol' that's then treated as a single unit for placement/collision/z-ordering purposes.
Something like:
// new "symbol-content" layer property, incompatible with the "text-field", "icon-image", and "*-{offset,ignore-placement,allow-overlap}" properties
"symbol-content": [ "symbol-layout",
["text", ["get", "name"], { size: 13, offset: ..., color: ...}],
["text", ["get", "population_density"], { size: 11, offset: ..., color: ...}],
["text", "ppl / km^2", { size: 11, offset: ..., color: ...}],
["icon", "dot.sdf", { size: ..., offset: ..., color: ... }],
...
]
We're making progress on this in https://github.com/mapbox/mapbox-gl-js/pull/7015, which adds support for multiple fonts/sizes within a single text label. Controlling paint properties (e.g. color) and adding multiple icons will go in later PRs.
The current road name label in the navigation SDK could take advantage of this option to display a route shield alongside a road name in a single point-placed symbol. The iOS implementation uses a native view (mapbox/mapbox-navigation-ios#1576), but runtime styling would be desirable for the Android implementation (mapbox/mapbox-navigation-android#1222) for various reasons, so this feature would allow us to achieve the same effect on both platforms.

Renaming this to "Support multi-icon symbols" as multi-text has landed on GL JS as https://github.com/mapbox/mapbox-gl-js/pull/6994 and on GL Native as https://github.com/mapbox/mapbox-gl-native/pull/12624.
Example here: https://www.mapbox.com/mapbox-gl-js/example/display-and-style-rich-text-labels/
Hi guys, I was wondering if there was any update on this feature or any similar one that would enable putting two images over each other in one Symbol layer?
I am also looking for an update on this issue and wondering if this is something that is still being worked on.
@shayanaijaz This is not on our roadmap at this time, but we did introduce formatted text with inline image support in v1.6. See this blog post for more details.
Most helpful comment
Hi guys, I was wondering if there was any update on this feature or any similar one that would enable putting two images over each other in one Symbol layer?