TileJSON Bounds allows values inclusive of world extents
This commit is contained in:
committed by
Asheem Mamoowala
parent
94734441ce
commit
aefc3daeed
@@ -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 {
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user