<!--
{
  "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",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "MapKit"
    ],
    "preciseIdentifier" : "c:objc(cs)MKMapView"
  },
  "title" : "MKMapView"
}
-->

# MKMapView

An embeddable map interface, similar to the one that the Maps app provides.

```
class MKMapView
```

## Overview

Use this class as-is to display map information and to manipulate the map contents from your app. The map view supports several display styles, including the [`MKStandardMapConfiguration`](/documentation/MapKit/MKStandardMapConfiguration) that provides rich 2D and 3D presentations, an [`MKHybridMapConfiguration`](/documentation/MapKit/MKHybridMapConfiguration) that provides a hybrid satellite map presentation, and [`MKImageryMapConfiguration`](/documentation/MapKit/MKImageryMapConfiguration) that provides an imagery-based map presentation. Each of these map configurations support customization properties that refine specific elements of the map’s presentation.

You can center the map on specific coordinates, specify the size of the area you want to display, and annotate the map with custom information. When you initialize a map view, you specify the initial region for that map to display by setting the [`region`](/documentation/MapKit/MKMapView/region) property of the map. MapKit defines a region by a center point and a horizontal and vertical distance, referred to as the *span*. The *span* defines how much of the map is visible, and is also how you set the zoom level. For example, specifying a large span results in the user seeing a wide geographical area at a low zoom level, whereas specifying a small span results in a more narrow geographical area and a higher zoom level.

In addition to setting the span programmatically, the `MKMapView` class supports many standard interactions for changing the position and zoom level of the map. In particular, map views support flick and pinch gestures for scrolling around the map and zooming in and out. The map view enables support for these gestures by default. You can enable and disable them using the [`isScrollEnabled`](/documentation/MapKit/MKMapView/isScrollEnabled) and [`isZoomEnabled`](/documentation/MapKit/MKMapView/isZoomEnabled) properties.

You can also use projected map coordinates instead of regions to specify some values. When you project the curved surface of the globe onto a flat surface, you get a two-dimensional version of a map where longitude lines appear to be parallel. To specify locations and distances, you use the [`MKMapPoint`](/documentation/MapKit/MKMapPoint), [`MKMapSize`](/documentation/MapKit/MKMapSize), and [`MKMapRect`](/documentation/MapKit/MKMapRect) data types.

Don’t subclass the `MKMapView` class itself. You can get information about the map view’s behavior by providing a delegate object. The map view calls the methods of your custom delegate to let it know about changes in the map status and to coordinate the display of custom annotations. The delegate object can be any object in your app as long as it conforms to the [`MKMapViewDelegate`](/documentation/MapKit/MKMapViewDelegate) protocol. For more information about implementing the delegate object, see [`MKMapViewDelegate`](/documentation/MapKit/MKMapViewDelegate).

In macOS 10.14 and later, you can apply a light or dark appearance to your maps by modifying the <doc://com.apple.documentation/documentation/AppKit/NSAppearanceCustomization/appearance> property of your map view (or one of its ancestor views). Even if you specify a custom appearance, users can use the Maps app to force all maps to adopt a light appearance. Use the map view’s <doc://com.apple.documentation/documentation/AppKit/NSAppearanceCustomization/effectiveAppearance> property to determine the actual appearance of your map. For information about how to set view appearances, see <doc://com.apple.documentation/documentation/AppKit/choosing-a-specific-appearance-for-your-macos-app>.

### Annotating the map

The `MKMapView` class supports the ability to annotate the map with custom information. Because a map may have large numbers of annotations, map views differentiate between the annotation objects MapKit uses to manage the annotation data and the view objects for presenting that data on the map.

An *annotation object* is any object that conforms to the [`MKAnnotation`](/documentation/MapKit/MKAnnotation) protocol. Typically, you implement annotation objects using existing classes in your app’s data model. This allows you to manipulate the annotation data directly, but still make it available to the map view. Each annotation object contains information about the annotation’s location on the map, along with descriptive information that the map can display in a callout.

An *annotation view*,_ _which is an instance of the [`MKAnnotationView`](/documentation/MapKit/MKAnnotationView) class, handles the presentation of annotation objects on the screen. An annotation view is responsible for presenting the annotation data in a way that makes sense. For example, the Maps app uses a marker icon to denote specific points of interest on a map. The MapKit framework offers the [`MKMarkerAnnotationView`](/documentation/MapKit/MKMarkerAnnotationView) class for similar annotations in your own apps. You can also create annotation views that cover larger portions of the map.

