diff --git a/src/Core/Style.js b/src/Core/Style.js index 6db260fa83..5023c55d8d 100644 --- a/src/Core/Style.js +++ b/src/Core/Style.js @@ -760,13 +760,12 @@ class Style { } // additional icon - const icon = readVectorProperty(layer.layout['icon-image']); - if (icon) { - this.icon.id = icon; - this.icon.source = sprites?.source || icon; - if (sprites) { - this.icon.cropValues = sprites[icon]; - } + const iconImg = readVectorProperty(layer.layout['icon-image']); + if (iconImg && sprites) { + this.icon.id = iconImg; + this.icon.source = sprites.source; + this.icon.cropValues = sprites[iconImg]; + this.icon.size = readVectorProperty(layer.layout['icon-size']) || 1; const { color, opacity } = rgba2rgb(readVectorProperty(layer.paint['icon-color'], { type: 'color' })); this.icon.color = color;