Google Maps SDK for iOS

<GMSMapViewDelegate> Protocol Reference

<GMSMapViewDelegate> Protocol Reference

Overview

Delegate for events on GMSMapView.

Public Member Functions

(void) - 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.
(void) - mapView:didChangeCameraPosition:
 Called repeatedly during any animations or gestures on the map (or once, if the camera is explicitly set).
(void) - mapView:idleAtCameraPosition:
 Called when the map becomes idle, after any outstanding gestures or animations have completed (or after the camera has been explicitly set).
(void) - mapView:didTapAtCoordinate:
 Called after a tap gesture at a particular coordinate, but only if a marker was not tapped.
(void) - mapView:didLongPressAtCoordinate:
 Called after a long-press gesture at a particular coordinate.
(BOOL) - mapView:didTapMarker:
 Called after a marker has been tapped.
(void) - mapView:didTapInfoWindowOfMarker:
 Called after a marker's info window has been tapped.
(void) - mapView:didTapOverlay:
 Called after an overlay has been tapped.
(UIView *) - 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.
(void) - mapView:didBeginDraggingMarker:
 Called when dragging has been initiated on a marker.
(void) - mapView:didEndDraggingMarker:
 Called after dragging of a marker ended.
(void) - mapView:didDragMarker:
 Called while a marker is dragged.
(BOOL) - didTapMyLocationButtonForMapView:
 Called when the My Location button is tapped.

Member Function Documentation

- (void) mapView: (GMSMapView *)  mapView
willMove: (BOOL)  gesture 
[optional]

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.

Parameters:
gestureIf YES, this is occuring due to a user gesture.
- (void) mapView: (GMSMapView *)  mapView
didChangeCameraPosition: (GMSCameraPosition *)  position 
[optional]

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.

- (void) mapView: (GMSMapView *)  mapView
idleAtCameraPosition: (GMSCameraPosition *)  position 
[optional]

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

- (void) mapView: (GMSMapView *)  mapView
didTapAtCoordinate: (CLLocationCoordinate2D)  coordinate 
[optional]

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

- (void) mapView: (GMSMapView *)  mapView
didLongPressAtCoordinate: (CLLocationCoordinate2D)  coordinate 
[optional]

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

Parameters:
mapViewThe map view that was pressed.
coordinateThe location that was pressed.
- (BOOL) mapView: (GMSMapView *)  mapView
didTapMarker: (GMSMarker *)  marker 
[optional]

Called after a marker has been tapped.

Parameters:
mapViewThe map view that was pressed.
markerThe marker that was pressed.
Returns:
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.
- (void) mapView: (GMSMapView *)  mapView
didTapInfoWindowOfMarker: (GMSMarker *)  marker 
[optional]

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

- (void) mapView: (GMSMapView *)  mapView
didTapOverlay: (GMSOverlay *)  overlay 
[optional]

Called after an overlay has been tapped.

This method is not called for taps on markers.

Parameters:
mapViewThe map view that was pressed.
overlayThe overlay that was pressed.
- (UIView *) mapView: (GMSMapView *)  mapView
markerInfoWindow: (GMSMarker *)  marker 
[optional]

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.

The returned UIView must not have bounds greater than 500 points on either dimension. 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.

Returns:
The custom info window for the specified marker, or nil for default
- (void) mapView: (GMSMapView *)  mapView
didBeginDraggingMarker: (GMSMarker *)  marker 
[optional]

Called when dragging has been initiated on a marker.

- (void) mapView: (GMSMapView *)  mapView
didEndDraggingMarker: (GMSMarker *)  marker 
[optional]

Called after dragging of a marker ended.

- (void) mapView: (GMSMapView *)  mapView
didDragMarker: (GMSMarker *)  marker 
[optional]

Called while a marker is dragged.

- (BOOL) didTapMyLocationButtonForMapView: (GMSMapView *)  mapView [optional]

Called when the My Location button is tapped.

Returns:
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 user location.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.