Search code examples
iosgoogle-maps-sdk-ios

How to change myLocationButton position from a GMSMapView?


Anybody know how to get the instance of the myLocationButton from a GMSMapView instance? Or a way to change the default position? I just need to move it some pixels up.


Solution

  • According the the issue tracker for this Issue 5864: Bug: GMSMapView Padding appears not to work with AutoLayout there is an easier workaround:

    - (void)viewDidAppear:(BOOL)animated {
      // This padding will be observed by the mapView
      _mapView.padding = UIEdgeInsetsMake(64, 0, 64, 0);
    }