From 87a70c47930d79017816b8ac7ae1bb06eb6446c9 Mon Sep 17 00:00:00 2001 From: Lauren Budorick Date: Mon, 19 Jun 2017 14:27:43 -0700 Subject: [core] Enable property functions for line-width (#9250) --- include/mbgl/annotation/annotation.hpp | 2 +- include/mbgl/style/conversion/make_property_setters.hpp | 2 +- include/mbgl/style/data_driven_property_value.hpp | 2 +- include/mbgl/style/function/camera_function.hpp | 1 + include/mbgl/style/function/composite_function.hpp | 1 + include/mbgl/style/function/source_function.hpp | 1 + include/mbgl/style/layers/line_layer.hpp | 6 +++--- 7 files changed, 9 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/mbgl/annotation/annotation.hpp b/include/mbgl/annotation/annotation.hpp index 2a938fb755..96e06ca222 100644 --- a/include/mbgl/annotation/annotation.hpp +++ b/include/mbgl/annotation/annotation.hpp @@ -31,7 +31,7 @@ class LineAnnotation { public: ShapeAnnotationGeometry geometry; style::DataDrivenPropertyValue opacity { 1.0f }; - style::PropertyValue width { 1.0f }; + style::DataDrivenPropertyValue width { 1.0f }; style::DataDrivenPropertyValue color { Color::black() }; }; diff --git a/include/mbgl/style/conversion/make_property_setters.hpp b/include/mbgl/style/conversion/make_property_setters.hpp index 582ac7079f..eaea2e89dc 100644 --- a/include/mbgl/style/conversion/make_property_setters.hpp +++ b/include/mbgl/style/conversion/make_property_setters.hpp @@ -99,7 +99,7 @@ auto makePaintPropertySetters() { result["line-translate-transition"] = &setTransition; result["line-translate-anchor"] = &setProperty, &LineLayer::setLineTranslateAnchor>; result["line-translate-anchor-transition"] = &setTransition; - result["line-width"] = &setProperty, &LineLayer::setLineWidth>; + result["line-width"] = &setProperty, &LineLayer::setLineWidth>; result["line-width-transition"] = &setTransition; result["line-gap-width"] = &setProperty, &LineLayer::setLineGapWidth>; result["line-gap-width-transition"] = &setTransition; diff --git a/include/mbgl/style/data_driven_property_value.hpp b/include/mbgl/style/data_driven_property_value.hpp index 090ee0f59b..5d7c596363 100644 --- a/include/mbgl/style/data_driven_property_value.hpp +++ b/include/mbgl/style/data_driven_property_value.hpp @@ -49,7 +49,7 @@ public: bool isZoomConstant() const { return !value.template is>() && !value.template is>(); } - + template auto match(Ts&&... ts) const { return value.match(std::forward(ts)...); diff --git a/include/mbgl/style/function/camera_function.hpp b/include/mbgl/style/function/camera_function.hpp index 1b03cc8cf6..0fd5bcb078 100644 --- a/include/mbgl/style/function/camera_function.hpp +++ b/include/mbgl/style/function/camera_function.hpp @@ -35,6 +35,7 @@ public: } Stops stops; + bool useIntegerZoom = false; }; } // namespace style diff --git a/include/mbgl/style/function/composite_function.hpp b/include/mbgl/style/function/composite_function.hpp index c3de0726c0..43599cd333 100644 --- a/include/mbgl/style/function/composite_function.hpp +++ b/include/mbgl/style/function/composite_function.hpp @@ -135,6 +135,7 @@ public: std::string property; Stops stops; optional defaultValue; + bool useIntegerZoom = false; private: T evaluateFinal(const CoveringRanges& ranges, const Value& value, T finalDefaultValue) const { diff --git a/include/mbgl/style/function/source_function.hpp b/include/mbgl/style/function/source_function.hpp index f6601d9ea3..2872c63a64 100644 --- a/include/mbgl/style/function/source_function.hpp +++ b/include/mbgl/style/function/source_function.hpp @@ -53,6 +53,7 @@ public: std::string property; Stops stops; optional defaultValue; + bool useIntegerZoom = false; }; } // namespace style diff --git a/include/mbgl/style/layers/line_layer.hpp b/include/mbgl/style/layers/line_layer.hpp index c643ad110d..0b49690fd8 100644 --- a/include/mbgl/style/layers/line_layer.hpp +++ b/include/mbgl/style/layers/line_layer.hpp @@ -80,9 +80,9 @@ public: void setLineTranslateAnchorTransition(const TransitionOptions&); TransitionOptions getLineTranslateAnchorTransition() const; - static PropertyValue getDefaultLineWidth(); - PropertyValue getLineWidth() const; - void setLineWidth(PropertyValue); + static DataDrivenPropertyValue getDefaultLineWidth(); + DataDrivenPropertyValue getLineWidth() const; + void setLineWidth(DataDrivenPropertyValue); void setLineWidthTransition(const TransitionOptions&); TransitionOptions getLineWidthTransition() const; -- cgit v1.2.1