In release 1.2 of the Google Maps for iOS SDK the default behavior of a tapped marker changed.
The release note says: "The default behavior when a marker is tapped has been updated to also pan the camera to the marker's position"
How can I get the old behavior back, i.e. not panning the camera center to the position of the marker?
Add the following method to your GMSMapView delegate implementation. GMSMapView will no longer center on the selected marker and brings back the existing behavior.
- (BOOL) mapView:(GMSMapView *)mapView didTapMarker:(GMSMarker *)marker {
mapView.selectedMarker = marker;
return TRUE;
}
you can use this:
mapView.selectedMarker = nil
func mapView(_ mapView: GMSMapView, didTap marker: GMSMarker) -> Bool {
mapView.selectedMarker = nil
return true
}