我在 iOS 中使用 GoogleMap SDK 来显示用户的当前位置。谷歌地图显示在我的视野中,但标记不可见。我不知道我在这里做错了什么。
这是我的代码
#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_;
}