---
title: "setVisibleMapRect(_:animated:)"
framework: mapkit
role: symbol
role_heading: Instance Method
path: "mapkit/mkmapview/setvisiblemaprect(_:animated:)"
---

# setVisibleMapRect(_:animated:)

Changes the currently visible portion of the map, and optionally animates the change.

## Declaration

```swift
func setVisibleMapRect(_ mapRect: MKMapRect, animated animate: Bool)
```

## Parameters

- `mapRect`: The map rectangle to make visible in the map view.
- `animate`: Specify doc://com.apple.documentation/documentation/Swift/true if you want the map view to animate the transition to the new map rectangle or doc://com.apple.documentation/documentation/Swift/false if you want the map to center on the specified rectangle immediately.

## See Also

### Manipulating the visible portion of the map

- [region](mapkit/mkmapview/region.md)
- [setRegion(_:animated:)](mapkit/mkmapview/setregion(_:animated:).md)
- [centerCoordinate](mapkit/mkmapview/centercoordinate.md)
- [setCenter(_:animated:)](mapkit/mkmapview/setcenter(_:animated:).md)
- [showAnnotations(_:animated:)](mapkit/mkmapview/showannotations(_:animated:).md)
- [visibleMapRect](mapkit/mkmapview/visiblemaprect.md)
- [setVisibleMapRect(_:edgePadding:animated:)](mapkit/mkmapview/setvisiblemaprect(_:edgepadding:animated:).md)
