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.
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.