Search code examples
iosgoogle-maps-sdk-ios

Trigger when 'myLocation' button tapped (Google Maps SDK for iOS)


I want to do some stuff when 'myLocation' button tapped. So far, I've the UIButton itself:

UIButton *btnMyLoc = (UIButton*)[self.googleMapView subviews].lastObject;

But it's not enough. Any ideas?


Solution

  • In release 1.9.2 there is a delegate method that does exactly that:

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

    Link to documentation