summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--platform/android/src/geometry/lat_lng_bounds.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/platform/android/src/geometry/lat_lng_bounds.cpp b/platform/android/src/geometry/lat_lng_bounds.cpp
index d76ff5b365..2c6c45e3e7 100644
--- a/platform/android/src/geometry/lat_lng_bounds.cpp
+++ b/platform/android/src/geometry/lat_lng_bounds.cpp
@@ -19,7 +19,9 @@ mbgl::LatLngBounds LatLngBounds::getLatLngBounds(jni::JNIEnv& env, const jni::Ob
mbgl::LatLng sw = { bounds.Get(env, swLatField), bounds.Get(env, swLonField) };
mbgl::LatLng ne = { bounds.Get(env, neLatField), bounds.Get(env, neLonField) };
- sw.unwrapForShortestPath(ne);
+ if (ne.longitude() < sw.longitude()) {
+ sw = {sw.latitude(), sw.longitude() - util::DEGREES_MAX};
+ }
return mbgl::LatLngBounds::hull(sw, ne);
}