Google 在 IOS 中的子视图上加载地图

Google map load on subviews in IOS

我在 IOS 中实现了 google 地图。但问题是我无法在我的自定义视图(子视图)上实现 google 地图。 提前致谢。

创建子视图并定义子视图 class under GMSMapView

- (void)LoadMap {

GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.86
                                                        longitude:151.20
                                                             zoom:6];
mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera];
mapView_.myLocationEnabled = YES;
self.view = mapView_;

// Creates a marker in the center of the map.
GMSMarker *marker = [[GMSMarker alloc] init];
marker.position = CLLocationCoordinate2DMake(-33.86, 151.20);
marker.title = @"Sydney";
marker.snippet = @"Australia";
marker.map = mapView_;

// this line add subView
[self.view addSubview : mapView_ ];  }