Files
MapLibreParticleLab/include/mln/style/expression/distance.hpp
Bart Louwers 2a8ebc4906 core: rename mbgl directories to mln (#4511)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-08-22 20:50:14 +02:00

48 lines
1.1 KiB
C++

#pragma once
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4244)
#pragma warning(disable : 4267)
#endif
#include <mapbox/cheap_ruler.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include <mln/style/expression/expression.hpp>
#include <mln/util/geojson.hpp>
namespace mln {
namespace style {
namespace expression {
class Distance final : public Expression {
public:
Distance(GeoJSON geoJSONSource_, Feature::geometry_type geometries_);
~Distance() override;
EvaluationResult evaluate(const EvaluationContext&) const override;
static ParseResult parse(const mln::style::conversion::Convertible&, ParsingContext&);
void eachChild(const std::function<void(const Expression&)>&) const noexcept override {}
bool operator==(const Expression& e) const noexcept override;
std::vector<std::optional<Value>> possibleOutputs() const override { return {std::nullopt}; }
mln::Value serialize() const override;
std::string getOperator() const override { return "distance"; }
private:
GeoJSON geoJSONSource;
Feature::geometry_type geometries;
};
} // namespace expression
} // namespace style
} // namespace mln