0

我正在尝试通过 openInMapsWithLaunchOptions 在 Flyover 模式下打开 Maps 应用程序:如果我删除 MKLaunchOptionsCameraKey,它会按预期工作(Pin 掉了并且地图移动到了位置)。使用 MKLaunchOptionsCameraKey 时,它只会打开地图应用程序,但不会显示图钉,并且视口也不会移动到所需位置。

CLLocationCoordinate2D aCoord = ...;
MKPlacemark *placeMark = [[MKPlacemark alloc] initWithCoordinate:aCoord addressDictionary:nil];

MKMapItem *destination =  [[MKMapItem alloc] initWithPlacemark:placeMark];

MKMapCamera *newCamera = [MKMapCamera cameraLookingAtCenterCoordinate:aCoord
                                                            fromEyeCoordinate:aCoord
                                                                  eyeAltitude:30];

[destination openInMapsWithLaunchOptions:@{ MKLaunchOptionsMapTypeKey : @(MKMapTypeSatellite), MKLaunchOptionsCameraKey :  newCamera}];
4

0 回答 0