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

# scale(scaleFactor, scaleCenter)

Returns a scaled map rectangle for a map location.

```
scale(scaleFactor: number, scaleCenter?: MapPointData): MapRect;
```

## Parameters

`scaleFactor`

The scale factor.

`scaleCenter`

The center map point for scaling.

## Discussion

The following example demonstrates scaling a `mapkit.MapRect` instance first with a common center, and then with a common origin:

```javascript
const mapRect = new mapkit.MapRect(0.1, 0.2, 0.3, 0.4);

// Scale a MapRect to be 2x the width and 2x the height of mapRect
// and have the same center.
const scaledRect = mapRect.scale(2);

// Same scale but this time mapRect and scaledRectAroundOrigin
// have the same origin rather than the same center.
const scaledRectAroundOrigin = mapRect.scale(2, new mapkit.MapPoint(mapRect.minX(), mapRect.maxX()));
```

---

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)