TileJSON Bounds allows values inclusive of world extents

This commit is contained in:
Asheem Mamoowala
2018-02-12 12:17:57 -08:00
committed by Asheem Mamoowala
parent 94734441ce
commit aefc3daeed
2 changed files with 11 additions and 1 deletions

View File

@@ -6,7 +6,7 @@ namespace style {
namespace conversion {
bool validateLatitude(const double lat) {
return lat < 90 && lat > -90;
return lat <= 90 && lat >= -90;
}
optional<Tileset> Converter<Tileset>::operator()(const Convertible& value, Error& error) const {

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({