summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOsana Babayan <32496536+osana@users.noreply.github.com>2018-02-19 10:25:11 -0500
committerGitHub <noreply@github.com>2018-02-19 10:25:11 -0500
commit4be4b4bfed627d6461ebabe581b63dd555516900 (patch)
tree2793aaee1749eec52b9fde6ce73a93de1caaa59d
parent9459cf6a91f98266f77960a8cf328cb9c0ec3034 (diff)
downloadqtlocation-mapboxgl-4be4b4bfed627d6461ebabe581b63dd555516900.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.java11
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()
);
}