Skip to content

Commit

Permalink
fix: check for filter before adding as thematic style
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyblasta committed Aug 18, 2023
1 parent 7d6357a commit dc27be9
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/utils/legendmaker.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,15 @@ async function setIcon(src, cmp, styleRules, layer, viewer, clickable) {
searchParams.set('FORMAT', 'image/png');
searchParams.set('RULE', row.name);
const imgUrl = decodeURIComponent(searchParams.toString());
style[0].thematic.push({
image: { src: imgUrl },
filter: row.filter,
name: row.name,
label: row.title,
visible: row.visible !== false
});
if (typeof row.filter !== 'undefined') {
style[0].thematic.push({
image: { src: imgUrl },
filter: row.filter,
name: row.name,
label: row.title,
visible: row.visible !== false
});
}
});
viewer.setStyle(styleName, style);
}
Expand Down

0 comments on commit dc27be9

Please sign in to comment.