-
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 contains, begins with, and ends with filter option for strings #4820
Comments
@anandthakker I read the Project Arbex but could not see this particular example. Can you please reference the syntax where this example is applied? |
@afischer did you manage to sort it out? |
See #6484, which tracks expression operators that aren't yet implemented. |
@anandthakker I don't understand. Is this feature implemented or not yet? I thought it is as Project Arbex is merged into master and you referenced it for this issue. |
It is not implemented yet. #6484 tracks expression features that are not yet implemented, but will be in the future |
Motivation
Often, layers will be filtered on a specific attribute. This attribute could be a string, for example, a restaurant name. The current filter API allows for extensive filtering of numerical values, but the ability to filter strings is limited to searching string equality and inequality.
Design
Maintaining the current
filter
API design, a few new selectors could be added. I would recommend following the CSS selector design, as it is widely known by web designers.Mock-Up
To begin, the API could support the
^=
,$=
, and*=
operators. This would give the ability to do the following:Concepts
The design is familiar to web designers already, and is in alignment with the current filter API design. Adding these features would not be breaking, and would be highly discoverable. The same terminology could be used to discuss these filters, and they would easily fit in with the filters already in place.
Implementation
Implementation would follow the precedent set for filters in the JS/C++ mapbox repos.
Further discussion would be needed regarding how/if these operators would support other types, such as numerics. Would numbers be treated as strings?
The text was updated successfully, but these errors were encountered: