One Logo Pool Ball
_MapKit_SwiftUI · IOS API REFERENCE

MapCamera

struct · iOS 17.0+ · SDK 27.1

struct MapCamera

Defines a virtual viewpoint above the map surface. `MapCamera` allows you to specify the viewpoint of a `Map`, as well as affect how MapKit presents the map to the user. You use a `MapCamera` to specify the location of the camera on the map, the compass heading indicating the camera’s viewing direction, the pitch of the camera relative to the map perpendicular, and the camera’s distance from the target point. These factors create a map view with a three-dimensional perspective.

Members (10)

init · iOS 17.0+

init

TypeScript
static initCenterCoordinateDistanceHeadingPitch(centerCoordinate: { latitude: number; longitude: number }, distance: number, heading?: number, pitch?: number): MapCamera
Swift declaration
init(centerCoordinate: CLLocationCoordinate2D, distance: Double, heading: Double = 0, pitch: Double = 0)

Creates a camera using the specified distance, pitch, and heading information. - Parameters: - centerCoordinate: The map coordinate at the center of the map view. - distance: The distance from the center point of the map to the camera, in meters. - heading: The heading of the camera (in degrees) relative to true north. - pitch: The viewing angle of the camera, in degrees.

get · iOS 17.0+

centerCoordinate

TypeScript
get centerCoordinate(): { latitude: number; longitude: number }
Swift declaration
var centerCoordinate: CLLocationCoordinate2D

The map coordinate at the center of the map view.

set · iOS 17.0+

centerCoordinate

TypeScript
set centerCoordinate(value: { latitude: number; longitude: number })
Swift declaration
var centerCoordinate: CLLocationCoordinate2D

The map coordinate at the center of the map view.

get · iOS 17.0+

pitch

TypeScript
get pitch(): number
Swift declaration
var pitch: Double

The viewing angle of the camera, in degrees.

set · iOS 17.0+

pitch

TypeScript
set pitch(value: number)
Swift declaration
var pitch: Double

The viewing angle of the camera, in degrees.

get · iOS 17.0+

heading

TypeScript
get heading(): number
Swift declaration
var heading: Double

The heading of the camera (in degrees) relative to true north.

set · iOS 17.0+

heading

TypeScript
set heading(value: number)
Swift declaration
var heading: Double

The heading of the camera (in degrees) relative to true north.

get · iOS 17.0+

distance

TypeScript
get distance(): number
Swift declaration
var distance: Double

The distance from the center point of the map to the camera, in meters.

set · iOS 17.0+

distance

TypeScript
set distance(value: number)
Swift declaration
var distance: Double

The distance from the center point of the map to the camera, in meters.

init · iOS 17.0+

init

TypeScript
static init(camera: _MapKit_MKMapCamera): MapCamera
Swift declaration
init(_ camera: MKMapCamera)

Creates a `MapCamera` from the given MKMapCamera.

Skipped declarations

No declarations were skipped in this snapshot.

All _MapKit_SwiftUI types →