# GMSMapViewDelegate

    @protocol GMSMapViewDelegate <NSObject>

Delegate for events on `https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html`.
- `


  ### [-mapView:willMove:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Protocols/GMSMapViewDelegate#/c:objc(pl)GMSMapViewDelegate(im)mapView:willMove:)


  ` Called before the camera on the map changes, either due to a gesture, animation (e.g., by a user
  tapping on the "My Location" button) or by being updated explicitly via the camera or a
  zero-length animation on layer.

  #### Declaration

  Swift

      optional func mapView(_ mapView: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html, willMove gesture: Bool)

  Objective-C

      - (void)mapView:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html *)mapView willMove:(BOOL)gesture;

  #### Parameters

  |---|---|
  | ` mapView ` | The map view that was tapped. |
  | ` gesture ` | If YES, this is occurring due to a user gesture. |

- `


  ### [-mapView:didChangeCameraPosition:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Protocols/GMSMapViewDelegate#/c:objc(pl)GMSMapViewDelegate(im)mapView:didChangeCameraPosition:)


  ` Called repeatedly during any animations or gestures on the map (or once, if the camera is
  explicitly set). This may not be called for all intermediate camera positions. It is always
  called for the final position of an animation or gesture.

  #### Declaration

  Swift

      optional func mapView(_ mapView: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html, didChange position: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSCameraPosition.html)

  Objective-C

      - (void)mapView:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html *)mapView
          didChangeCameraPosition:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSCameraPosition.html *)position;

- `


  ### [-mapView:idleAtCameraPosition:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Protocols/GMSMapViewDelegate#/c:objc(pl)GMSMapViewDelegate(im)mapView:idleAtCameraPosition:)


  ` Called when the map becomes idle, after any outstanding gestures or animations have completed (or
  after the camera has been explicitly set).

  #### Declaration

  Swift

      optional func mapView(_ mapView: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html, idleAt position: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSCameraPosition.html)

  Objective-C

      - (void)mapView:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html *)mapView
          idleAtCameraPosition:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSCameraPosition.html *)position;

- `


  ### [-mapView:didTapAtCoordinate:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Protocols/GMSMapViewDelegate#/c:objc(pl)GMSMapViewDelegate(im)mapView:didTapAtCoordinate:)


  ` Called after a tap gesture at a particular coordinate, but only if a marker was not tapped. This
  is called before deselecting any currently selected marker (the implicit action for tapping on
  the map).

  #### Declaration

  Swift

      optional func mapView(_ mapView: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html, didTapAt coordinate: CLLocationCoordinate2D)

  Objective-C

      - (void)mapView:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html *)mapView
          didTapAtCoordinate:(CLLocationCoordinate2D)coordinate;

- `


  ### [-mapView:didLongPressAtCoordinate:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Protocols/GMSMapViewDelegate#/c:objc(pl)GMSMapViewDelegate(im)mapView:didLongPressAtCoordinate:)


  ` Called after a long-press gesture at a particular coordinate.

  #### Declaration

  Swift

      optional func mapView(_ mapView: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html, didLongPressAt coordinate: CLLocationCoordinate2D)

  Objective-C

      - (void)mapView:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html *)mapView
          didLongPressAtCoordinate:(CLLocationCoordinate2D)coordinate;

  #### Parameters

  |---|---|
  | ` mapView ` | The map view that was tapped. |
  | ` coordinate ` | The location that was tapped. |

- `


  ### [-mapView:didTapMarker:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Protocols/GMSMapViewDelegate#/c:objc(pl)GMSMapViewDelegate(im)mapView:didTapMarker:)


  ` Called after a marker has been tapped.

  #### Declaration

  Swift

      optional func mapView(_ mapView: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html, didTap marker: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker.html) -> Bool

  Objective-C

      - (BOOL)mapView:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html *)mapView
          didTapMarker:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker.html *)marker;

  #### Parameters

  |---|---|
  | ` mapView ` | The map view that was tapped. |
  | ` marker ` | The marker that was tapped. |

  #### Return Value

  YES if this delegate handled the tap event, which prevents the map from performing its
  default selection behavior, and NO if the map should continue with its default selection
  behavior.
