Overview
GMSGroundOverlay 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.
Inherits GMSOverlay.
Static Public Member Functions | |
(instancetype) | + groundOverlayWithBounds:icon: |
Convenience constructor for GMSGroundOverlay for a particular bounds and icon . | |
(instancetype) | + groundOverlayWithPosition:icon:zoomLevel: |
Constructs a GMSGroundOverlay that renders the given icon at position , as if the image's actual size matches camera pixels at zoomLevel . | |
Properties | |
CLLocationCoordinate2D | position |
The position of this GMSGroundOverlay, or more specifically, the physical position of its anchor. | |
CGPoint | anchor |
The anchor specifies where this GMSGroundOverlay is anchored to the Earth in relation to bounds . | |
UIImage * | icon |
Icon to render within bounds on the Earth. | |
float | opacity |
Sets the opacity of the ground overlay, between 0 (completely transparent) and 1 (default) inclusive. | |
CLLocationDirection | bearing |
Bearing of this ground overlay, in degrees. | |
GMSCoordinateBounds * | bounds |
The 2D bounds on the Earth in which icon is drawn. | |
NSString * | title |
Title, a short description of the overlay. | |
GMSMapView * | map |
The map this overlay is on. | |
BOOL | tappable |
If this overlay should cause tap notifications. | |
int | zIndex |
Higher zIndex value overlays will be drawn on top of lower zIndex value tile layers and overlays. | |
id | userData |
Overlay data. |
Member Function Documentation
+ (instancetype) groundOverlayWithBounds: | (nullable GMSCoordinateBounds *) | bounds | |
icon: | (nullable UIImage *) | icon | |
Convenience constructor for GMSGroundOverlay for a particular bounds
and icon
.
Will set position
accordingly.
+ (instancetype) groundOverlayWithPosition: | (CLLocationCoordinate2D) | position | |
icon: | (nullable UIImage *) | icon | |
zoomLevel: | (CGFloat) | zoomLevel | |
Constructs a GMSGroundOverlay that renders the given icon
at position
, as if the image's actual size matches camera pixels at zoomLevel
.
Property Documentation
- (CLLocationCoordinate2D) position [read, write, assign] |
The position of this GMSGroundOverlay, or more specifically, the physical position of its anchor.
If this is changed, bounds
will be moved around the new position.
- (CGPoint) anchor [read, write, assign] |
The anchor specifies where this GMSGroundOverlay is anchored to the Earth in relation to bounds
.
If this is modified, position
will be set to the corresponding new position within bounds
.
- (UIImage*) icon [read, write, assign] |
Icon to render within bounds
on the Earth.
If this is nil, the overlay will not be visible (unlike GMSMarker which has a default image).
- (float) opacity [read, write, assign] |
Sets the opacity of the ground overlay, between 0 (completely transparent) and 1 (default) inclusive.
- (CLLocationDirection) bearing [read, write, assign] |
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.
- (GMSCoordinateBounds*) bounds [read, write, assign] |
The 2D bounds on the Earth in which icon
is drawn.
Changing this value will adjust position
accordingly.
- (NSString*) title [read, write, copy, inherited] |
Title, a short description of the overlay.
Some overlays, such as markers, will display the title on the map. The title is also the default accessibility text.
- (GMSMapView*) map [read, write, assign, inherited] |
The map this overlay is on.
Setting this property will add the overlay to the map. Setting it to nil removes this overlay from the map. An overlay may be active on at most one map at any given time.
- (BOOL) tappable [read, write, assign, inherited] |
If this overlay should cause tap notifications.
Some overlays, such as markers, will default to being tappable.
- (int) zIndex [read, write, assign, inherited] |
Higher zIndex
value overlays will be drawn on top of lower zIndex
value tile layers and overlays.
Equal values result in undefined draw ordering. Markers are an exception that regardless of zIndex
, they will always be drawn above tile layers and other non-marker overlays; they are effectively considered to be in a separate z-index group compared to other overlays.
- (id) userData [read, write, assign, inherited] |
Overlay data.
You can use this property to associate an arbitrary object with this overlay. Google Maps SDK for iOS neither reads nor writes this property.
Note that userData should not hold any strong references to any Maps objects, otherwise a retain cycle may be created (preventing objects from being released).