*/
private void updateMaxExtent() {
if (targetMap.getMapModel().isInitialized()) {
Bbox targetMaxBounds = getOverviewMaxBounds();
MapView mapView = getMapModel().getMapView();
// 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);
super.onMapViewChanged(null);
// Immediately draw or remove the max extent rectangle:
setDrawTargetMaxExtent(drawTargetMaxExtent);
}