From 141e995806576364d185626176c1b993fc519291 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 28 Oct 2016 16:39:50 -0700 Subject: [core] Add support for data-driven styling --- include/mbgl/util/feature.hpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'include/mbgl/util/feature.hpp') diff --git a/include/mbgl/util/feature.hpp b/include/mbgl/util/feature.hpp index b72aa15ddd..4eeceda944 100644 --- a/include/mbgl/util/feature.hpp +++ b/include/mbgl/util/feature.hpp @@ -12,4 +12,21 @@ using PropertyMap = mapbox::geometry::property_map; using FeatureIdentifier = mapbox::geometry::identifier; using Feature = mapbox::geometry::feature; +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(); + }); +} + } // namespace mbgl -- cgit v1.2.1