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

# setVisibleMapRect(_:edgePadding:animated:)

Changes the currently visible portion of the map, allowing you to specify additional space around the edges.

## Declaration

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

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

## Parameters

- `mapRect`: The map rectangle to make visible in the map view.
- `insets`: The amount of additional space (measured in screen points) to make visible around the specified rectangle.
- `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(_:animated:)](mapkit/mkmapview/setvisiblemaprect(_:animated:).md)
