How put Google MapView in UIView?

后端 未结 2 383
鱼传尺愫
鱼传尺愫 2021-01-18 00:06

I\'m trying to put Google MapView in UIView but I get nothing displayed.

My code,

*.h

#import 
#import <         


        
2条回答
  •  有刺的猬
    2021-01-18 00:31

    Solution:

    GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.86
                                                                longitude:151.20
                                                                     zoom:6];
    
        // Indicating the map frame bounds
        self.mapView_ = [GMSMapView mapWithFrame:self.mapView.bounds camera: camera]; 
        self.mapView_.myLocationEnabled = YES;
    
        // Add as subview the mapview
        [self.mapView addSubview: self.mapView_]; 
    

提交回复
热议问题