[android] #5034 - LatLngBounds Camera update not taking map padding in account
[android] #5034 - padding not being included in getVisibleBounds
This commit is contained in:
committed by
Tobrun Van Nuland
parent
102e62ae55
commit
034246e00a
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user