[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
This commit is contained in:
Osana Babayan
2018-02-19 10:25:11 -05:00
committed by GitHub
parent 9459cf6a91
commit 4be4b4bfed

View File

@@ -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()
);
}