[android] #5034 - LatLngBounds Camera update not taking map padding in account

[android] #5034 - padding not being included in getVisibleBounds
This commit is contained in:
Tobrun
2016-05-17 09:54:04 +02:00
committed by Tobrun Van Nuland
parent 102e62ae55
commit 034246e00a
4 changed files with 23 additions and 7 deletions

View File

@@ -68,10 +68,12 @@ public class LatLngBoundsActivity extends AppCompatActivity {
.include(LOS_ANGELES)
.build();
// And padding
int padding = (int) getResources().getDimension(R.dimen.coordinatebounds_margin);
// Add map padding
int mapPadding = (int) getResources().getDimension(R.dimen.fab_margin);
mapboxMap.setPadding(mapPadding, mapPadding, mapPadding, mapPadding);
// Move camera to the bounds with padding
// Move camera to the bounds with added padding
int padding = (int) getResources().getDimension(R.dimen.coordinatebounds_margin);
mapboxMap.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, padding));
// Call mapboxMap.getProjection().getVisibleRegion().latLngBounds to retrieve the bounds