<!--
{
  "availability" : [
    "MapKit JS: 5.23.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MapKitJS",
  "identifier" : "/documentation/MapKitJS/Map/setCameraBoundaryAnimated",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "MapKit JS"
    ],
    "preciseIdentifier" : "instm/mapkit.Map/setCameraBoundaryAnimated"
  },
  "title" : "setCameraBoundaryAnimated(cameraBoundary, animated)"
}
-->

# setCameraBoundaryAnimated(cameraBoundary, animated)

Changes the map’s camera boundary with an animated transition.

```
setCameraBoundaryAnimated(
    cameraBoundary: null | CoordinateRegionData | MapRectData,
    animated?: boolean,
): Map;
```

## Parameters

`mapRect`

This can be an instance of [`CoordinateRegion`](/documentation/MapKitJS/CoordinateRegion) or [`MapRect`](/documentation/MapKitJS/MapRect).

`animate`

A Boolean value that determines whether MapKit JS animates the visible area change. The default value is `true`.

## Return Value

Returns the map object.

## Discussion

By default, the change of boundary animates.

---

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)