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

Add predicate property to MGLStyleLayer #5973

Closed
1ec5 opened this issue Aug 12, 2016 · 1 comment
Closed

Add predicate property to MGLStyleLayer #5973

1ec5 opened this issue Aug 12, 2016 · 1 comment
Assignees
Labels
iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS runtime styling
Milestone

Comments

@1ec5
Copy link
Contributor

1ec5 commented Aug 12, 2016

MGLStyleLayer should have a predicate property that translates to a filter in mbgl. The developer would create a predicate like so:

[NSPredicate predicateWithFormat:@"name == 'USA'"]

The returned value would be an instance of NSComparisonPredicate with leftExpression.keyPath being name, predicateOperatorType being NSEqualToPredicateOperatorType, and rightExpression.constantValue being USA. We’d translate that into an mbgl::style::EqualsFilter.

Here’s a full correspondence between NSPredicate types and style specification filter forms.

/cc @frederoni @incanus

@1ec5 1ec5 added iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS labels Aug 12, 2016
@1ec5 1ec5 added this to the ios-v3.4.0 milestone Aug 12, 2016
@boundsj
Copy link
Contributor

boundsj commented Sep 2, 2016

This was completed by @frederoni in #6049 🎉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS runtime styling
Projects
None yet
Development

No branches or pull requests

4 participants