From bac8495b3cefd9c97344cf07c3530edf4a3bb3b3 Mon Sep 17 00:00:00 2001 From: orangemug Date: Sat, 4 Apr 2020 10:45:11 +0100 Subject: [PATCH] Made swatch simplier because colors from features are already evaluated --- src/components/map/FeatureLayerPopup.jsx | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/components/map/FeatureLayerPopup.jsx b/src/components/map/FeatureLayerPopup.jsx index ce434ab..6ee17ec 100644 --- a/src/components/map/FeatureLayerPopup.jsx +++ b/src/components/map/FeatureLayerPopup.jsx @@ -58,23 +58,8 @@ class FeatureLayerPopup extends React.Component { if(propName) { const propertySpec = latest["paint_"+feature.layer.type][propName]; - let color = feature.layer.paint[propName]; - - if(typeof(color) === "object") { - if(color.stops) { - color = styleFunction.convertFunction(color, propertySpec); - } - - const exprResult = expression.createExpression(String(color), propertySpec); - const val = exprResult.value.evaluate({ - zoom: zoom - }, feature); - return val.toString(); - } - else { - return color; - } + return String(color); } else { // Default color