在我的 iOS 应用程序中,我有 Google Maps SDK,我正在使用GMSPlacePicker在特定坐标周围选择一个地方,如下所示:
//center is a CLLocationCoordinate2D
CLLocationCoordinate2D northEast = CLLocationCoordinate2DMake(center.latitude + 0.001,center.longitude + 0.001);
CLLocationCoordinate2D southWest = CLLocationCoordinate2DMake(center.latitude - 0.001,center.longitude - 0.001);
GMSCoordinateBounds *viewport = [[GMSCoordinateBounds alloc] initWithCoordinate:northEast coordinate:southWest];
GMSPlacePickerConfig *config = [[GMSPlacePickerConfig alloc] initWithViewport:viewport];
_placePicker = [[GMSPlacePicker alloc] initWithConfig:config];
[_placePicker pickPlaceWithCallback:^(GMSPlace *place, NSError *error) {
if (error != nil) {
NSLog(@"Pick Place error %@", [error localizedDescription]);
}
else if (place) {
CLLocationCoordinate2D c = place.coordinate;
//place.coordinate doesn't exist
}
}];
然而,尽管谷歌声明这里没有 place.coordinate 属性,但有什么 想法为什么会丢失?