How to put Google Map in a custom UIView

后端 未结 2 1952
无人及你
无人及你 2020-12-20 02:17

I know this question has already been asked before, but none of the answers were really clear to me and I can\'t find good tutorial on Internet... So, I want to put Google m

2条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-20 03:10

    First create outlet Of UIView

    #import 
    @interface ViewController : UIViewController
    @property (strong, nonatomic) IBOutlet GMSMapView *mapView;
    

    Add This in .h File

    Now add this in .m file in view didload method

    self.mapView.myLocationEnabled = YES;
    self.mapView.mapType = kGMSTypeNormal;
    self.mapView.settings.compassButton = YES;
    self.mapView.settings.myLocationButton = YES;
    self.mapView.delegate = self;
    

提交回复
热议问题