From 2bcd57193df382c3d1222fbfa5fe0d6172b9b048 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Kr=C3=B6g?= Date: Sun, 8 Aug 2021 15:30:57 +0200 Subject: [PATCH] Don't add color as possible type if it was not set --- src/ol/style/expressions.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ol/style/expressions.js b/src/ol/style/expressions.js index ff29c14dfd..106190727e 100644 --- a/src/ol/style/expressions.js +++ b/src/ol/style/expressions.js @@ -596,9 +596,9 @@ function getEqualOperator(operator) { // find common type let type = ValueTypes.ANY; for (let i = 0; i < args.length; i++) { - type = type & getValueType(args[i]); + type &= getValueType(args[i]); } - if (type === 0) { + if (type === ValueTypes.NONE) { throw new Error( `All arguments should be of compatible type, got ${JSON.stringify( args @@ -608,7 +608,7 @@ function getEqualOperator(operator) { // 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; + type &= ~ValueTypes.COLOR; return `(${expressionToGlsl( context,