- `


  ### [-mapView:didTapInfoWindowOfMarker:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Protocols/GMSMapViewDelegate#/c:objc(pl)GMSMapViewDelegate(im)mapView:didTapInfoWindowOfMarker:)


  ` Called after a marker's info window has been tapped.

  #### Declaration

  Swift

      optional func mapView(_ mapView: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html, didTapInfoWindowOf marker: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker.html)

  Objective-C

      - (void)mapView:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html *)mapView
          didTapInfoWindowOfMarker:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker.html *)marker;

- `


  ### [-mapView:didLongPressInfoWindowOfMarker:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Protocols/GMSMapViewDelegate#/c:objc(pl)GMSMapViewDelegate(im)mapView:didLongPressInfoWindowOfMarker:)


  ` Called after a marker's info window has been long pressed.

  #### Declaration

  Swift

      optional func mapView(_ mapView: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html, didLongPressInfoWindowOf marker: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker.html)

  Objective-C

      - (void)mapView:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html *)mapView
          didLongPressInfoWindowOfMarker:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker.html *)marker;

- `


  ### [-mapView:didTapOverlay:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Protocols/GMSMapViewDelegate#/c:objc(pl)GMSMapViewDelegate(im)mapView:didTapOverlay:)


  ` Called after an overlay has been tapped.

  This method is not called for taps on markers.

  #### Declaration

  Swift

      optional func mapView(_ mapView: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html, didTap overlay: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSOverlay.html)

  Objective-C

      - (void)mapView:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html *)mapView
          didTapOverlay:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSOverlay.html *)overlay;

  #### Parameters

  |---|---|
  | ` mapView ` | The map view that was tapped. |
  | ` overlay ` | The overlay that was tapped. |

- `


  ### [-mapView:didTapPOIWithPlaceID:name:location:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Protocols/GMSMapViewDelegate#/c:objc(pl)GMSMapViewDelegate(im)mapView:didTapPOIWithPlaceID:name:location:)


  ` Called after a POI has been tapped.

  #### Declaration

  Swift

      optional func mapView(_ mapView: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html, didTapPOIWithPlaceID placeID: String, name: String, location: CLLocationCoordinate2D)

  Objective-C

      - (void)mapView:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html *)mapView
          didTapPOIWithPlaceID:(nonnull NSString *)placeID
                          name:(nonnull NSString *)name
                      location:(CLLocationCoordinate2D)location;

  #### Parameters

  |---|---|
  | ` mapView ` | The map view that was tapped. |
  | ` placeID ` | The placeID of the POI that was tapped. |
  | ` name ` | The name of the POI that was tapped. |
  | ` location ` | The location of the POI that was tapped. |

- `


  ### [-mapView:markerInfoWindow:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Protocols/GMSMapViewDelegate#/c:objc(pl)GMSMapViewDelegate(im)mapView:markerInfoWindow:)


  ` Called when a marker is about to become selected, and provides an optional custom info window to
  use for that marker if this method returns a `UIView`.

  If you change this view after this method is called, those changes will not necessarily be
  reflected in the rendered version.

  As there is only one info window shown at any time, the returned view may be reused between other
  info windows.

  Removing the marker from the map or changing the map's selected marker during this call results
  in undefined behavior.

  #### Declaration

  Swift

      optional func mapView(_ mapView: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html, markerInfoWindow marker: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker.html) -> UIView?

  Objective-C

      - (nullable UIView *)mapView:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html *)mapView
                  markerInfoWindow:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker.html *)marker;

  #### Return Value

  The custom info window for the specified marker, or nil for default
