summaryrefslogtreecommitdiff
path: root/src/mbgl/style/conversion/position.cpp
blob: 702d250dbf1bea83163d492091c97ab7e94e781e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <mbgl/style/conversion/position.hpp>
#include <mbgl/style/conversion/constant.hpp>

#include <array>

namespace mbgl {
namespace style {
namespace conversion {

optional<Position> Converter<Position>::operator()(const Convertible& value, Error& error) const {
    optional<std::array<float, 3>> spherical = convert<std::array<float, 3>>(value, error);

    if (!spherical) {
        return {};
    }

    return Position(*spherical);
}

} // namespace conversion
} // namespace style
} // namespace mbgl