diff --git a/metrics/integration/render-tests/text-field/formatted-images-mixed/expected.png b/metrics/integration/render-tests/text-field/formatted-images-mixed/expected.png new file mode 100644 index 000000000..8a6165ef7 Binary files /dev/null and b/metrics/integration/render-tests/text-field/formatted-images-mixed/expected.png differ diff --git a/metrics/integration/render-tests/text-field/formatted-images-mixed/style.json b/metrics/integration/render-tests/text-field/formatted-images-mixed/style.json new file mode 100644 index 000000000..3740918c6 --- /dev/null +++ b/metrics/integration/render-tests/text-field/formatted-images-mixed/style.json @@ -0,0 +1,59 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 128, + "width": 128 + } + }, + "center": [ 0, 0 ], + "zoom": 0, + "sources": { + "point": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 20 ] + }, + "properties": { + "iconsInText": "yes" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, -20 ] + } + } + ] + } + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "sprite": "local://sprites/emerald@2x", + "layers": [ + { + "id": "text", + "type": "symbol", + "source": "point", + "layout": { + "text-field": [ + "case", + ["==", ["get", "iconsInText"], "yes"], + ["format", "IconsInText", ["image", "london-underground"]], + ["format", "TextOnly"] + ], + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ] + } + } + ] +} diff --git a/src/mbgl/layout/symbol_layout.cpp b/src/mbgl/layout/symbol_layout.cpp index a01c0e862..8c216c40e 100644 --- a/src/mbgl/layout/symbol_layout.cpp +++ b/src/mbgl/layout/symbol_layout.cpp @@ -744,7 +744,7 @@ void SymbolLayout::prepareSymbols(const GlyphMap& glyphMap, // if either shapedText or icon position is present, add the feature const Shaping& defaultShaping = getDefaultHorizontalShaping(shapedTextOrientations); - iconsInText = defaultShaping && defaultShaping.iconsInText; + iconsInText |= defaultShaping && defaultShaping.iconsInText; if (defaultShaping || shapedIcon) { addFeature(std::distance(features.begin(), it), feature,