From dc27be98e5a5d07e2dcca45d15e24b3b58381b6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johnny=20Bl=C3=A4sta?= Date: Fri, 18 Aug 2023 15:51:01 +0200 Subject: [PATCH] fix: check for filter before adding as thematic style --- src/utils/legendmaker.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/utils/legendmaker.js b/src/utils/legendmaker.js index 000686af3..94116eb31 100644 --- a/src/utils/legendmaker.js +++ b/src/utils/legendmaker.js @@ -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); }