diff options
author | Lloyd Sheng <i@lloydsheng.com> | 2018-03-27 13:47:53 +0800 |
---|---|---|
committer | Lloyd Sheng <i@lloydsheng.com> | 2018-03-27 13:47:53 +0800 |
commit | f8039e524e964ccd61721722d4f37460d29d7e5f (patch) | |
tree | 25c62c7153199330b6c0a3cc97767ee1463e02a5 /include/mbgl/style/function/source_function.hpp | |
parent | ef9bac737fdb6a07ca3b0260459367c776fbffbb (diff) | |
parent | 4f196d48ddfc3bb05dee1cdd032af170a6c53d67 (diff) | |
download | qtlocation-mapboxgl-upstream/llooyd.tar.gz |
Merge branch 'release-boba' into llooydupstream/llooyd
Diffstat (limited to 'include/mbgl/style/function/source_function.hpp')
-rw-r--r-- | include/mbgl/style/function/source_function.hpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/include/mbgl/style/function/source_function.hpp b/include/mbgl/style/function/source_function.hpp index d3caa90ee5..5b51d0bf81 100644 --- a/include/mbgl/style/function/source_function.hpp +++ b/include/mbgl/style/function/source_function.hpp @@ -30,15 +30,15 @@ public: IdentityStops<T>>>; SourceFunction(std::unique_ptr<expression::Expression> expression_) - : expression(std::move(expression_)) + : isExpression(true), + expression(std::move(expression_)) { assert(expression::isZoomConstant(*expression)); assert(!expression::isFeatureConstant(*expression)); } - SourceFunction(std::string property_, Stops stops_, optional<T> defaultValue_ = {}) - : property(std::move(property_)), - stops(std::move(stops_)), + SourceFunction(const std::string& property, const Stops& stops, optional<T> defaultValue_ = {}) + : isExpression(false), defaultValue(std::move(defaultValue_)), expression(stops.match([&] (const IdentityStops<T>&) { return expression::Convert::fromIdentityFunction(expression::valueTypeToExpressionType<T>(), property); @@ -67,15 +67,12 @@ public: } bool useIntegerZoom = false; + bool isExpression; const expression::Expression& getExpression() const { return *expression; } - // retained for compatibility with pre-expression function API - std::string property; - Stops stops; - optional<T> defaultValue; - private: + optional<T> defaultValue; std::shared_ptr<expression::Expression> expression; }; |