A marker is an icon placed at a particular point on the map’s surface. A marker’s icon is drawn
oriented against the device’s screen rather than the map’s surface; i.e., it will not necessarily
change orientation due to map rotations, tilting, or zooming.
Marker icon to render. If left nil, uses a default SDK place marker.
Supports animated images, but each frame must be the same size or the behavior is undefined.
Supports the use of alignmentRectInsets to specify a reduced tap area. This also redefines how
anchors are specified. For an animated image the value for the animation is used, not the
individual frames.
Marker view to render. If left nil, falls back to the icon property instead.
Supports animation of all animatable properties of UIView, except frame and center.
Changing these properties or their corresponding CALayer version, including position, is not
supported.
Note that the view behaves as if clipsToBounds is set to YES, regardless of its actual value.
The ground anchor specifies the point in the icon image that is anchored to the marker’s position
on the Earth’s surface. This point is specified within the continuous space [0.0, 1.0] x [0.0,
1.0], where (0,0) is the top-left corner of the image, and (1,1) is the bottom-right corner.
If the image has non-zero alignmentRectInsets, the top-left and bottom-right mentioned above
refer to the inset section of the image.
The info window anchor specifies the point in the icon image at which to anchor the info window,
which will be displayed directly above this point. This point is specified within the same space
as groundAnchor.
Sets the rotation of the marker in degrees clockwise about the marker’s anchor point. The axis of
rotation is perpendicular to the marker. A rotation of 0 corresponds to the default position of
the marker. Animated.
When the marker is flat on the map, the default position is north aligned and the rotation is
such that the marker always remains flat on the map. When the marker is a billboard, the default
position is pointing up and the rotation is such that the marker is always facing the camera.
The panoramaView specifies which panorama view will attempt to show this marker. Note that if
the marker’s position is too far away from the panoramaView‘s current panorama location, it
will not be displayed as it will be too small.
Can be set to nil to remove the marker from any current panorama view it is attached to.
A marker can be shown on both a panorama and a map at the same time.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-15 UTC."],[[["\u003cp\u003e\u003ccode\u003eGMSMarker\u003c/code\u003e represents an icon placed at a specific point on a map, with customizable properties like position, icon, and snippet.\u003c/p\u003e\n"],["\u003cp\u003eIt allows for control over appearance, animation, and interactivity, including draggability and rotation.\u003c/p\u003e\n"],["\u003cp\u003eMarkers can be displayed on both maps and panorama views, with options to adjust anchoring and opacity.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use default marker images or provide custom icons, including animated images and views.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eGMSMarker\u003c/code\u003e provides properties for controlling how the marker and its info window are updated and rendered.\u003c/p\u003e\n"]]],["GMSMarker defines map icons that remain screen-oriented regardless of map adjustments. Key actions involve setting the marker's `position`, `snippet`, and `icon`. You can use `iconView` instead of icon, with `tracksViewChanges` controlling redraws. Markers have `groundAnchor` and `infoWindowAnchor` properties to adjust display. Other controls include `appearAnimation`, `draggable` state, `flat` mode, `rotation`, and `opacity`. The marker can be tied to a `panoramaView`. Methods exist to create markers and tint default marker icons.\n"],null,["GMSMarker \n\n @interface GMSMarker : ../Classes/GMSOverlay.html\n\nA marker is an icon placed at a particular point on the map's surface. A marker's icon is drawn\noriented against the device's screen rather than the map's surface; i.e., it will not necessarily\nchange orientation due to map rotations, tilting, or zooming.\n- `\n ``\n ``\n `\n\n [position](#/c:objc(cs)GMSMarker(py)position)`\n ` \n Marker position. Animated. \n\n Declaration \n Swift \n\n var position: CLLocationCoordinate2D { get set }\n\n Objective-C \n\n @property (nonatomic) CLLocationCoordinate2D position;\n\n- `\n ``\n ``\n `\n\n [snippet](#/c:objc(cs)GMSMarker(py)snippet)`\n ` \n Snippet text, shown beneath the title in the info window when selected. \n\n Declaration \n Swift \n\n var snippet: String? { get set }\n\n Objective-C \n\n @property (nonatomic, copy, nullable) NSString *snippet;\n\n- `\n ``\n ``\n `\n\n [icon](#/c:objc(cs)GMSMarker(py)icon)`\n ` \n Marker icon to render. If left nil, uses a default SDK place marker.\n\n Supports animated images, but each frame must be the same size or the behavior is undefined.\n\n Supports the use of alignmentRectInsets to specify a reduced tap area. This also redefines how\n anchors are specified. For an animated image the value for the animation is used, not the\n individual frames. \n\n Declaration \n Swift \n\n var icon: UIImage? { get set }\n\n Objective-C \n\n @property (nonatomic, nullable) UIImage *icon;\n\n- `\n ``\n ``\n `\n\n [iconView](#/c:objc(cs)GMSMarker(py)iconView)`\n ` \n Marker view to render. If left nil, falls back to the [icon](../Classes/GMSMarker.html#/c:objc(cs)GMSMarker(py)icon) property instead.\n\n Supports animation of all animatable properties of `UIView`, except `frame` and `center`.\n Changing these properties or their corresponding `CALayer` version, including [position](../Classes/GMSMarker.html#/c:objc(cs)GMSMarker(py)position), is not\n supported.\n\n Note that the view behaves as if `clipsToBounds` is set to YES, regardless of its actual value. \n\n Declaration \n Swift \n\n var iconView: UIView? { get set }\n\n Objective-C \n\n @property (nonatomic, nullable) UIView *iconView;\n\n- `\n ``\n ``\n `\n\n [tracksViewChanges](#/c:objc(cs)GMSMarker(py)tracksViewChanges)`\n ` \n Controls whether the icon for this marker should be redrawn every frame.\n\n Note that when this changes from NO to YES, the icon is guaranteed to be redrawn next frame.\n\n Defaults to YES.\n Has no effect if [iconView](../Classes/GMSMarker.html#/c:objc(cs)GMSMarker(py)iconView) is nil. \n\n Declaration \n Swift \n\n var tracksViewChanges: Bool { get set }\n\n Objective-C \n\n @property (nonatomic) BOOL tracksViewChanges;\n\n- `\n ``\n ``\n `\n\n [tracksInfoWindowChanges](#/c:objc(cs)GMSMarker(py)tracksInfoWindowChanges)`\n ` \n Controls whether the info window for this marker should be redrawn every frame.\n\n Note that when this changes from NO to YES, the info window is guaranteed to be redrawn next\n frame.\n\n Defaults to NO. \n\n Declaration \n Swift \n\n var tracksInfoWindowChanges: Bool { get set }\n\n Objective-C \n\n @property (nonatomic) BOOL tracksInfoWindowChanges;\n\n- `\n ``\n ``\n `\n\n [groundAnchor](#/c:objc(cs)GMSMarker(py)groundAnchor)`\n ` \n The ground anchor specifies the point in the icon image that is anchored to the marker's position\n on the Earth's surface. This point is specified within the continuous space \\[0.0, 1.0\\] x \\[0.0,\n 1.0\\], where (0,0) is the top-left corner of the image, and (1,1) is the bottom-right corner.\n\n If the image has non-zero alignmentRectInsets, the top-left and bottom-right mentioned above\n refer to the inset section of the image. \n\n Declaration \n Swift \n\n var groundAnchor: CGPoint { get set }\n\n Objective-C \n\n @property (nonatomic) CGPoint groundAnchor;\n\n- `\n ``\n ``\n `\n\n [infoWindowAnchor](#/c:objc(cs)GMSMarker(py)infoWindowAnchor)`\n ` \n The info window anchor specifies the point in the icon image at which to anchor the info window,\n which will be displayed directly above this point. This point is specified within the same space\n as groundAnchor. \n\n Declaration \n Swift \n\n var infoWindowAnchor: CGPoint { get set }\n\n Objective-C \n\n @property (nonatomic) CGPoint infoWindowAnchor;\n\n- `\n ``\n ``\n `\n\n [appearAnimation](#/c:objc(cs)GMSMarker(py)appearAnimation)`\n ` \n Controls the animation used when this marker is placed on a [GMSMapView](../Classes/GMSMapView.html) (default\n `kGMSMarkerAnimationNone`, no animation). \n\n Declaration \n Swift \n\n var appearAnimation: ../Enums/GMSMarkerAnimation.html { get set }\n\n Objective-C \n\n @property (nonatomic) ../Enums/GMSMarkerAnimation.html appearAnimation;\n\n- `\n ``\n ``\n `\n\n [draggable](#/c:objc(cs)GMSMarker(py)draggable)`\n ` \n Controls whether this marker can be dragged interactively (default NO). \n\n Declaration \n Swift \n\n var isDraggable: Bool { get set }\n\n Objective-C \n\n @property (nonatomic, getter=isDraggable) BOOL draggable;\n\n- `\n ``\n ``\n `\n\n [flat](#/c:objc(cs)GMSMarker(py)flat)`\n ` \n Controls whether this marker should be flat against the Earth's surface (YES) or a billboard\n facing the camera (NO, default). \n\n Declaration \n Swift \n\n var isFlat: Bool { get set }\n\n Objective-C \n\n @property (nonatomic, getter=isFlat) BOOL flat;\n\n- `\n ``\n ``\n `\n\n [rotation](#/c:objc(cs)GMSMarker(py)rotation)`\n ` \n Sets the rotation of the marker in degrees clockwise about the marker's anchor point. The axis of\n rotation is perpendicular to the marker. A rotation of 0 corresponds to the default position of\n the marker. Animated.\n\n When the marker is flat on the map, the default position is north aligned and the rotation is\n such that the marker always remains flat on the map. When the marker is a billboard, the default\n position is pointing up and the rotation is such that the marker is always facing the camera. \n\n Declaration \n Swift \n\n var rotation: CLLocationDegrees { get set }\n\n Objective-C \n\n @property (nonatomic) CLLocationDegrees rotation;\n\n- `\n ``\n ``\n `\n\n [opacity](#/c:objc(cs)GMSMarker(py)opacity)`\n ` \n Sets the opacity of the marker, between 0 (completely transparent) and 1 (default) inclusive. \n\n Declaration \n Swift \n\n var opacity: Float { get set }\n\n Objective-C \n\n @property (nonatomic) float opacity;\n\n- `\n ``\n ``\n `\n\n [layer](#/c:objc(cs)GMSMarker(py)layer)`\n ` \n Provides the Core Animation layer for this `GMSMarker`. \n\n Declaration \n Swift \n\n var layer: ../Classes/GMSMarkerLayer.html { get }\n\n Objective-C \n\n @property (nonatomic, readonly) ../Classes/GMSMarkerLayer.html *_Nonnull layer;\n\n- `\n ``\n ``\n `\n\n [panoramaView](#/c:objc(cs)GMSMarker(py)panoramaView)`\n ` \n The `panoramaView` specifies which panorama view will attempt to show this marker. Note that if\n the marker's [position](../Classes/GMSMarker.html#/c:objc(cs)GMSMarker(py)position) is too far away from the `panoramaView`'s current panorama location, it\n will not be displayed as it will be too small.\n\n Can be set to nil to remove the marker from any current panorama view it is attached to.\n\n A marker can be shown on both a panorama and a map at the same time. \n\n Declaration \n Swift \n\n weak var panoramaView: ../Classes/GMSPanoramaView.html? { get set }\n\n Objective-C \n\n @property (nonatomic, weak, nullable) ../Classes/GMSPanoramaView.html *panoramaView;\n\n- `\n ``\n ``\n `\n\n [+markerWithPosition:](#/c:objc(cs)GMSMarker(cm)markerWithPosition:)`\n ` \n Convenience constructor for a default marker. \n\n Declaration \n Swift \n\n convenience init(position: CLLocationCoordinate2D)\n\n Objective-C \n\n + (nonnull instancetype)markerWithPosition:(CLLocationCoordinate2D)position;\n\n- `\n ``\n ``\n `\n\n [+markerImageWithColor:](#/c:objc(cs)GMSMarker(cm)markerImageWithColor:)`\n ` \n Creates a tinted version of the default marker image for use as an icon. \n\n Declaration \n Swift \n\n class func markerImage(with color: UIColor?) -\u003e UIImage\n\n Objective-C \n\n + (nonnull UIImage *)markerImageWithColor:(nullable UIColor *)color;"]]