MapLibre Native Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
distance.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #ifdef _MSC_VER
4 #pragma warning(push)
5 #pragma warning(disable: 4244)
6 #pragma warning(disable: 4267)
7 #endif
8 
9 #include <mapbox/cheap_ruler.hpp>
10 
11 #ifdef _MSC_VER
12 #pragma warning(pop)
13 #endif
14 
16 #include <mbgl/util/geojson.hpp>
17 
18 namespace mbgl {
19 namespace style {
20 namespace expression {
21 
22 class Distance final : public Expression {
23 public:
24  Distance(GeoJSON geoJSONSource_, Feature::geometry_type geometries_);
25 
26  ~Distance() override;
27 
29 
31 
32  void eachChild(const std::function<void(const Expression&)>&) const override {}
33 
34  bool operator==(const Expression& e) const override;
35 
36  std::vector<std::optional<Value>> possibleOutputs() const override;
37 
38  mbgl::Value serialize() const override;
39  std::string getOperator() const override;
40 
41 private:
42  GeoJSON geoJSONSource;
43  Feature::geometry_type geometries;
44 };
45 
46 } // namespace expression
47 } // namespace style
48 } // namespace mbgl
std::string getOperator() const override
mbgl::Value serialize() const override
EvaluationResult evaluate(const EvaluationContext &) const override
bool operator==(const Expression &e) const override
static ParseResult parse(const mbgl::style::conversion::Convertible &, ParsingContext &)
void eachChild(const std::function< void(const Expression &)> &) const override
Definition: distance.hpp:32
Distance(GeoJSON geoJSONSource_, Feature::geometry_type geometries_)
std::vector< std::optional< Value > > possibleOutputs() const override
std::unique_ptr< Expression > string(std::unique_ptr< Expression >, std::unique_ptr< Expression > def=nullptr)
std::optional< std::unique_ptr< Expression > > ParseResult
Definition: actor.hpp:15
mapbox::base::Value Value
Definition: feature.hpp:11
mapbox::geojson::geojson GeoJSON
Definition: geojson.hpp:8