diff options
author | zmiao <miao.zhao@mapbox.com> | 2020-02-12 12:28:05 +0200 |
---|---|---|
committer | zmiao <miao.zhao@mapbox.com> | 2020-02-12 17:35:18 +0200 |
commit | 759dfe8bf630b30173880551db70f54c43697b98 (patch) | |
tree | 504c1da77f53aa33dda0e71f3276a5491e1f3135 /include | |
parent | c57af518426acc99fada188990e831cacc8170fe (diff) | |
download | qtlocation-mapboxgl-759dfe8bf630b30173880551db70f54c43697b98.tar.gz |
[core] Support [within expression] with layout property
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/style/property_expression.hpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/include/mbgl/style/property_expression.hpp b/include/mbgl/style/property_expression.hpp index 7439ac9ca1..8502bfefbd 100644 --- a/include/mbgl/style/property_expression.hpp +++ b/include/mbgl/style/property_expression.hpp @@ -73,6 +73,20 @@ public: finalDefaultValue); } + T evaluate(const GeometryTileFeature& feature, const CanonicalTileID& canonical, T finalDefaultValue) const { + return evaluate(expression::EvaluationContext(&feature).withCanonicalTileID(&canonical), finalDefaultValue); + } + + T evaluate(const GeometryTileFeature& feature, + const std::set<std::string>& availableImages, + const CanonicalTileID& canonical, + T finalDefaultValue) const { + return evaluate(expression::EvaluationContext(&feature) + .withAvailableImages(&availableImages) + .withCanonicalTileID(&canonical), + finalDefaultValue); + } + T evaluate(float zoom, const GeometryTileFeature& feature, T finalDefaultValue) const { return evaluate(expression::EvaluationContext(zoom, &feature), finalDefaultValue); } @@ -85,6 +99,25 @@ public: finalDefaultValue); } + T evaluate(float zoom, + const GeometryTileFeature& feature, + const std::set<std::string>& availableImages, + const CanonicalTileID& canonical, + T finalDefaultValue) const { + return evaluate(expression::EvaluationContext(zoom, &feature) + .withAvailableImages(&availableImages) + .withCanonicalTileID(&canonical), + finalDefaultValue); + } + + T evaluate(float zoom, + const GeometryTileFeature& feature, + const CanonicalTileID& canonical, + T finalDefaultValue) const { + return evaluate(expression::EvaluationContext(zoom, &feature).withCanonicalTileID(&canonical), + finalDefaultValue); + } + T evaluate(float zoom, const GeometryTileFeature& feature, const FeatureState& state, T finalDefaultValue) const { assert(!isFeatureConstant()); return evaluate(expression::EvaluationContext(zoom, &feature, &state), finalDefaultValue); |