From a4e2c1af1fd83b22ef4ee57ab19a15616224f8b8 Mon Sep 17 00:00:00 2001 From: Lucas Wojciechowski Date: Thu, 10 May 2018 12:37:14 -0700 Subject: [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 --- platform/glfw/glfw_view.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'platform/glfw/glfw_view.cpp') diff --git a/platform/glfw/glfw_view.cpp b/platform/glfw/glfw_view.cpp index 3988419265..362269b8e4 100644 --- a/platform/glfw/glfw_view.cpp +++ b/platform/glfw/glfw_view.cpp @@ -7,6 +7,8 @@ #include #include #include +#include +#include #include #include #include @@ -619,6 +621,9 @@ void GLFWView::onDidFinishLoadingStyle() { } void GLFWView::toggle3DExtrusions(bool visible) { + using namespace mbgl::style; + using namespace mbgl::style::expression; + show3DExtrusions = visible; // Satellite-only style does not contain building extrusions data. @@ -634,7 +639,9 @@ void GLFWView::toggle3DExtrusions(bool visible) { auto extrusionLayer = std::make_unique("3d-buildings", "composite"); extrusionLayer->setSourceLayer("building"); extrusionLayer->setMinZoom(15.0f); - extrusionLayer->setFilter(mbgl::style::EqualsFilter { "extrude", { std::string("true") } }); + + ParsingContext parsingContext; + extrusionLayer->setFilter(Filter(createCompoundExpression("filter-==", createLiteral("extrude"), createLiteral("true"), parsingContext))); auto colorFn = mbgl::style::SourceFunction { "height", mbgl::style::ExponentialStops { -- cgit v1.2.1