# GoogleMaps Framework Reference

# GMSMarker

    @interface GMSMarker : https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSOverlay.html

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.
- `


  ### [position](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker#/c:objc(cs)GMSMarker(py)position)


  ` Marker position. Animated.

  #### Declaration

  Swift

      var position: CLLocationCoordinate2D { get set }

  Objective-C

      @property (nonatomic) CLLocationCoordinate2D position;

- `


  ### [snippet](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker#/c:objc(cs)GMSMarker(py)snippet)


  ` Snippet text, shown beneath the title in the info window when selected.

  #### Declaration

  Swift

      var snippet: String? { get set }

  Objective-C

      @property (nonatomic, copy, nullable) NSString *snippet;

- `


  ### [icon](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker#/c:objc(cs)GMSMarker(py)icon)


  ` 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.

  #### Declaration

  Swift

      var icon: UIImage? { get set }

  Objective-C

      @property (nonatomic, nullable) UIImage *icon;

- `


  ### [iconView](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker#/c:objc(cs)GMSMarker(py)iconView)


  ` Marker view to render. If left nil, falls back to the `https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker.html#/c:objc(cs)GMSMarker(py)icon` property instead.

  Supports animation of all animatable properties of `UIView`, except `frame` and `center`.
  Changing these properties or their corresponding `CALayer` version, including `https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker.html#/c:objc(cs)GMSMarker(py)position`, is not
  supported.

  Note that the view behaves as if `clipsToBounds` is set to YES, regardless of its actual value.

  #### Declaration

  Swift

      var iconView: UIView? { get set }

  Objective-C

      @property (nonatomic, nullable) UIView *iconView;

- `


  ### [tracksViewChanges](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker#/c:objc(cs)GMSMarker(py)tracksViewChanges)


  ` Controls whether the icon for this marker should be redrawn every frame.

  Note that when this changes from NO to YES, the icon is guaranteed to be redrawn next frame.

  Defaults to YES.
  Has no effect if `https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker.html#/c:objc(cs)GMSMarker(py)iconView` is nil.

  #### Declaration

  Swift

      var tracksViewChanges: Bool { get set }

  Objective-C

      @property (nonatomic) BOOL tracksViewChanges;

- `


  ### [tracksInfoWindowChanges](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker#/c:objc(cs)GMSMarker(py)tracksInfoWindowChanges)


  ` Controls whether the info window for this marker should be redrawn every frame.

  Note that when this changes from NO to YES, the info window is guaranteed to be redrawn next
  frame.

  Defaults to NO.

  #### Declaration

  Swift

      var tracksInfoWindowChanges: Bool { get set }

  Objective-C

      @property (nonatomic) BOOL tracksInfoWindowChanges;

- `


  ### [groundAnchor](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker#/c:objc(cs)GMSMarker(py)groundAnchor)


  ` 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.

  #### Declaration

  Swift

      var groundAnchor: CGPoint { get set }

  Objective-C

      @property (nonatomic) CGPoint groundAnchor;

- `


  ### [infoWindowAnchor](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker#/c:objc(cs)GMSMarker(py)infoWindowAnchor)


  ` 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.

  #### Declaration

  Swift

      var infoWindowAnchor: CGPoint { get set }

  Objective-C

      @property (nonatomic) CGPoint infoWindowAnchor;

- `


  ### [appearAnimation](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker#/c:objc(cs)GMSMarker(py)appearAnimation)


  ` Controls the animation used when this marker is placed on a `https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html` (default
  `kGMSMarkerAnimationNone`, no animation).

  #### Declaration

  Swift

      var appearAnimation: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Enums/GMSMarkerAnimation.html { get set }

  Objective-C

      @property (nonatomic) https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Enums/GMSMarkerAnimation.html appearAnimation;

- `


  ### [draggable](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker#/c:objc(cs)GMSMarker(py)draggable)


  ` Controls whether this marker can be dragged interactively (default NO).

  #### Declaration

  Swift

      var isDraggable: Bool { get set }

  Objective-C

      @property (nonatomic, getter=isDraggable) BOOL draggable;

- `


  ### [flat](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker#/c:objc(cs)GMSMarker(py)flat)


  ` Controls whether this marker should be flat against the Earth's surface (YES) or a billboard
  facing the camera (NO, default).

  #### Declaration

  Swift

      var isFlat: Bool { get set }

  Objective-C

      @property (nonatomic, getter=isFlat) BOOL flat;

- `


  ### [rotation](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker#/c:objc(cs)GMSMarker(py)rotation)


  ` 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.

  #### Declaration

  Swift

      var rotation: CLLocationDegrees { get set }

  Objective-C

      @property (nonatomic) CLLocationDegrees rotation;

- `


  ### [opacity](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker#/c:objc(cs)GMSMarker(py)opacity)


  ` Sets the opacity of the marker, between 0 (completely transparent) and 1 (default) inclusive.

  #### Declaration

  Swift

      var opacity: Float { get set }

  Objective-C

      @property (nonatomic) float opacity;

- `


  ### [layer](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker#/c:objc(cs)GMSMarker(py)layer)


  ` Provides the Core Animation layer for this `GMSMarker`.

  #### Declaration

  Swift

      var layer: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarkerLayer.html { get }

  Objective-C

      @property (nonatomic, readonly) https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarkerLayer.html *_Nonnull layer;

- `


  ### [panoramaView](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker#/c:objc(cs)GMSMarker(py)panoramaView)


  ` The `panoramaView` specifies which panorama view will attempt to show this marker. Note that if
  the marker's `https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker.html#/c:objc(cs)GMSMarker(py)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.

  #### Declaration

  Swift

      weak var panoramaView: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSPanoramaView.html? { get set }

  Objective-C

      @property (nonatomic, weak, nullable) https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSPanoramaView.html *panoramaView;

- `


  ### [+markerWithPosition:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker#/c:objc(cs)GMSMarker(cm)markerWithPosition:)


  ` Convenience constructor for a default marker.

  #### Declaration

  Swift

      convenience init(position: CLLocationCoordinate2D)

  Objective-C

      + (nonnull instancetype)markerWithPosition:(CLLocationCoordinate2D)position;

- `


  ### [+markerImageWithColor:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker#/c:objc(cs)GMSMarker(cm)markerImageWithColor:)


  ` Creates a tinted version of the default marker image for use as an icon.

  #### Declaration

  Swift

      class func markerImage(with color: UIColor?) -> UIImage

  Objective-C

      + (nonnull UIImage *)markerImageWithColor:(nullable UIColor *)color;