Because the map view needs annotation views only when they’re onscreen, the `MKMapView` class provides a mechanism for queueing annotation views that aren’t in use. The map view detaches annotation views with a reuse identifier and queues them internally when they move offscreen. This feature improves memory use by keeping only a small number of annotation views in memory at once, and by recycling the views you do have. It also improves scrolling performance by alleviating the need to create new views while the map is scrolling.

When configuring your map interface, be sure to add all of your annotation objects right away. The map view uses the coordinate data in each annotation object to determine when the corresponding annotation view needs to appear onscreen. When an annotation moves onscreen, the map view asks its delegate to create a corresponding annotation view. If your app has different types of annotations, it can define different annotation view classes to represent each type.

### Adding overlays to the map

You can use overlays to layer content over a wide portion of the map. An *overlay* object is any object that conforms to the [`MKOverlay`](/documentation/MapKit/MKOverlay) protocol. An overlay object is a data object that contains the points that specify the shape and size of the overlay and its location on the map. Overlays can represent shapes like circles, rectangles, multisegment lines, and simple or complex polygons. You can also define your own custom overlays to represent other shapes.

*Overlay renderer* objects, which are instances of the [`MKOverlayRenderer`](/documentation/MapKit/MKOverlayRenderer) class, handle the presentation of an overlay. The job of the renderer is to draw the overlay’s content onto the screen when the map view requests it. For example, if you have a simple overlay that represents a bus route, you can use a polyline renderer to draw the line segments that trace the route of the bus. You can also define a custom renderer that draws both the bus route and icons at the location of each bus stop. When specifying overlays, you can add them to specific levels of the map, which tells the map view to render them above or below other types of map content.

When configuring your map interface, you can add overlay objects at any time. The map view uses the data in each overlay object to determine when the corresponding overlay view needs to appear onscreen. When an overlay moves onscreen, the map view asks its delegate to create a corresponding overlay renderer.

### Adding points of interest to the map

In iOS16 and macOS 13, and later, you can configure the map view to allow people to interact with a wide variety of points of interest (POIs) the map displays. These are instances of the [`MKMapFeatureAnnotation`](/documentation/MapKit/MKMapFeatureAnnotation) class, and cover a wide variety of elements visible on the map, including:

- Points of interest, such as museums, cafes, parks, and schools.
- Territorial boundaries, such as national borders, state boundaries, and neighborhoods.
- Features on the Earth’s surface, such as mountain ranges, rivers, and ocean basins.

You can control which features a person can interact with by configuring one of the [`MKMapConfiguration`](/documentation/MapKit/MKMapConfiguration) subclasses that defines the map’s presentation. Create an `MKMapConfiguration` with a set of [`MKMapFeatureOptions`](/documentation/MapKit/MKMapFeatureOptions) that describe the categories of POIs the map responds to. To further refine the specific kinds of points of interest the map display presents, use an [`MKPointOfInterestFilter`](/documentation/MapKit/MKPointOfInterestFilter).

When a person interacts with a specific POI, the framework calls your delegate object with one of the [`MKMapViewDelegate`](/documentation/MapKit/MKMapViewDelegate) protocol methods, depending on whether the person selects or deselects a specific POI. These methods give your app a chance to respond to the selection or deselection of an element. Depending on the kind of element, you can decide whether you want to customize the display characteristics in the case of a POI, or in the case of territories or geographic map features, you can create custom interactions to display information.

### Adding Look Around views to the map

iOS16 and macOS 13, and later, support the inclusion of a Look Around view within the map view. Look Around allows people to explore the environment at street level. You request a Look Around view by creating an [`MKLookAroundSceneRequest`](/documentation/MapKit/MKLookAroundSceneRequest) with either an [`MKMapItem`](/documentation/MapKit/MKMapItem) or a <doc://com.apple.documentation/documentation/CoreLocation/CLLocationCoordinate2D>, and if there’s Look Around imagery available for the specified location, the framework returns an [`MKLookAroundScene`](/documentation/MapKit/MKLookAroundScene) for you to display using an [`MKLookAroundViewController`](/documentation/MapKit/MKLookAroundViewController).

## Topics

### Configuring the map appearance

[`preferredConfiguration`](/documentation/MapKit/MKMapView/preferredConfiguration)

The characteristics of the map view, including the map type and features the map displays.

[`pitchButtonVisibility`](/documentation/MapKit/MKMapView/pitchButtonVisibility)

A value that indicates whether the map’s pitch button is visible.

[`showsUserTrackingButton`](/documentation/MapKit/MKMapView/showsUserTrackingButton)

