-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filter ["all",["==",["geometry-type"],"Polygon"],["!",["has","lp"]]] is prohibited by validation #7730
Comments
Can you please set up a minimal test case (e.g. on JSFiddle) reproducing the issue? |
Hello @mourner. Sorry for bother. I did not reproduce that error. May be I got wrong with this expression. I tried to debug with only breakpoint in constructor of ValidationError. So first error was occured by filter expression I tried to fix expression: Yet another example: https://jsfiddle.net/goleon/k0uharpq/. Working expressions:
Not working expressions:
|
Any updates? |
Hello @mourner, do you have any news. Did you accept these things as bugs? |
I've looked through all the examples and I think you're just mixing legacy filter syntax and the new expression syntax in all of them. In the case of the last "not working" examples, the culprit is |
I just stumbled upon this trying to figure out why certain combinations of expressions weren't working. Is there any documentation that outlines legacy vs non-legacy? I looked in the docs for this but ended up not finding anything. |
mapbox-gl-js version:
0.51.0
browser:
all
Description:
We used filter
["all",["==","$type","Polygon"],["!has","lp"]]
it worked. But when this filter was wrapped by another filter some error threw. As I understand we are using deprecated syntax and it is root cause.I tried to fix filter to
["all",["==","$type","Polygon"],["!",["has","lp"]]]
and got errorexpected [==, !=, >, >=, <, <=, in, !in, all, any, none, has, !has], "!" found
You can say that this expression is using deprecated syntax
["==","$type","Polygon"]
. Ok I changed it to["all",["==",["get","$type"],"Polygon"],["!",["has","lp"]]]
and got errorstring expected, array found
(it is about["get","$type"]
).You can say that this expression is using deprecated syntax $type. Ok I tried to use "geometry-type", but got error again
I tried also
["all",["match",["geometry-type"],["Polygon"],true,false],["!",["has","lp"]]]
as in test in feature_filter.test.js but got errorexpected one of [==, !=, >, >=, <, <=, in, !in, all, any, none, has, !has], "match" found
It looks like test in feature_filter.test.js and comment
Could you say me, is it a bug?
I read documentation about "get", "has", "!", "==", "all", "geometry-type". Last expression seems correct, but It does not work:
Is it related to #7699, #7679 ?
The text was updated successfully, but these errors were encountered: