MKMapSnapshot Class Reference

Inherits from
Conforms to
Availability
Available in iOS 7.0 and later.
Declared in
MKMapSnapshot.h

Overview

An MKMapSnapshot object contains an image generated by a snapshotter object. You do not create instances of this class directly. Instead, you use an MKMapSnapshotter object capture the map contents asynchronously. Upon completion, the snapshotter object generates an image based on the options you provide and delivers that image inside an instance of this class.

Snapshot images do not include any custom overlays or annotations that your app added to the map view. If you want your annotations and overlays to appear on the final image, you must draw them yourself. To position those items correctly on the image, use the pointForCoordinate: method of this class to translate the overlay or annotation coordinate value to an appropriate location inside the image’s coordinate space.

Tasks

Getting the Snapshot Image

Getting Points on the Image

Properties

image

The image of the map’s content. (read-only)

@property (nonatomic, readonly) UIImage *image;
Availability
  • Available in iOS 7.0 and later.
Declared In
MKMapSnapshot.h

Instance Methods

pointForCoordinate:

Converts the specified map coordinate to a point in the coordinate space of the image.

- (CGPoint)pointForCoordinate:(CLLocationCoordinate2D)coordinate
Parameters
coordinate

A map coordinate that you want to convert.

Return Value

The point in the image’s coordinate space that corresponds to the map location.

Discussion

If you want to display additional views or content on top of the image, you can use this method to find an appropriate point at which to draw those items.

Availability
  • Available in iOS 7.0 and later.
Declared In
MKMapSnapshot.h