A Boolean value that indicates whether the map displays the user tracking button.

[`MKMapConfiguration`](/documentation/MapKit/MKMapConfiguration)

An abstract class that represents the shared elements of map configurations.

[`MKStandardMapConfiguration`](/documentation/MapKit/MKStandardMapConfiguration)

The class that represents the default map presentation, which is a street map that shows the position of all roads and some road names.

[`MKHybridMapConfiguration`](/documentation/MapKit/MKHybridMapConfiguration)

The class that represents a satellite image of the area with road and road name information layers on top.

[`MKImageryMapConfiguration`](/documentation/MapKit/MKImageryMapConfiguration)

The class that represents an imagery-based map presentation, such as one using satellite imagery.

### Customizing the map view behavior

[`delegate`](/documentation/MapKit/MKMapView/delegate)

The receiver’s delegate.

[`MKMapViewDelegate`](/documentation/MapKit/MKMapViewDelegate)

Optional methods that you use to receive map-related update messages.

### Accessing map properties

[`MKMapType`](/documentation/MapKit/MKMapType)

The type of map to display.

[`isZoomEnabled`](/documentation/MapKit/MKMapView/isZoomEnabled)

A Boolean value that determines whether the user may use pinch gestures to zoom in and out of the map.

[`isScrollEnabled`](/documentation/MapKit/MKMapView/isScrollEnabled)

A Boolean value that determines whether the user may scroll around the map.

[`isPitchEnabled`](/documentation/MapKit/MKMapView/isPitchEnabled)

A Boolean value that indicates whether the map uses the camera’s pitch information.

[`isRotateEnabled`](/documentation/MapKit/MKMapView/isRotateEnabled)

A Boolean value that indicates whether the map uses the camera’s heading information.

[`mapType`](/documentation/MapKit/MKMapView/mapType)

The type of data the map view displays.

### Manipulating the visible portion of the map

[`region`](/documentation/MapKit/MKMapView/region)

The area the map view displays.

[`setRegion(_:animated:)`](/documentation/MapKit/MKMapView/setRegion(_:animated:))

Changes the currently visible region, and optionally animates the change.

[`centerCoordinate`](/documentation/MapKit/MKMapView/centerCoordinate)

The map coordinate at the center of the map view.

[`setCenter(_:animated:)`](/documentation/MapKit/MKMapView/setCenter(_:animated:))

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

[`showAnnotations(_:animated:)`](/documentation/MapKit/MKMapView/showAnnotations(_:animated:))

Sets the visible region so that the map displays the specified annotations.

[`visibleMapRect`](/documentation/MapKit/MKMapView/visibleMapRect)

The area visible in the map view.

[`setVisibleMapRect(_:animated:)`](/documentation/MapKit/MKMapView/setVisibleMapRect(_:animated:))

Changes the currently visible portion of the map, and optionally animates the change.

[`setVisibleMapRect(_:edgePadding:animated:)`](/documentation/MapKit/MKMapView/setVisibleMapRect(_:edgePadding:animated:))

Changes the currently visible portion of the map, allowing you to specify additional space around the edges.

### Constraining the map view

[`setCameraBoundary(_:animated:)`](/documentation/MapKit/MKMapView/setCameraBoundary(_:animated:))

Sets the camera boundary for the map view, specifying whether to use animation.

[`cameraBoundary`](/documentation/MapKit/MKMapView/cameraBoundary-swift.property)

The boundary of the area within which the map view’s center needs to remain.

[`setCameraZoomRange(_:animated:)`](/documentation/MapKit/MKMapView/setCameraZoomRange(_:animated:))

Sets the camera zoom range for the map view, specifying whether to use animation.

[`cameraZoomRange`](/documentation/MapKit/MKMapView/cameraZoomRange-swift.property)

The zoom range to apply to the map view.

[`MKMapView.CameraBoundary`](/documentation/MapKit/MKMapView/CameraBoundary-swift.class)

A boundary of an area within which the map’s center needs to remain.

[`MKMapView.CameraZoomRange`](/documentation/MapKit/MKMapView/CameraZoomRange-swift.class)

A camera zoom range that limits the distances to which the user can zoom.

### Configuring the map display

[`setCamera(_:animated:)`](/documentation/MapKit/MKMapView/setCamera(_:animated:))

Changes the camera to use for determining the map’s viewing parameters, and optionally animates the change.

[`camera`](/documentation/MapKit/MKMapView/camera)

The camera to use for determining the appearance of the map.

[`showsCompass`](/documentation/MapKit/MKMapView/showsCompass)

