summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsheem Mamoowala <Asheemm@gmail.com>2018-02-12 12:32:22 -0800
committerAsheem Mamoowala <asheem.mamoowala@mapbox.com>2018-02-12 13:29:22 -0800
commit560afaf1fb8f1cd20cef261da4992cd8a5478f88 (patch)
tree0f673946ab9708d5333ac12a1327b6fe80a97de7
parentcdaf90d2e75a8d8f6924caf657ca5ff3d1ae6adb (diff)
downloadqtlocation-mapboxgl-560afaf1fb8f1cd20cef261da4992cd8a5478f88.tar.gz
Cherry pick #11176 for Agua patch
-rw-r--r--include/mbgl/style/conversion/tileset.hpp2
-rw-r--r--test/style/conversion/tileset.test.cpp10
2 files changed, 11 insertions, 1 deletions
diff --git a/include/mbgl/style/conversion/tileset.hpp b/include/mbgl/style/conversion/tileset.hpp
index 6577e39576..6ec46aa7b6 100644
--- a/include/mbgl/style/conversion/tileset.hpp
+++ b/include/mbgl/style/conversion/tileset.hpp
@@ -12,7 +12,7 @@ struct Converter<Tileset> {
public:
bool validateLatitude(const double lat) const {
- return lat < 90 && lat > -90;
+ return lat <= 90 && lat >= -90;
}
template <class V>
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({