- `


  ### [-mapView:markerInfoContents:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Protocols/GMSMapViewDelegate#/c:objc(pl)GMSMapViewDelegate(im)mapView:markerInfoContents:)


  ` Called when `https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Protocols/GMSMapViewDelegate.html#/c:objc(pl)GMSMapViewDelegate(im)mapView:markerInfoWindow:` returns nil. If this method returns a view, it will be
  placed within the default info window frame. If this method returns nil, then the default
  rendering will be used instead.

  #### Declaration

  Swift

      optional func mapView(_ mapView: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html, markerInfoContents marker: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker.html) -> UIView?

  Objective-C

      - (nullable UIView *)mapView:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html *)mapView
                markerInfoContents:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker.html *)marker;

  #### Parameters

  |---|---|
  | ` mapView ` | The map view that was pressed. |
  | ` marker ` | The marker that was pressed. |

  #### Return Value

  The custom view to display as contents in the info window, or nil to use the default
  content rendering instead
- `


  ### [-mapView:didCloseInfoWindowOfMarker:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Protocols/GMSMapViewDelegate#/c:objc(pl)GMSMapViewDelegate(im)mapView:didCloseInfoWindowOfMarker:)


  ` Called when the marker's info window is closed.

  #### Declaration

  Swift

      optional func mapView(_ mapView: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html, didCloseInfoWindowOf marker: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker.html)

  Objective-C

      - (void)mapView:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html *)mapView
          didCloseInfoWindowOfMarker:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker.html *)marker;

- `


  ### [-mapView:didBeginDraggingMarker:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Protocols/GMSMapViewDelegate#/c:objc(pl)GMSMapViewDelegate(im)mapView:didBeginDraggingMarker:)


  ` Called when dragging has been initiated on a marker.

  #### Declaration

  Swift

      optional func mapView(_ mapView: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html, didBeginDragging marker: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker.html)

  Objective-C

      - (void)mapView:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html *)mapView
          didBeginDraggingMarker:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker.html *)marker;

- `


  ### [-mapView:didEndDraggingMarker:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Protocols/GMSMapViewDelegate#/c:objc(pl)GMSMapViewDelegate(im)mapView:didEndDraggingMarker:)


  ` Called after dragging of a marker ended.

  #### Declaration

  Swift

      optional func mapView(_ mapView: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html, didEndDragging marker: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker.html)

  Objective-C

      - (void)mapView:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html *)mapView
          didEndDraggingMarker:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker.html *)marker;

- `


  ### [-mapView:didDragMarker:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Protocols/GMSMapViewDelegate#/c:objc(pl)GMSMapViewDelegate(im)mapView:didDragMarker:)


  ` Called while a marker is dragged.

  #### Declaration

  Swift

      optional func mapView(_ mapView: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html, didDrag marker: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker.html)

  Objective-C

      - (void)mapView:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html *)mapView
          didDragMarker:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMarker.html *)marker;

- `


  ### [-didTapMyLocationButtonForMapView:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Protocols/GMSMapViewDelegate#/c:objc(pl)GMSMapViewDelegate(im)didTapMyLocationButtonForMapView:)


  ` Called when the My Location button is tapped.

  #### Declaration

  Swift

      optional func didTapMyLocationButton(for mapView: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html) -> Bool

  Objective-C

      - (BOOL)didTapMyLocationButtonForMapView:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html *)mapView;

  #### Return Value

  YES if the listener has consumed the event (i.e., the default behavior should not occur),
  NO otherwise (i.e., the default behavior should occur). The default behavior is for the
  camera to move such that it is centered on the device location.
