1#pragma once
2
3#include <mbgl/util/optional.hpp>
4
5#include <mapbox/geometry/feature.hpp>
6
7namespace mbgl {
8
9using Value = mapbox::geometry::value;
10using NullValue = mapbox::geometry::null_value_t;
11using PropertyMap = mapbox::geometry::property_map;
12using FeatureIdentifier = mapbox::geometry::identifier;
13using Feature = mapbox::geometry::feature<double>;
14
15template <class T>
16optional<T> numericValue(const Value& value) {
17 return value.match(
18 [] (uint64_t t) {
19 return optional<T>(t);
20 },
21 [] (int64_t t) {
22 return optional<T>(t);
23 },
24 [] (double t) {
25 return optional<T>(t);
26 },
27 [] (auto) {
28 return optional<T>();
29 });
30}
31
32} // namespace mbgl
33

source code of qtlocation/src/3rdparty/mapbox-gl-native/include/mbgl/util/feature.hpp