Я использую GoogleMap SDK в iOS для отображения текущего местоположения пользователя. Карта Google отображается на моем представлении, но маркер не отображается. Я не знаю, что я делаю неправильно здесь.маркер не отображается на карте google
Вот мой код
#import <GoogleMaps/GoogleMaps.h>
@interface firstViewController() {
// GMSMapView *mapView_;
IBOutlet GMSMapView *mapView_;
}
@end
@implementation firstViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Create a GMSCameraPosition that tells the map to display the
// coordinate -33.86,151.20 at zoom level 6.
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.86
longitude:151.20
zoom:6];
mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera];
mapView_.myLocationEnabled = NO;
[self.view addSubview: 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_;
}
чек здесь, если вам нужно Swift https://stackoverflow.com/questions/15417811/cannot-put-a-google-maps-gmsmapview-in-a-subview-of-main-main-view/ 48517389 # 48517389 –