summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsheem Mamoowala <Asheemm@gmail.com>2018-02-12 12:17:57 -0800
committerAsheem Mamoowala <Asheemm@gmail.com>2018-02-12 12:27:30 -0800
commitf4f3bfd68304f82904d2acaf471810fe2cb6b508 (patch)
tree1f15f17b42e6d13ff3d4dd123d9a484b1162a63b
parentf0b12d581a266f8877fba32be97fe82561bb2392 (diff)
downloadqtlocation-mapboxgl-upstream/fix-tilejson-bounds.tar.gz
TileJSON Bounds allows values inclusive of world extentsupstream/fix-tilejson-bounds
-rw-r--r--src/mbgl/style/conversion/tileset.cpp2
-rw-r--r--test/style/conversion/tileset.test.cpp10
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({