A Boolean value that indicates whether the map displays a compass control.

[`showsPitchControl`](/documentation/MapKit/MKMapView/showsPitchControl)

A Boolean value that indicates whether the map displays the pitch control.

[`showsScale`](/documentation/MapKit/MKMapView/showsScale)

A Boolean value that indicates whether the map shows scale information.

[`showsZoomControls`](/documentation/MapKit/MKMapView/showsZoomControls)

A Boolean value that indicates whether the map displays zoom controls.

[`showsBuildings`](/documentation/MapKit/MKMapView/showsBuildings)

A Boolean value that indicates whether the map displays extruded building information on supported map types.

[`showsPointsOfInterest`](/documentation/MapKit/MKMapView/showsPointsOfInterest)

A Boolean value that indicates whether the map displays point-of-interest information.

[`pointOfInterestFilter`](/documentation/MapKit/MKMapView/pointOfInterestFilter)

The filter to use for determining the points of interest that appear on the map.

[`showsTraffic`](/documentation/MapKit/MKMapView/showsTraffic)

A Boolean value that indicates whether the map displays traffic information.

### Displaying the user’s location

[Converting a user’s location to a descriptive placemark](/documentation/MapKit/converting-a-user-s-location-to-a-descriptive-placemark)

Transform the user’s location that displays on a map into an informative textual description by reverse geocoding.

[`showsUserLocation`](/documentation/MapKit/MKMapView/showsUserLocation)

A Boolean value that indicates whether the map tries to display the user’s location.

[`isUserLocationVisible`](/documentation/MapKit/MKMapView/isUserLocationVisible)

A Boolean value that indicates whether the user’s location is visible in the map view.

[`userLocation`](/documentation/MapKit/MKMapView/userLocation)

The annotation object that represents the user’s location.

[`userTrackingMode`](/documentation/MapKit/MKMapView/userTrackingMode)

The mode to use for tracking the user’s location.

[`setUserTrackingMode(_:animated:)`](/documentation/MapKit/MKMapView/setUserTrackingMode(_:animated:))

Sets the mode to use for tracking the user’s location, with optional animation.

[`MKUserTrackingMode`](/documentation/MapKit/MKUserTrackingMode)

The mode to use for tracking the user’s location on the map.

### Annotating the map

[`annotations`](/documentation/MapKit/MKMapView/annotations)

The annotations associated with the map view.

[`addAnnotation(_:)`](/documentation/MapKit/MKMapView/addAnnotation(_:))

Adds the specified annotation to the map view.

[`addAnnotations(_:)`](/documentation/MapKit/MKMapView/addAnnotations(_:))

Adds an array of annotation objects to the map view.

[`removeAnnotation(_:)`](/documentation/MapKit/MKMapView/removeAnnotation(_:))

Removes the specified annotation object from the map view.

[`removeAnnotations(_:)`](/documentation/MapKit/MKMapView/removeAnnotations(_:))

Removes an array of annotation objects from the map view.

[`annotations(in:)`](/documentation/MapKit/MKMapView/annotations(in:))

Returns the annotation objects within the specified map rectangle.

### Managing annotation selections

[`annotationVisibleRect`](/documentation/MapKit/MKMapView/annotationVisibleRect)

The visible rectangle where the map is displaying annotation views.

[`selectedAnnotations`](/documentation/MapKit/MKMapView/selectedAnnotations)

The selected annotations.

[`selectAnnotation(_:animated:)`](/documentation/MapKit/MKMapView/selectAnnotation(_:animated:))

Selects the specified annotation and displays a callout view for it.

[`deselectAnnotation(_:animated:)`](/documentation/MapKit/MKMapView/deselectAnnotation(_:animated:))

Deselects the specified annotation and hides its callout view.

### Creating annotation views

[`register(_:forAnnotationViewWithReuseIdentifier:)`](/documentation/MapKit/MKMapView/register(_:forAnnotationViewWithReuseIdentifier:))

Registers an annotation view class that the map can create automatically.

[`dequeueReusableAnnotationView(withIdentifier:for:)`](/documentation/MapKit/MKMapView/dequeueReusableAnnotationView(withIdentifier:for:))

Returns a reusable annotation view using the specified identifier with a specified existing annotation view, if possible.

[`dequeueReusableAnnotationView(withIdentifier:)`](/documentation/MapKit/MKMapView/dequeueReusableAnnotationView(withIdentifier:))

Returns a reusable annotation view using its identifier.

[`view(for:)`](/documentation/MapKit/MKMapView/view(for:)-33w8k)

