Cherry pick #11176 for Agua patch

This commit is contained in:
Asheem Mamoowala
2018-02-12 12:32:22 -08:00
committed by Asheem Mamoowala
parent cdaf90d2e7
commit 560afaf1fb
2 changed files with 11 additions and 1 deletions

View File

@@ -12,7 +12,7 @@ struct Converter<Tileset> {
public:
bool validateLatitude(const double lat) const {
return lat < 90 && lat > -90;
return lat <= 90 && lat >= -90;
}
template <class V>

View File

@@ -52,6 +52,16 @@ TEST(Tileset, InvalidBounds) {
}
}
TEST(Tileset, ValidWorldBounds) {
Error error;
mbgl::optional<Tileset> converted = convertJSON<Tileset>(R"JSON({
"tiles": ["http://mytiles"],
"bounds": [-180, -90, 180, 90]
})JSON", error);
EXPECT_TRUE((bool) converted);
EXPECT_EQ(converted->bounds, LatLngBounds::hull({90, -180}, {-90, 180}));
}
TEST(Tileset, FullConversion) {
Error error;
Tileset converted = *convertJSON<Tileset>(R"JSON({