AI-generated Key Takeaways
-
GMSGroundOverlayis a non-facing-camera overlay used to display images on the Earth's surface within specified boundaries. -
Its position is determined by an anchor point within its bounds and can be rotated using the bearing property.
-
The overlay's appearance is customizable through properties like
icon,opacity, andbounds. -
Developers can create ground overlays using convenience constructors specifying either bounds and icon or position, icon, and zoom level.
-
Unlike markers, ground overlays do not have a default image and will not be visible if the
iconproperty is nil.
GMSGroundOverlay
@interface GMSGroundOverlay : GMSOverlayGMSGroundOverlay specifies the available options for a ground overlay that exists on the
Earth’s surface. Unlike a marker, the position of a ground overlay is specified explicitly and it
does not face the camera.
-
The position of this
GMSGroundOverlay, or more specifically, the physical position of its anchor. If this is changed,boundswill be moved around the new position.Declaration
Swift
var position: CLLocationCoordinate2D { get set }Objective-C
@property (nonatomic) CLLocationCoordinate2D position; -
Sets the opacity of the ground overlay, between 0 (completely transparent) and 1 (default) inclusive.
Declaration
Swift
var opacity: Float { get set }Objective-C
@property (nonatomic) float opacity; -
Bearing of this ground overlay, in degrees. The default value, zero, points this ground overlay up/down along the normal Y axis of the earth.
Declaration
Swift
var bearing: CLLocationDirection { get set }Objective-C
@property (nonatomic) CLLocationDirection bearing; -
The 2D bounds on the Earth in which
iconis drawn. Changing this value will adjustpositionaccordingly.Declaration
Swift
var bounds: GMSCoordinateBounds? { get set }Objective-C
@property (nonatomic, nullable) GMSCoordinateBounds *bounds; -
Convenience constructor for
GMSGroundOverlayfor a particularboundsandicon. Will setpositionaccordingly.Declaration
Swift
convenience init(bounds: GMSCoordinateBounds?, icon: UIImage?)Objective-C
+ (nonnull instancetype)groundOverlayWithBounds: (nullable GMSCoordinateBounds *)bounds icon:(nullable UIImage *)icon; -
Constructs a
GMSGroundOverlaythat renders the giveniconatposition, as if the image’s actual size matches camera pixels atzoomLevel.Declaration
Swift
convenience init(position: CLLocationCoordinate2D, icon: UIImage?, zoomLevel: CGFloat)Objective-C
+ (nonnull instancetype)groundOverlayWithPosition: (CLLocationCoordinate2D)position icon:(nullable UIImage *)icon zoomLevel:(CGFloat)zoomLevel;