Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GMSMapView compass button not visible

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.

like image 311
Afsara Avatar asked Jul 14 '15 13:07

Afsara


1 Answers

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
like image 157
yoninja Avatar answered Sep 29 '22 12:09

yoninja