Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Add expression filter support #10720

Closed
tobrun opened this issue Dec 16, 2017 · 3 comments
Closed

Add expression filter support #10720

tobrun opened this issue Dec 16, 2017 · 3 comments
Assignees
Labels
Android Mapbox Maps SDK for Android Core The cross-platform C++ core, aka mbgl feature

Comments

@tobrun
Copy link
Member

tobrun commented Dec 16, 2017

Tailwork of expression integration in #10654. Capturing from #10654 (comment) that expression support for core needs to be implemented first.

@tobrun tobrun added the Android Mapbox Maps SDK for Android label Dec 16, 2017
@tobrun tobrun added this to the android-v6.0.0 milestone Dec 16, 2017
@tobrun tobrun added feature Core The cross-platform C++ core, aka mbgl labels Dec 16, 2017
@1ec5
Copy link
Contributor

1ec5 commented Jan 6, 2018

Per #7978 (comment), this task includes adding a getFilter() accessor to Layer.

This was referenced Jan 6, 2018
@anandthakker
Copy link
Contributor

anandthakker commented Feb 6, 2018

Outline of an implementation approach:

  1. Allow expressions to be used as filters.
    a. Add an ExpressionFilter type to include/mbgl/style/filter.hpp that holds an mbgl::style::Expression object (of type mbgl::style::expression::type::Boolean)
    b. Add a corresponding overload for mbgl::style::FilterEvaluator
    c. In src/mbgl/style/conversion/filter.cpp, add a port of isExpressionFilter and use it to decide in Converter<Filter>::operator() whether to parse the incoming JSON as an ExpressionFilter or one of the legacy filter types.
  2. Convert "legacy" filters directly into expressions.
    a. Port the specialized filter-* expressions from GL JS, adding them to src/mbgl/style/expression/compound_expression.cpp.
    b. Update src/mbgl/style/conversion/filter.cpp to always convert incoming JSON values to an ExpressionFilter (using the filter-* types as needed for legacy syntax)
    c. Rewrite/simplify include/mbgl/style/filter.hpp and mbgl::style::FilterEvaluator, removing all the different *Filter types and the Filter variant and renaming ExpressionFilter to Filter.

@1ec5
Copy link
Contributor

1ec5 commented Feb 7, 2018

Once the core changes in #10720 (comment) are complete, we can remove the FilterEvaluator from NSExpression+MGLAdditions.mm and round out a few remaining NSPredicate-specific operators for #11013.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android Core The cross-platform C++ core, aka mbgl feature
Projects
None yet
Development

No branches or pull requests

4 participants