MGLMapCamera
@interface MGLMapCamera : NSObject <NSSecureCoding, NSCopying>
An MGLMapCamera object represents a viewpoint from which the user observes
some point on an MGLMapView.
-
Coordinate at the center of the map view.
Declaration
Objective-C
@property (assign, readwrite, nonatomic) CLLocationCoordinate2D centerCoordinate;Swift
var centerCoordinate: CLLocationCoordinate2D { get set } -
Heading measured in degrees clockwise from true north.
Declaration
Objective-C
@property (assign, readwrite, nonatomic) CLLocationDirection heading;Swift
var heading: CLLocationDirection { get set } -
Pitch toward the horizon measured in degrees, with 0 degrees resulting in a two-dimensional map.
Declaration
Objective-C
@property (assign, readwrite, nonatomic) CGFloat pitch;Swift
var pitch: CGFloat { get set } -
Meters above ground level.
Declaration
Objective-C
@property (assign, readwrite, nonatomic) CLLocationDistance altitude;Swift
var altitude: CLLocationDistance { get set } -
Returns a new camera with all properties set to 0.
Declaration
Objective-C
+ (nonnull instancetype)camera; -
Returns a new camera based on information about the camera’s viewpoint and focus point.
Declaration
Objective-C
+ (nonnull instancetype) cameraLookingAtCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate fromEyeCoordinate:(CLLocationCoordinate2D)eyeCoordinate eyeAltitude:(CLLocationDistance)eyeAltitude;Swift
convenience init(lookingAtCenter centerCoordinate: CLLocationCoordinate2D, fromEyeCoordinate eyeCoordinate: CLLocationCoordinate2D, eyeAltitude: CLLocationDistance)Parameters
centerCoordinateThe geographic coordinate on which the map should be centered.
eyeCoordinateThe geometric coordinate at which the camera should be situated.
eyeAltitudeThe altitude (measured in meters) above the map at which the camera should be situated. The altitude may be less than the distance from the camera’s viewpoint to the camera’s focus point.
-
Returns a new camera with the given distance, pitch, and heading.
Declaration
Objective-C
+ (nonnull instancetype) cameraLookingAtCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate fromDistance:(CLLocationDistance)distance pitch:(CGFloat)pitch heading:(CLLocationDirection)heading;Swift
convenience init(lookingAtCenter centerCoordinate: CLLocationCoordinate2D, fromDistance distance: CLLocationDistance, pitch: CGFloat, heading: CLLocationDirection)Parameters
centerCoordinateThe geographic coordinate on which the map should be centered.
distanceThe straight-line distance from the viewpoint to the
centerCoordinate.pitchThe viewing angle of the camera, measured in degrees. A value of
0results in a camera pointed straight down at the map. Angles greater than0result in a camera angled toward the horizon.headingThe camera’s heading, measured in degrees clockwise from true north. A value of
0means that the top edge of the map view corresponds to true north. The value90means the top of the map is pointing due east. The value180means the top of the map points due south, and so on. -
Returns a Boolean value indicating whether the given camera is functionally equivalent to the receiver.
Unlike
-isEqual:, this method returnsYESif the difference between the coordinates, altitudes, pitches, or headings of the two camera objects is negligible.Declaration
Objective-C
- (BOOL)isEqualToMapCamera:(nonnull MGLMapCamera *)otherCamera;Swift
func isEqual(to otherCamera: MGLMapCamera) -> BoolParameters
otherCameraThe camera with which to compare the receiver.
Return Value
A Boolean value indicating whether the two cameras are functionally equivalent.
Install in Dash
MGLMapCamera Class Reference