<!--
{
  "availability" : [
    "MapKit JS: 5.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MapKitJS",
  "identifier" : "/documentation/MapKitJS/CoordinateRegion/equals",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "MapKit JS"
    ],
    "preciseIdentifier" : "instm/mapkit.CoordinateRegion/equals"
  },
  "title" : "equals(anotherRegion)"
}
-->

# equals(anotherRegion)

Returns a Boolean value indicating whether two regions are equal.

```
equals(anotherRegion: CoordinateRegion): boolean;
```

## Parameters

`anotherRegion`

The region to compare.

## Return Value

`true` if the region that `anotherRegion` specifies is equal to the calling [`CoordinateRegion`](/documentation/MapKitJS/CoordinateRegion); otherwise, `false`.

## Discussion

The following example shows how to determine whether a given region is equal to the region that’s displaying on the map.

```javascript
// Create a map.
const map = new mapkit.Map("my-map-element-id");

// Create a region named myRegion.
const coordinate = new mapkit.Coordinate(37.415, -122.048333); // latitude, longitude
const span = new mapkit.CoordinateSpan(.016, .016); // latitude delta, longitude delta
const myRegion = new mapkit.CoordinateRegion(coordinate, span);

// Check whether myRegion is equal to the current map region.
if (myRegion.equals(map.region))
   console.log("These two regions are equal.");
```

---

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)