From 1d690ed4fe77c6404083c4f6130e954374034fcd Mon Sep 17 00:00:00 2001 From: florent <flavelle@neogeo.fr> Date: Wed, 5 Jan 2022 12:40:54 +0100 Subject: [PATCH] keep leaflet cirlcleMarker for cirlce symbols --- src/assets/js/map-util.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/assets/js/map-util.js b/src/assets/js/map-util.js index da388ae4..b89c5a07 100644 --- a/src/assets/js/map-util.js +++ b/src/assets/js/map-util.js @@ -398,7 +398,10 @@ const mapUtil = { if (color == undefined){ color = featureType.color; } - const colorValue = color.value ? color.value : color; + const colorValue = + color.value && color.value.length ? + color.value : typeof color === 'string' && color.length ? + color : '#000000'; if (geomJSON.type === 'Point') { if ( customFieldOption && @@ -407,7 +410,10 @@ const mapUtil = { featureType.colors_style.value.icons && !!Object.keys(featureType.colors_style.value.icons).length ) { - if (featureType.colors_style.value.icons[customFieldOption]) { + if ( + featureType.colors_style.value.icons[customFieldOption] && + featureType.colors_style.value.icons[customFieldOption] !== 'circle' + ) { const iconHTML = ` <i class="fas fa-${featureType.colors_style.value.icons[customFieldOption]} fa-lg" @@ -428,16 +434,16 @@ const mapUtil = { .addTo(featureGroup); } else { L.circleMarker(geomJSON.coordinates, { - color: color, + color: colorValue, radius: 4, fillOpacity: 0.5, weight: 3, }) - .bindPopup(popupContent) - .addTo(featureGroup); + .bindPopup(popupContent) + .addTo(featureGroup); } } else { - if (featureType.icon) { + if (featureType.icon && featureType.icon !== 'circle') { const iconHTML = ` <i class="fas fa-${featureType.icon} fa-lg" -- GitLab