From 6e5dffcdae6c2884dc0eae5a2ced15b92abcb3fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cosana=E2=80=9D?= Date: Tue, 27 Nov 2018 17:51:36 -0500 Subject: do not unwrap For shortest Path, unwrap only if going over antimeridian --- platform/android/src/geometry/lat_lng_bounds.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/android/src/geometry/lat_lng_bounds.cpp b/platform/android/src/geometry/lat_lng_bounds.cpp index d76ff5b36..2c6c45e3e 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); } -- cgit v1.2.3