// Set the maxBounds on this map as well:
mapView.setMaxBounds(targetMaxBounds.buffer(targetMaxBounds.getWidth()));
// apply buffer
if (maxExtentIncreasePercentage > 0) {
targetMaxBounds = targetMaxBounds
.buffer(targetMaxBounds.getWidth() * maxExtentIncreasePercentage / 100);
}
// Then apply the map extent:
mapView.applyBounds(targetMaxBounds, MapView.ZoomOption.LEVEL_FIT);