summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Wojciechowski <lucas@mapbox.com>2018-04-23 14:57:13 -0700
committerAsheem Mamoowala <asheem.mamoowala@mapbox.com>2018-05-09 16:08:50 -0700
commitf88c3066dc8d1f3b1c251a0ed3d8bb51ee7c3d7d (patch)
tree8f730d04a8166d73e1b05d4e3df9dea3219440f8
parent5f69284f22e6639e1b86319944a5262892d1b599 (diff)
downloadqtlocation-mapboxgl-f88c3066dc8d1f3b1c251a0ed3d8bb51ee7c3d7d.tar.gz
Use convenience constructors in `glfw_view.cpp`
-rw-r--r--platform/glfw/glfw_view.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/platform/glfw/glfw_view.cpp b/platform/glfw/glfw_view.cpp
index 0c33d18c3e..81a9267369 100644
--- a/platform/glfw/glfw_view.cpp
+++ b/platform/glfw/glfw_view.cpp
@@ -621,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.
@@ -637,11 +640,7 @@ void GLFWView::toggle3DExtrusions(bool visible) {
extrusionLayer->setSourceLayer("building");
extrusionLayer->setMinZoom(15.0f);
- std::vector<std::unique_ptr<mbgl::style::expression::Expression>> args;
- args.push_back(std::make_unique<mbgl::style::expression::Literal>(mbgl::style::expression::Value(std::string("extrude"))));
- args.push_back(std::make_unique<mbgl::style::expression::Literal>(mbgl::style::expression::Value(std::string("true"))));
- mbgl::style::expression::ParsingContext parsingContext;
- extrusionLayer->setFilter(mbgl::style::Filter { std::move(*mbgl::style::expression::createCompoundExpression("filter-==", std::move(args), parsingContext)) });
+ extrusionLayer->setFilter(Filter(createCompoundExpression("filter-==", "extrude", "true", ParsingContext())) });
auto colorFn = mbgl::style::SourceFunction<mbgl::Color> { "height",
mbgl::style::ExponentialStops<mbgl::Color> {