diff options
Diffstat (limited to 'include/mbgl/util/feature.hpp')
-rw-r--r-- | include/mbgl/util/feature.hpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/include/mbgl/util/feature.hpp b/include/mbgl/util/feature.hpp index 6080976945..5d8fe89e36 100644 --- a/include/mbgl/util/feature.hpp +++ b/include/mbgl/util/feature.hpp @@ -11,11 +11,25 @@ using Value = mapbox::base::Value; using NullValue = mapbox::base::NullValue; using PropertyMap = mapbox::base::ValueObject; using FeatureIdentifier = mapbox::feature::identifier; -using Feature = mapbox::feature::feature<double>; +using GeoJSONFeature = mapbox::feature::feature<double>; using FeatureState = mapbox::base::ValueObject; using FeatureStates = std::unordered_map<std::string, FeatureState>; // <featureID, FeatureState> using LayerFeatureStates = std::unordered_map<std::string, FeatureStates>; // <sourceLayer, FeatureStates> +class Feature : public GeoJSONFeature { +public: + std::string source; + std::string sourceLayer; + PropertyMap state; + + using GeometryType = mapbox::geometry::geometry<double>; + + Feature() = default; + Feature(const GeoJSONFeature& f) : GeoJSONFeature(f) {} + Feature(const GeometryType& geom_) : GeoJSONFeature(geom_) {} + Feature(GeometryType&& geom_) : GeoJSONFeature(std::move(geom_)) {} +}; + template <class T> optional<T> numericValue(const Value& value) { return value.match( |