- `


  ### [-mapView:didTapMyLocation:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Protocols/GMSMapViewDelegate#/c:objc(pl)GMSMapViewDelegate(im)mapView:didTapMyLocation:)


  ` Called when the My Location Dot is tapped.

  #### Declaration

  Swift

      optional func mapView(_ mapView: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html, didTapMyLocation location: CLLocationCoordinate2D)

  Objective-C

      - (void)mapView:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html *)mapView
          didTapMyLocation:(CLLocationCoordinate2D)location;

  #### Parameters

  |---|---|
  | ` mapView ` | The map view that was tapped. |
  | ` location ` | The location of the device when the location dot was tapped. |

- `


  ### [-mapViewDidStartTileRendering:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Protocols/GMSMapViewDelegate#/c:objc(pl)GMSMapViewDelegate(im)mapViewDidStartTileRendering:)


  ` Called when tiles have just been requested or labels have just started rendering.

  #### Declaration

  Swift

      optional func mapViewDidStartTileRendering(_ mapView: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html)

  Objective-C

      - (void)mapViewDidStartTileRendering:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html *)mapView;

- `


  ### [-mapViewDidFinishTileRendering:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Protocols/GMSMapViewDelegate#/c:objc(pl)GMSMapViewDelegate(im)mapViewDidFinishTileRendering:)


  ` Called when all tiles have been loaded (or failed permanently) and labels have been rendered.

  #### Declaration

  Swift

      optional func mapViewDidFinishTileRendering(_ mapView: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html)

  Objective-C

      - (void)mapViewDidFinishTileRendering:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html *)mapView;

- `


  ### [-mapViewSnapshotReady:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Protocols/GMSMapViewDelegate#/c:objc(pl)GMSMapViewDelegate(im)mapViewSnapshotReady:)


  ` Called when map is stable (tiles loaded, labels rendered, camera idle) and overlay objects have
  been rendered.

  #### Declaration

  Swift

      optional func mapViewSnapshotReady(_ mapView: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html)

  Objective-C

      - (void)mapViewSnapshotReady:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html *)mapView;

- `


  ### [-mapView:didChangeMapCapabilities:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Protocols/GMSMapViewDelegate#/c:objc(pl)GMSMapViewDelegate(im)mapView:didChangeMapCapabilities:)


  ` Called every time map capabilities are changed.

  #### Declaration

  Swift

      optional func mapView(_ mapView: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html, didChangeMapCapabilities mapCapabilities: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Enums/GMSMapCapabilityFlags.html)

  Objective-C

      - (void)mapView:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html *)mapView
          didChangeMapCapabilities:(https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Enums/GMSMapCapabilityFlags.html)mapCapabilities;

  #### Parameters

  |---|---|
  | ` mapView ` | The map view where mapCapabilities was changed. |
  | ` mapCapabilities ` | Flags representing the capabilities on the map currently. |

- `


  ### [-mapView:didTapFeatures:inFeatureLayer:atLocation:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Protocols/GMSMapViewDelegate#/c:objc(pl)GMSMapViewDelegate(im)mapView:didTapFeatures:inFeatureLayer:atLocation:)


  ` Called after features in a data-driven styling feature layer have been tapped.

  All features overlapping with the point being tapped will be included. If the features belong to
  different feature layers, this method will be called multiple times (once for each individual
  feature layer).

  There is no guaranteed order between events on different feature layers, or between events on
  feature layers and other entities on the base map.

  #### Declaration

  Swift

      optional func mapView(_ mapView: https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html, didTap features: [any Feature], in featureLayer: FeatureLayer<any Feature>, atLocation location: CLLocationCoordinate2D)

  Objective-C

      - (void)mapView:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.html *)mapView
          didTapFeatures:(nonnull NSArray<id<https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Protocols/GMSFeature.html>> *)features
          inFeatureLayer:(nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSFeatureLayer.html *)featureLayer
              atLocation:(CLLocationCoordinate2D)location;

  #### Parameters

  |---|---|
  | ` mapView ` | The map view that was tapped. |
  | ` features ` | Array of all features being clicked in the layer. |
  | ` featureLayer ` | The feature layer containing the feautre. |
  | ` location ` | The location of the actual tapping point. |