Google Maps API: получение координат текущего местоположения iOS

В настоящее время я работаю с Google Maps API в моем проекте. Я пытаюсь установить камеру / масштаб по умолчанию для местоположения пользователей. Я сделаю это:

@implementation ViewController{

GMSMapView *mapView_;

}
@synthesize currentLatitude,currentLongitude;

- (void)viewDidLoad
{
[super viewDidLoad];
mapView_.settings.myLocationButton = YES;
mapView_.myLocationEnabled = YES;


}
- (void)loadView{

CLLocation *myLocation = mapView_.myLocation;

GMSMarker *marker = [[GMSMarker alloc] init];
marker.position = CLLocationCoordinate2DMake(myLocation.coordinate.latitude, myLocation.coordinate.longitude);
marker.title = @"Current Location";
marker.map = mapView_;
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:myLocation.coordinate.latitude
                                                        longitude:myLocation.coordinate.longitude
                                                             zoom:6];
mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera];

self.view = mapView_;
   NSLog(@"%f, %f", myLocation.coordinate.latitude, myLocation.coordinate.longitude);

}

Тем не менее, это не работает, так как, когда я делаю

NSLog(@"%f, %f", myLocation.coordinate.latitude, myLocation.coordinate.longitude);

возвращает 0, 0 и не дает координаты текущего местоположения. Как я могу правильно получить пользователя "координаты?

Ответы на вопрос(4)

Ваш ответ на вопрос