MKLaunchOptionsCameraKey in openInMapsWithLaunchOptions:

197 views Asked by At

I am trying to open the Maps App in Flyover Mode via openInMapsWithLaunchOptions: If I remove the MKLaunchOptionsCameraKey, it works as expected (Pin dropped and map moved to location). With MKLaunchOptionsCameraKey it only opens the Maps app, but no pin is shown and the viewport is not moved to the desired location.

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}];
0

There are 0 answers