From fec6fee83cac4183aaeebc418daaae82587d1f12 Mon Sep 17 00:00:00 2001 From: Seba Kerckhof Date: Wed, 28 Jul 2021 09:26:29 +0200 Subject: [PATCH] Remove color from value type in equal operator --- src/ol/style/expressions.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/ol/style/expressions.js b/src/ol/style/expressions.js index f66162cbe1..ff29c14dfd 100644 --- a/src/ol/style/expressions.js +++ b/src/ol/style/expressions.js @@ -606,11 +606,9 @@ function getEqualOperator(operator) { ); } - if (type === (ValueTypes.COLOR | ValueTypes.STRING)) { - // It's not possible to compare attributes with color values - // So force it to be treated as a string - type = ValueTypes.STRING; - } + // Since it's not possible to have color types here, we can leave it out + // This fixes issues in case the value type is ambiguously detected as a color (e.g. the string 'red') + type = type ^ ValueTypes.COLOR; return `(${expressionToGlsl( context,