summaryrefslogtreecommitdiff
path: root/platform/android/src/style/conversion/latlngquad.hpp
blob: 9d1a83e164a6131752d1cf267cb7096c5ffcbfac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#pragma once

#include <mapbox/geojson.hpp>
#include <mbgl/style/conversion.hpp>
#include <mbgl/style/conversion/geojson.hpp>
#include <jni/jni.hpp>

namespace mbgl {
namespace style {
namespace conversion {

template <>
optional<std::array<LatLng, 4>> Converter<std::array<LatLng, 4>>::operator()(const mbgl::android::Value& value, Error& error) const {
    if (value.isNull() || !value.isArray()) {
        error = { "value cannot be converted to LatLng array" };
        return {};
    }

    return convert<GeoJSON>(value.toString(), error);
}

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