MKMapSnapshotter only creates a grey box

I've been using MKMapSnapshotter to capture image snapshots of maps. In iOS 13 I only get grey boxes. Is anybody else seeing this? Is this a bug or am I doing something wrong?


Here's what I do:

MKMapSnapshotOptions *snapshotterOptions = [MKMapSnapshotOptions new];
snapshotterOptions.region = MKCoordinateRegionMakeWithDistance(coordinate, 300, 300);
snapshotterOptions.mapType = MKMapTypeStandard;
snapshotterOptions.showsPointsOfInterest = NO;
snapshotterOptions.showsBuildings = NO;
snapshotterOptions.size = snapshotSize;
snapshotterOptions.scale = UIScreen.mainScreen.scale;

MKMapSnapshotter *snapshotter = [[MKMapSnapshotter alloc] initWithOptions:snapshotterOptions];
[snapshotter startWithCompletionHandler:^(MKMapSnapshot *snapshot, NSError *error) {
  // Some error checking here. The error is nil.
  [self saveMapImage:snapshot.image];
}];

Replies

I only see one black box. The same code that worked fine under iOS 12.

Seeing this as well in Xcode 11.0 from b1, through to b5 today - identical code to that which worked happily on iOS 12.* Simply seeing a black box, with the Apple Maps logo.


See example here.

https://imgur.com/TXtQx8U

Same here. In iOS 13 MKMapSnapshotter always produce a black image with just an Apple Maps logo.

I'm also seeing this on iOS 13 with Xcode b6. It still works correctly for me on iOS 12 with Xcode 10.3.

I'm also seeing this on iOS 13 with Xcode GM. It still works correctly for me on iOS 12

Have you tried on a physical device? I have this issue only with the simulator but on a real device everything works correctly for me.