Describe the bug
I am getting console error messages about filters which do work but still produce an error. I don't understand why they would be wrong or how to change them to prevent the error. I am merging filters in React (using react-map-gl) and only really have control over some of the filters but the external filters.
I can reproduce the error when adding a filter to the integration tests.
To Reproduce online
Steps to reproduce the behavior:
- Go to https://www.osm-verkehrswende.org/cqi/map/?map=12%2F13.39%2F52.518&anzeige=incompleteness
- Select any of the legend items to filter, eg. "Sehr unvollständig"
- See console:
Error: layers.lane markings dashed.filter[2][0]: expected one of [==, !=, >, >=, <, <=, in, !in, all, any, none, has, !has, within], "match" found
To Reproduce in tests
- Open
test/integration/style-spec/tests/filters.input.json
- Append
{
"id": "mixing `match` with `==`",
"type": "line",
"source": "source",
"source-layer": "source-layer",
"filter": ["all", ["==", "Constructi", 1930], ["match", ["get", "Constructi"], [1930], true, false]]
}
- Run
npm run test-integration
+ },
+ ValidationError {
+ "line": 166,
+ "message": "layers[16].filter[2][0]: expected one of [==, !=, >, >=, <, <=, in, !in, all, any, none, has, !has, within], \"match\" found",
},
Expected behavior
I expect match filters to be valid filters the same as ==
Additional context
I was wondering it the issue is, that match has a return type of OutputType according to https://maplibre.org/maplibre-style-spec/expressions/#match whereas other listed "allowed" filter return boolean (eg in https://maplibre.org/maplibre-style-spec/expressions/#in) and all expect boolean https://maplibre.org/maplibre-style-spec/expressions/#all
Describe the bug
I am getting console error messages about filters which do work but still produce an error. I don't understand why they would be wrong or how to change them to prevent the error. I am merging filters in React (using react-map-gl) and only really have control over some of the filters but the external filters.
I can reproduce the error when adding a filter to the integration tests.
To Reproduce online
Steps to reproduce the behavior:
Error: layers.lane markings dashed.filter[2][0]: expected one of [==, !=, >, >=, <, <=, in, !in, all, any, none, has, !has, within], "match" foundTo Reproduce in tests
test/integration/style-spec/tests/filters.input.json{ "id": "mixing `match` with `==`", "type": "line", "source": "source", "source-layer": "source-layer", "filter": ["all", ["==", "Constructi", 1930], ["match", ["get", "Constructi"], [1930], true, false]] }npm run test-integrationExpected behavior
I expect
matchfilters to be valid filters the same as==Additional context
I was wondering it the issue is, that
matchhas a return type ofOutputTypeaccording to https://maplibre.org/maplibre-style-spec/expressions/#match whereas other listed "allowed" filter returnboolean(eginhttps://maplibre.org/maplibre-style-spec/expressions/#in) andallexpectbooleanhttps://maplibre.org/maplibre-style-spec/expressions/#all