From 955ed081d0535478940083a7b229265194e8687d Mon Sep 17 00:00:00 2001 From: Kai Volland Date: Mon, 5 Sep 2022 15:44:58 +0200 Subject: [PATCH 1/3] add Function to unsupportedProperties --- examples/parsersample.ts | 7 +++++++ style.ts | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/examples/parsersample.ts b/examples/parsersample.ts index f25d66ed3..2cc832489 100644 --- a/examples/parsersample.ts +++ b/examples/parsersample.ts @@ -16,6 +16,13 @@ export class SampleParser implements StyleParser { info: 'Blur is only partially supported' } } + }, + Function: { + acos: 'none', + strAbbreviate: { + support: 'partial', + info: 'Better use strSubstring instead.' + } } }; diff --git a/style.ts b/style.ts index 6d4d10381..f3f355ec4 100644 --- a/style.ts +++ b/style.ts @@ -1,5 +1,6 @@ import { GeoStylerBooleanFunction, + GeoStylerFunction, GeoStylerNumberFunction, GeoStylerStringFunction } from './functions'; @@ -733,6 +734,9 @@ export interface UnsupportedProperties { [key in keyof Required]?: SupportDef }; }; + Function?: SupportDef | { + [key in GeoStylerFunction['name']]?: SupportDef; + }; } /** From 7b33009b2c321b67bda6e3b0e9a19ce9a90cfe6a Mon Sep 17 00:00:00 2001 From: Kai Volland Date: Mon, 5 Sep 2022 15:46:59 +0200 Subject: [PATCH 2/3] fix signature of "between" Function --- functions.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/functions.ts b/functions.ts index 90c1575b7..5a24eb499 100644 --- a/functions.ts +++ b/functions.ts @@ -120,9 +120,9 @@ export interface Fatan2 extends FunctionCall { export interface Fbetween extends FunctionCall { name: 'between'; args: [ - Expression, - Expression, - Expression + Expression, + Expression, + Expression ]; }; From 20e0639b98a9a9bc905961f2aa5e821036f283d9 Mon Sep 17 00:00:00 2001 From: Kai Volland Date: Mon, 5 Sep 2022 16:21:50 +0200 Subject: [PATCH 3/3] fix signature of ComparisonFilter --- style.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/style.ts b/style.ts index f3f355ec4..2ffb9eabb 100644 --- a/style.ts +++ b/style.ts @@ -81,12 +81,13 @@ export type RangeFilter = [ ]; /** - * A ComparisonFilter compares a value of an object (by key) with an expected - * value. + * A ComparisonFilter compares two values. + * If the fist argument is a GeoStylerFunction it will be evaluated it. + * If it is a string it will be treated as key of an object. */ export type ComparisonFilter = [ ComparisonOperator, - Expression, + Expression, Expression ] | RangeFilter;