diff options
author | Osana Babayan <32496536+osana@users.noreply.github.com> | 2018-02-19 10:25:11 -0500 |
---|---|---|
committer | Tobrun <tobrun@mapbox.com> | 2018-03-01 11:46:04 +0100 |
commit | 90cce8d9ce09ccbd828341e924b94caaf8f30899 (patch) | |
tree | f933ca3199285f264fc5747f0fdc70f826ab3c2c | |
parent | 4b32228cc2fbf7f6dc720edd32a17bc4c7f44071 (diff) | |
download | qtlocation-mapboxgl-90cce8d9ce09ccbd828341e924b94caaf8f30899.tar.gz |
[android] incorrect latlngBounds in the VisibleRegion with map is rotated
smallest bounding box for 4 points cannot (#11226)
be created using LatLngBounds.fromLatLngs()
as the order matters in that method and that does not work for rotated map
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Projection.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Projection.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Projection.java index 16c73b1ca5..ae559189ad 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Projection.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Projection.java @@ -104,11 +104,12 @@ public class Projection { LatLng bottomLeft = fromScreenLocation(new PointF(left, bottom)); return new VisibleRegion(topLeft, topRight, bottomLeft, bottomRight, - LatLngBounds.from( - topRight.getLatitude(), - topRight.getLongitude(), - bottomLeft.getLatitude(), - bottomLeft.getLongitude()) + new LatLngBounds.Builder() + .include(topRight) + .include(bottomLeft) + .include(bottomRight) + .include(topLeft) + .build() ); } |