Returns the annotation view associated with the specified annotation object, if any.

[`MKMapViewDefaultAnnotationViewReuseIdentifier`](/documentation/MapKit/MKMapViewDefaultAnnotationViewReuseIdentifier)

The default reuse identifier for your map’s annotation views.

[`MKMapViewDefaultClusterAnnotationViewReuseIdentifier`](/documentation/MapKit/MKMapViewDefaultClusterAnnotationViewReuseIdentifier)

The default reuse identifier for the annotation view representing a cluster of annotations.

### Accessing overlays

[`overlays`](/documentation/MapKit/MKMapView/overlays)

The overlay objects associated with the map view.

[`overlays(in:)`](/documentation/MapKit/MKMapView/overlays(in:))

Returns overlay objects in the specified level of the map.

[`renderer(for:)`](/documentation/MapKit/MKMapView/renderer(for:))

Returns the renderer object for drawing the contents of the specified overlay object.

[`MKOverlayLevel`](/documentation/MapKit/MKOverlayLevel)

Constants that indicate the position of overlays relative to other content.

[`view(for:)`](/documentation/MapKit/MKMapView/view(for:)-38z60)

Returns the view associated with the overlay object, if any.

### Adding and inserting overlays

[`addOverlay(_:level:)`](/documentation/MapKit/MKMapView/addOverlay(_:level:))

Adds the overlay object to the map at the specified level.

[`addOverlays(_:level:)`](/documentation/MapKit/MKMapView/addOverlays(_:level:))

Adds an array of overlay objects to the map at the specified level.

[`addOverlay(_:)`](/documentation/MapKit/MKMapView/addOverlay(_:))

Adds a single overlay object to the map.

[`addOverlays(_:)`](/documentation/MapKit/MKMapView/addOverlays(_:))

Adds an array of overlay objects to the map.

[`insertOverlay(_:at:level:)`](/documentation/MapKit/MKMapView/insertOverlay(_:at:level:))

Inserts an overlay object into the level at the specified index.

[`insertOverlay(_:at:)`](/documentation/MapKit/MKMapView/insertOverlay(_:at:))

Inserts an overlay object into the list associated with the map.

[`insertOverlay(_:above:)`](/documentation/MapKit/MKMapView/insertOverlay(_:above:))

Inserts one overlay object above another.

[`insertOverlay(_:below:)`](/documentation/MapKit/MKMapView/insertOverlay(_:below:))

Inserts one overlay object below another.

[`exchangeOverlay(_:with:)`](/documentation/MapKit/MKMapView/exchangeOverlay(_:with:))

Exchanges the positions of two overlay objects.

[`exchangeOverlay(at:withOverlayAt:)`](/documentation/MapKit/MKMapView/exchangeOverlay(at:withOverlayAt:))

Exchanges the position of two overlay objects at the specified index.

### Removing overlays

[`removeOverlay(_:)`](/documentation/MapKit/MKMapView/removeOverlay(_:))

Removes a single overlay object from the map.

[`removeOverlays(_:)`](/documentation/MapKit/MKMapView/removeOverlays(_:))

Removes one or more overlay objects from the map.

### Converting map coordinates

[`convert(_:toPointTo:)`](/documentation/MapKit/MKMapView/convert(_:toPointTo:))

Converts a map coordinate to a point in the specified view.

[`convert(_:toCoordinateFrom:)`](/documentation/MapKit/MKMapView/convert(_:toCoordinateFrom:))

Converts a point in the specified view’s coordinate system to a map coordinate.

[`convert(_:toRectTo:)`](/documentation/MapKit/MKMapView/convert(_:toRectTo:))

Converts a map region to a rectangle in the specified view.

[`convert(_:toRegionFrom:)`](/documentation/MapKit/MKMapView/convert(_:toRegionFrom:))

Converts a rectangle in the specified view’s coordinate system to a map region.

### Adjusting map regions and rectangles

[`regionThatFits(_:)`](/documentation/MapKit/MKMapView/regionThatFits(_:))

Adjusts the aspect ratio of the specified region to ensure that it fits in the map view’s frame.

[`mapRectThatFits(_:)`](/documentation/MapKit/MKMapView/mapRectThatFits(_:))

Returns a centered map rectangle with the same aspect ratio as the map view’s frame.

[`mapRectThatFits(_:edgePadding:)`](/documentation/MapKit/MKMapView/mapRectThatFits(_:edgePadding:))

Returns a centered, inset map rectangle with the same aspect ratio as the map view’s frame.



---

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)