summaryrefslogtreecommitdiff
path: root/src/mbgl/style/conversion/position.cpp
blob: df6c868ee827b28c692a2fe49f4e221a4f63b4ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <mbgl/style/conversion/position.hpp>
#include <mbgl/style/conversion/constant.hpp>
#include <mbgl/style/conversion_impl.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 nullopt;
    }

    return Position(*spherical);
}

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