diff options
author | Asheem Mamoowala <Asheemm@gmail.com> | 2018-02-12 12:17:57 -0800 |
---|---|---|
committer | Asheem Mamoowala <asheem.mamoowala@mapbox.com> | 2018-02-12 16:56:20 -0800 |
commit | aefc3daeeddaa597be3b10f5384cd3503099e2ee (patch) | |
tree | 48079657bd3b382b66d860fefc05b0609e90d127 | |
parent | 94734441ce34fa8cfaa2a5148ece676d75610e69 (diff) | |
download | qtlocation-mapboxgl-aefc3daeeddaa597be3b10f5384cd3503099e2ee.tar.gz |
TileJSON Bounds allows values inclusive of world extents
-rw-r--r-- | src/mbgl/style/conversion/tileset.cpp | 2 | ||||
-rw-r--r-- | test/style/conversion/tileset.test.cpp | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/mbgl/style/conversion/tileset.cpp b/src/mbgl/style/conversion/tileset.cpp index 6e559c0cac..88e78b1a83 100644 --- a/src/mbgl/style/conversion/tileset.cpp +++ b/src/mbgl/style/conversion/tileset.cpp @@ -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 { diff --git a/test/style/conversion/tileset.test.cpp b/test/style/conversion/tileset.test.cpp index 8002cd038f..9487277cca 100644 --- a/test/style/conversion/tileset.test.cpp +++ b/test/style/conversion/tileset.test.cpp @@ -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({ |