summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnand Thakker <github@anandthakker.net>2017-10-25 12:09:32 -0400
committerAnand Thakker <github@anandthakker.net>2017-10-25 12:09:32 -0400
commitf6d46fa268d224729ec313f8a88252e3f78ab0ce (patch)
tree1b405477bbb1af2b642f5dc4b8591d79fdd36032
parent66d10dd00b2dcd192e0d9eadf1443c9a20b64234 (diff)
downloadqtlocation-mapboxgl-f6d46fa268d224729ec313f8a88252e3f78ab0ce.tar.gz
Add sqrt, fixup to-string
-rw-r--r--src/mbgl/style/expression/compound_expression.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mbgl/style/expression/compound_expression.cpp b/src/mbgl/style/expression/compound_expression.cpp
index f538c64df4..2a9e973023 100644
--- a/src/mbgl/style/expression/compound_expression.cpp
+++ b/src/mbgl/style/expression/compound_expression.cpp
@@ -212,6 +212,7 @@ std::unordered_map<std::string, CompoundExpressionRegistry::Definition> initiali
define("to-string", [](const Value& value) -> Result<std::string> {
return value.match(
[](const Color& c) -> Result<std::string> { return c.stringify(); }, // avoid quoting
+ [](const std::string& s) -> Result<std::string> { return s; }, // avoid quoting
[](const auto& v) -> Result<std::string> { return stringify(v); }
);
});
@@ -360,6 +361,7 @@ std::unordered_map<std::string, CompoundExpressionRegistry::Definition> initiali
define("/", [](double a, double b) -> Result<double> { return a / b; });
define("%", [](double a, double b) -> Result<double> { return fmod(a, b); });
define("^", [](double a, double b) -> Result<double> { return pow(a, b); });
+ define("sqrt", [](double x) -> Result<double> { return sqrt(x); });
define("log10", [](double x) -> Result<double> { return log10(x); });
define("ln", [](double x) -> Result<double> { return log(x); });
define("log2", [](double x) -> Result<double> { return log2(x); });