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

Translate more NSComparisonPredicate operators to filters #6244

Closed

Description

@1ec5

Per #6049 (comment) and #6049 (comment), we should translate a few more NSPredicate operators to mbgl::style::Filters to prevent information loss:

  • NSComparisonPredicate with an operator type of NSContainsPredicateOperatorType should be represented by an mbgl::style::InFilter with the right expression as the key and the left expression as the values.
  • NSComparisonPredicate with an operator type of NSBetweenPredicateOperatorType should be represented by an mbgl::style::AllFilter of mbgl::style::GreaterThanEqualsFilter (corresponding to the first element of the right expression) and mbgl::style::LessThanEqualsFilter (the second element of the right expression).
  • NSComparisonPredicate with an operator type of NSEqualToPredicateOperatorType and a right expression of nil should be represented by an mbgl::style::NotHasFilter.
  • NSComparisonPredicate with an operator type of NSNotEqualToPredicateOperatorType and a right expression of nil should be represented by an mbgl::style::HasFilter.
  • NSPredicate with a format of NSTRUEPREDICATE should be represented as an mbgl::style::AllFilter with no subfilters (same as an NSComparisonPredicate with a type of NSAndPredicateType).
  • NSPredicate with a format of NSFALSEPREDICATE should be represented as an mbgl::style::AnyFilter with no subfilters (same as an NSComparisonPredicate with a type of NSOrPredicateType).

/cc @frederoni @boundsj

Activity

  1. added
    iOS
    macOS
    release blocker
    on Sep 2, 2016
  2. added this to the ios-v3.4.0 milestone on Sep 2, 2016
  3. 1ec5 commented on Sep 7, 2016

    @1ec5
    ContributorAuthor

    Per #6248 (comment), if you try to get the predicate of an existing layer that has one of these operators (quite common in Streets), the SDK crashes.

  4. added
    beta blocker
    and removed
    release blocker
    on Sep 7, 2016
  5. self-assigned this
    on Sep 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

beta blockercrashiOSmacOSruntime styling

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions