-
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
Support expressions in filters #5193
Conversation
db113f8
to
ba1fcf4
Compare
Will there be an expression for "object.hasOwnProperty()" or "array.indexOf() != -1". I'm living with a patched version since #4490 |
cefae06
to
3ce92e1
Compare
ba1fcf4
to
97d8b95
Compare
6f4a6c4
to
f6e716b
Compare
9e6acf8
to
1904c2d
Compare
@aparlato @nickidlugash updated with:
Still working on performance but it should be usable for developing styles. |
502dd15
to
9237f07
Compare
d68949a
to
9ee7362
Compare
9237f07
to
70d44e3
Compare
c658afb
to
e695aa5
Compare
e695aa5
to
adf56b0
Compare
Rebased onto master and reworked to take advantage of #5234 -- performance is much better, but evaluation performance is still about 8x compared to non-expressions-based filters: |
adf56b0
to
1987909
Compare
Back to being a bit worse after rebasing onto the recent updates on master (no-eval, etc.):
|
cc @mourner @jfirebaugh I was hoping the recent changes would mean we could stick with converting old-style filters, but looks like we should drop the conversion for now. |
https://github.com/mapbox/mapbox-gl-js/compare/expressions-filter-perf gets it down to 3.5-4x slower. |
Prepares for expression support
- Converts classic filters to expressions under the hood - Also accepts `{expression: [...]}`, requiring that the given expression be of type Boolean
dab6a1a
to
29a84cb
Compare
I merged the alternative without conversion, #5434. We'll hopefully be resurrecting the conversion code from this PR at some point, but closing for now. |
Closes #4077
Closes #4410
{expression: [...]}
, requiring that the givenexpression be of type Boolean
validation.test.js
cc @jfirebaugh @aparlato