<!--
{
  "availability" : [
    "iOS: 3.0.0 -",
    "iPadOS: 3.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 9.2.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MapKit",
  "identifier" : "/documentation/MapKit/MKMapView/setCenter(_:animated:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "MapKit"
    ],
    "preciseIdentifier" : "c:objc(cs)MKMapView(im)setCenterCoordinate:animated:"
  },
  "title" : "setCenter(_:animated:)"
}
-->

# setCenter(_:animated:)

Changes the center coordinate of the map, and optionally animates the change.

```
func setCenter(_ coordinate: CLLocationCoordinate2D, animated: Bool)
```

## Parameters

`coordinate`

The new center coordinate for the map.

`animated`

Specify <doc://com.apple.documentation/documentation/Swift/true> if you want the map view to scroll to the new location or <doc://com.apple.documentation/documentation/Swift/false> if you want the map to display the new location immediately.

## Discussion

Changing the center coordinate centers the map on the new coordinate without changing the current zoom level. It also updates the value in the [`region`](/documentation/MapKit/MKMapView/region) property to reflect the new center coordinate and the new span values needed to maintain the current zoom level.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)