Skip to content

Commit

Permalink
converting both ids and labels to strings
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlalex committed Feb 16, 2024
1 parent 35be006 commit cc98607
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/utils/legendmaker.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,8 @@ export const Legend = function Legend({
const style = viewer.getStyles()[styleName];
if (layer.get('type') !== 'WMS') {
for (let i = 0; i < style.length; i += 1) {
let idStr;
if (style[i][0].id) {
idStr = style[i][0].id.toString();
}
style[i][0].visible = activeThemes.includes(idStr || style[i][0].label);
const combinedStr = style[i][0].id?.toString() || style[i][0].label?.toString();
style[i][0].visible = activeThemes.includes(combinedStr);
}
}
}
Expand Down

0 comments on commit cc98607

Please sign in to comment.