AI-generated Key Takeaways
-
GMSMapLayer
is a custom subclass ofCALayer
used as the layer class forGMSMapView
and should not be directly instantiated. -
It provides access to the camera properties of the
GMSMapView
, like latitude, longitude, bearing, zoom level, and viewing angle. -
Modifying or animating
GMSMapLayer
properties can interrupt user gestures on the map and vice-versa. -
Developers can use these properties to programmatically control the map's camera view.
GMSMapLayer
@interface GMSMapLayer : GMSCALayer
GMSMapLayer
is a custom subclass of CALayer
, provided as the layer class on GMSMapView
.
This layer should not be instantiated directly. It provides model access to the camera normally
defined on GMSMapView
.
Modifying or animating these properties will typically interrupt any current gesture on
GMSMapView
, e.g., a user’s pan or rotation. Similarly, if a user performs an enabled gesture
during an animation, the animation will stop ‘in-place’ (at the current presentation value).
-
Declaration
Swift
var cameraLatitude: CLLocationDegrees { get set }
Objective-C
@property(nonatomic) CLLocationDegrees cameraLatitude
-
Declaration
Swift
var cameraLongitude: CLLocationDegrees { get set }
Objective-C
@property(nonatomic) CLLocationDegrees cameraLongitude
-
Declaration
Swift
var cameraBearing: CLLocationDirection { get set }
Objective-C
@property(nonatomic) CLLocationDirection cameraBearing
-
Declaration
Swift
var cameraZoomLevel: Float { get set }
Objective-C
@property(nonatomic) float cameraZoomLevel
-
Declaration
Swift
var cameraViewingAngle: Double { get set }
Objective-C
@property(nonatomic) double cameraViewingAngle