How to add a button on the Google maps in iOS?

后端 未结 5 2142
北海茫月
北海茫月 2021-02-05 16:44

I am new to iOS Programming and I have downloaded the google maps sdk for iOS and followed the instruction on their website ( as shown in this link https://developers.google.com

5条回答
  •  半阙折子戏
    2021-02-05 17:15

    Make your view normally with InterfaceBuilder and to put mapView at 0 index subview :

    mapView_ = [GMSMapView mapWithFrame:self.view.bounds camera:camera];
    mapView_.myLocationEnabled = YES;
    [self.view insertSubview:mapView_ atIndex:0];
    

    Thanks to Raul Clauss from this thread

    And you can custom the size of mapView, change :

    mapView_ = [GMSMapView mapWithFrame:_mapHolder.bounds camera:camera];
    mapView_.myLocationEnabled = YES;
    [_mapHolder insertSubview:mapView_ atIndex:0];
    

    Where mapHolder, is a UIView made inside the IB.

提交回复
热议问题