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); }
inline optional<Value> toValue(const mbgl::android::Value& value) { if (value.isNull()) { return {}; } else if (value.isBool()) { return { value.toBool() }; } else if (value.isString()) { return { value.toString() }; } else if (value.isNumber()) { //Need to cast to a double here as the float is otherwise considered a bool... return { (double) value.toNumber() }; } else { return {}; } }
inline bool isUndefined(const mbgl::android::Value& value) { return value.isNull(); }