diff options
author | “osana” <osana.babayan@mapbox.com> | 2018-11-27 17:51:36 -0500 |
---|---|---|
committer | “osana” <osana.babayan@mapbox.com> | 2018-11-27 17:51:36 -0500 |
commit | 6e5dffcdae6c2884dc0eae5a2ced15b92abcb3fe (patch) | |
tree | 85bdcfdb1bd977ee413bcd2f7f0592b365cbb8bd | |
parent | cca37e765bf9b853262783a6f7cc3d1a4c72957d (diff) | |
download | qtlocation-mapboxgl-upstream/osana-unwrapBeforeCallingCore.tar.gz |
do not unwrap For shortest Path, unwrap only if going over antimeridianupstream/osana-unwrapBeforeCallingCore
-rw-r--r-- | platform/android/src/geometry/lat_lng_bounds.cpp | 4 |
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); } |