Skip to content

Commit

Permalink
corr mapBox 'icon-image' and sprites
Browse files Browse the repository at this point in the history
  • Loading branch information
ftoromanoff committed Oct 17, 2023
1 parent bf8784d commit 4b996ca
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/Core/Style.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4b996ca

Please sign in to comment.