Fix TileJSON conversion to allow single point bounds

This commit is contained in:
Asheem Mamoowala
2018-08-02 11:35:38 -07:00
parent 1a840281b5
commit a5fea5febf
2 changed files with 12 additions and 2 deletions

View File

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