#pragma once #include #include #include namespace mbgl { using Value = mapbox::feature::value; using NullValue = mapbox::feature::null_value_t; using PropertyMap = mapbox::feature::property_map; using FeatureIdentifier = mapbox::feature::identifier; using Feature = mapbox::feature::feature; using FeatureState = PropertyMap; using FeatureStates = std::unordered_map; // using LayerFeatureStates = std::unordered_map; // template optional numericValue(const Value& value) { return value.match( [] (uint64_t t) { return optional(t); }, [] (int64_t t) { return optional(t); }, [] (double t) { return optional(t); }, [] (auto) { return optional(); }); } inline optional featureIDtoString(const FeatureIdentifier& id) { if (id.is()) { return nullopt; } return id.match( [](const std::string& value_) { return value_; }, [](uint64_t value_) { return util::toString(value_); }, [](int64_t value_) { return util::toString(value_); }, [](double value_) { return util::toString(value_); }, [](const auto&) -> optional { return nullopt; }); } } // namespace mbgl