summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2018-08-07 18:02:43 +0300
committerBruno de Oliveira Abinader <bruno@mapbox.com>2018-08-07 18:31:59 +0300
commit0ec4a84c310f4bf95265939698d71f267af5802e (patch)
tree7545a31a8003115f0db720dac7ccbf6cbacdfbc7
parent1dabfe783d7871a6ea232d4da3981a42fbecb7ba (diff)
downloadqtlocation-mapboxgl-0ec4a84c310f4bf95265939698d71f267af5802e.tar.gz
Rename `EvaluationContext::heatmapDensity` to `colorRampParameter`
More generic name as the same class member is to be used by the linear gradient properties.
-rw-r--r--include/mbgl/style/expression/expression.hpp8
-rw-r--r--src/mbgl/style/expression/compound_expression.cpp4
-rw-r--r--src/mbgl/style/expression/expression.cpp4
3 files changed, 8 insertions, 8 deletions
diff --git a/include/mbgl/style/expression/expression.hpp b/include/mbgl/style/expression/expression.hpp
index 26124f6463..bfd1e08ee7 100644
--- a/include/mbgl/style/expression/expression.hpp
+++ b/include/mbgl/style/expression/expression.hpp
@@ -30,13 +30,13 @@ public:
EvaluationContext(float zoom_, GeometryTileFeature const * feature_) :
zoom(zoom_), feature(feature_)
{}
- EvaluationContext(optional<float> zoom_, GeometryTileFeature const * feature_, optional<double> heatmapDensity_) :
- zoom(std::move(zoom_)), feature(feature_), heatmapDensity(std::move(heatmapDensity_))
+ EvaluationContext(optional<float> zoom_, GeometryTileFeature const * feature_, optional<double> colorRampParameter_) :
+ zoom(std::move(zoom_)), feature(feature_), colorRampParameter(std::move(colorRampParameter_))
{}
optional<float> zoom;
GeometryTileFeature const * feature;
- optional<double> heatmapDensity;
+ optional<double> colorRampParameter;
};
template <typename T>
@@ -151,7 +151,7 @@ public:
Kind getKind() const { return kind; };
type::Type getType() const { return type; };
- EvaluationResult evaluate(optional<float> zoom, const Feature& feature, optional<double> heatmapDensity) const;
+ EvaluationResult evaluate(optional<float> zoom, const Feature& feature, optional<double> colorRampParameter) const;
/**
* Statically analyze the expression, attempting to enumerate possible outputs. Returns
diff --git a/src/mbgl/style/expression/compound_expression.cpp b/src/mbgl/style/expression/compound_expression.cpp
index 53ce91f0b7..4c476a3749 100644
--- a/src/mbgl/style/expression/compound_expression.cpp
+++ b/src/mbgl/style/expression/compound_expression.cpp
@@ -343,12 +343,12 @@ std::unordered_map<std::string, CompoundExpressionRegistry::Definition> initiali
});
define("heatmap-density", [](const EvaluationContext& params) -> Result<double> {
- if (!params.heatmapDensity) {
+ if (!params.colorRampParameter) {
return EvaluationError {
"The 'heatmap-density' expression is unavailable in the current evaluation context."
};
}
- return *(params.heatmapDensity);
+ return *(params.colorRampParameter);
});
define("has", [](const EvaluationContext& params, const std::string& key) -> Result<bool> {
diff --git a/src/mbgl/style/expression/expression.cpp b/src/mbgl/style/expression/expression.cpp
index d9dbbfa1d3..3c2580de04 100644
--- a/src/mbgl/style/expression/expression.cpp
+++ b/src/mbgl/style/expression/expression.cpp
@@ -28,9 +28,9 @@ public:
};
-EvaluationResult Expression::evaluate(optional<float> zoom, const Feature& feature, optional<double> heatmapDensity) const {
+EvaluationResult Expression::evaluate(optional<float> zoom, const Feature& feature, optional<double> colorRampParameter) const {
GeoJSONFeature f(feature);
- return this->evaluate(EvaluationContext(zoom, &f, heatmapDensity));
+ return this->evaluate(EvaluationContext(zoom, &f, colorRampParameter));
}
} // namespace expression