2

I have a MKMapView and I would like to take a screenshot of it and share it to a social network, for example to Facebook. I've found a nice way to make the screenshot, using MKMapSnapshotter (which is available starting with iOS 7), but my question is: Am I able to share a screenshot of MKMapView? Does Apple allow this?

I found this similar question, but there is not given any clear answer.

Community
  • 1
  • 1
iOS Dev
  • 4,143
  • 5
  • 30
  • 58
  • 2
    Contact Apple and get their written permission, or contact a lawyer. The case is not as clear as the two answers make it look. I would not use this material outside of an app. Press the the "Legal" link in a MKMapView and see yourself "[...] _This material is proprietary and the subject of copyright protection, database right protection and other intellectual property rights owned by TomTom or its suppliers. The use of this material is subject to the terms of a license agreement. Any unauthorized copying or disclosure of this material will lead to criminal and civil liabilities._". – Matthias Bauch Feb 05 '14 at 12:14
  • I'm voting to close this question as off-topic because it's not about programming. – trojanfoe Nov 27 '15 at 09:07

3 Answers3

2

Try Google Maps SDK for iOS: Documentation

And to make the screenshot use the following code:

CGRect rect = [captureView bounds];
UIGraphicsBeginImageContextWithOptions(rect.size,YES,0.0f);
CGContextRef context = UIGraphicsGetCurrentContext();
[captureView.layer renderInContext:context];   
UIImage *capturedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
1

Yes of course, why would apple object you?

You can surely share the image. As you mentioned you have the image you just need to use default sharing sheet. here's the code:

NSArray *activityItems = [NSArray arrayWithObjects:yourImage, nil];
UIActivityViewController *aActivityView = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil];
aActivityView.modalInPopover = UIModalTransitionStyleCoverVertical;
[self presentViewController:aActivityView animated:YES completion:^{

}];

This will present an UIActivityViewController's view which will have share option in it.

Hope this helps.

Kapil Choubisa
  • 5,152
  • 9
  • 65
  • 100
0

My gut feeling would be; why wouldn't Apple allow this?

If you have already managed to grab a UIImage representation of your MKMapView using the Apple provided MKMapSnapshotter, I would hazard a guess that Apple have given you the tools you need to do whatever you want with the image so there would be no restrictions as to what you do with it.

Zack Brown
  • 5,990
  • 2
  • 41
  • 54