Commit Graph

14 Commits

Author SHA1 Message Date
Bruno de Oliveira Abinader
bf8b24fa8d [build] Update to geometry v1.0.0 2018-11-13 17:28:26 +02:00
Konstantin Käfer
16e6ca86fa [core] add test for comparing filter name to id 2018-08-14 11:16:10 -07:00
Asheem Mamoowala
1d8664a2ae Keep original input for filters using legacy syntax. 2018-07-23 09:12:26 -07:00
Konstantin Käfer
ca5b36ba80 [core] fix crash when trying to parse legacy filters
Legacy filters aren't part of the style specification, but you can generate them by parsing a legacy filter in a stylesheet, and obtaining the parsed Filter and serializing it.
2018-06-29 12:14:51 -07:00
Anand Thakker
2da57bd157 [core] Fix crash due to mixing legacy filters and expressions (#12065)
* Fix crash due to mixing legacy filters and expressions

In some cases, (invalid) nested filters that used a mix of legacy filter
syntax and expression syntax caused a crash due to a failure to
propagate parsing errors from deeper within the filter expression.

These errors went undetected in part because these conversion functions
returned unique_ptr<Expression> values (or vectors thereof), using
{nullptr} to represent a parsing error, but the core expression classes
expect unique_ptr<Expression> that are never null.

This changes over to using expression::ParseResult (aka
optional<unique_ptr<Expression>>), to represent conversion failure
the same way we do in the rest of the expression system.

* Fix clang 3.8 / gcc 4.9 issue
2018-06-06 11:26:08 -04:00
Lucas Wojciechowski
a4e2c1af1f [core] Convert "legacy" filters directly into expressions (#11610)
Ports the specialized filter-* expressions from GL JS, adding them to src/mbgl/style/expression/compound_expression.cpp
2018-05-10 12:37:14 -07:00
Anand Thakker
352d63d2ce Don't enforce ["zoom"] constraints for filters (#11672)
* Don't enforce ["zoom"] constraints for filters

Fixes #11594

* Add a couple of comments

* Fix ambiguous constructor call

* ParsingContext(optional<Type>) => ParsingContext(Type)
2018-04-12 16:02:48 -04:00
Lucas Wojciechowski
8a3deab733 [core] Add expression filter support (#11251)
* WIP

* WIP

* WIP

* Remove Filter::operator()(const Feature&)

* WIP

* WIP

* WIP

* WIP

* Hook up expression filter evaluator

* Replace `shared_ptr` with &reference

* Fill in implementation of `void operator()(const ExpressionFilter&)`

* Fix failing tests

* Switch back to a shared_ptr per chat with @anandthakker

* Fix benchmark compilation

* Shot in the dark to fix CI

* Shot in the dark to fix CI (part 2)

* Shot in the dark to fix CI (part 3)

* 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

* Remove bool Filter::operator()(const GeometryTileFeature&) const

*  Ensure the map zoom is passed into filtering operations wherever applicable

* Add expression filter tests

* Addressed PR feedback

* Implement `NSPredicate *operator()(mbgl::style::ExpressionFilter filter)`

* Fix formatting& nit
2018-03-09 11:12:14 +01:00
John Firebaugh
12f78fc874 [core] Use convertJSON instead of RapidJSON directly 2017-10-16 17:14:19 -07:00
Bruno de Oliveira Abinader
37046938da [tidy] modernize-raw-string-literal 2017-05-12 18:07:36 +03:00
John Firebaugh
d7227e13a7 [all] Replace Result<T> with optional<T> plus out Error parameter 2017-03-23 13:31:13 -07:00
John Firebaugh
af75736857 [core] Avoid unnecessary convert template instantiations 2017-03-09 10:31:21 -08:00
Konstantin Käfer
4fe071b518 [build] upgrade to variant 1.1.4 and dependencies 2016-11-28 18:02:00 +01:00
Konstantin Käfer
3f3fc7b772 [test] add .test.cpp suffix to test case files 2016-09-28 16:34:22 +02:00