I am using google maps ask for iOS app using swift. I have added map(GMSMapView) in story board and trying to compass button like this
mapView.settings.compassButton = true
But i am unable to see the compass button.
If the navigation bar is visible, the compass button is behind it. To make it appear below the navigation bar you need to add a padding to the top side of the map view.
Objective-C
UIEdgeInsets mapInsets = UIEdgeInsetsMake(80.0, 0.0, 0.0, 0.0);
GMSMapView *mapView;
mapView.padding = mapInsets;
Swift
let mapInsets = UIEdgeInsets(top: 80.0, left: 0.0, bottom: 0.0, right: 0.0)
mapView.padding = mapInsets
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With