<!--
{
  "availability" : [
    "MapKit JS: 5.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MapKitJS",
  "identifier" : "/documentation/MapKitJS/MapSize",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "MapKit JS"
    ],
    "preciseIdentifier" : "cl/mapkit.MapSize"
  },
  "title" : "MapSize"
}
-->

# MapSize

A pair of values, in map units, that define the width and height of a rectangular area of a map projection.

```
class MapSize implements MapSizeData
```

## Overview

Use a map size to represent a subset of a map projection. Map units are a value from `0` to `1` that represent an interpolated location within the height or width of the full map projection.

## Topics

### Creating a map size

[`constructor(width?: number, height?: number);`](/documentation/MapKitJS/MapSize/MapSizeConstructor)

Creates an object containing the width and height of a projected coordinate span.

[`interface MapSizeData`](/documentation/MapKitJS/MapSizeData)

A plain object representation of dimensions in map units.

### Defining a map size

[`height: number;`](/documentation/MapKitJS/MapSize/height)

The height of the map size in map units.

[`width: number;`](/documentation/MapKitJS/MapSize/width)

The width of the map size in map units.

### Copying and comparing map sizes

[`copy(): MapSize;`](/documentation/MapKitJS/MapSize/copy)

Returns a copy of the map size object.

[`equals(anotherSize: MapSize): boolean;`](/documentation/MapKitJS/MapSize/equals)

Compares the sizes of two maps and indicates whether they’re of equal value.

### Instance Methods

[`toString(): string;`](/documentation/MapKitJS/MapSize/toString)

Returns a string representation of the map size object.

## Relationships

### Conforms To

[`MapSizeData`](/documentation/MapKitJS/MapSizeData)

---

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)