[core] Add getSharedExpression to property expression
New method can be used for aggregating property expressions from multiple properties(layers) into single match / case expression.
This commit is contained in:
@@ -21,6 +21,11 @@ public:
|
||||
Range<float> getCoveringStops(const float, const float) const noexcept;
|
||||
const expression::Expression& getExpression() const noexcept;
|
||||
|
||||
// Can be used for aggregating property expressions from multiple
|
||||
// properties(layers) into single match / case expression. Method may
|
||||
// be removed if a better way of aggregation is found.
|
||||
std::shared_ptr<const expression::Expression> getSharedExpression() const noexcept;
|
||||
|
||||
bool useIntegerZoom = false;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -54,5 +54,9 @@ const expression::Expression& PropertyExpressionBase::getExpression() const noex
|
||||
return *expression;
|
||||
}
|
||||
|
||||
std::shared_ptr<const expression::Expression> PropertyExpressionBase::getSharedExpression() const noexcept {
|
||||
return expression;
|
||||
}
|
||||
|
||||
} // namespace style
|
||||
} // namespace mbgl
|
||||
|
||||
Reference in New Issue
Block a user