How to change location of my location button in google maps using swift

Bhanuteja picture Bhanuteja · Jun 27, 2017 · Viewed 18.3k times · Source

my location button

I am using google maps in my project i want to show my location button a bit up how should i do that using swift

Answer

Subramanian P picture Subramanian P · Jun 27, 2017

You can change the position of the MapControls by set the padding for your map view .

 let mapView = GMSMapView()

 mapView.isMyLocationEnabled = true
 mapView.settings.myLocationButton = true

 mapView.padding = UIEdgeInsets(top: 0, left: 0, bottom: 50, right: 50)

It will change the padding of the my location control. From bottom 50px and from right 50px

Refer the below screenshot which added the padding of 50px from bottom and right.

enter image description here