From dda483269f16d1b9ab1719df9d70434e15ca636f Mon Sep 17 00:00:00 2001 From: Florent <florent@MacBook-Air-de-neogeo.local> Date: Thu, 25 Nov 2021 17:22:52 +0100 Subject: [PATCH] fix regression --- src/assets/js/map-util.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/assets/js/map-util.js b/src/assets/js/map-util.js index bc6f2d86..8b6ed9b8 100644 --- a/src/assets/js/map-util.js +++ b/src/assets/js/map-util.js @@ -398,14 +398,19 @@ const mapUtil = { // Look for a custom field let customField; let customFieldOption; - if (Object.keys(feature.properties).some(el => featureType.customfield_set.map(e => e.name).includes(el))) { + if (featureType.customfield_set && Object.keys(feature.properties).some(el => featureType.customfield_set.map(e => e.name).includes(el))) { customField = Object.keys(feature.properties).filter(el => featureType.customfield_set.map(e => e.name).includes(el)); customFieldOption = feature.properties[customField[0]]; } let color; if (customFieldOption && featureType.colors_style) { - color = featureType.colors_style.value.colors[customFieldOption].value + color = + featureType.colors_style.value ? + featureType.colors_style.value.colors[customFieldOption].value ? + featureType.colors_style.value.colors[customFieldOption].value : + featureType.colors_style.value.colors[customFieldOption] : + featureType.colors_style.colors[customFieldOption] } else { color = feature.properties.color; } -- GitLab