MKMapSnapshotOptions Class Reference

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

Overview

The MKMapSnapshotOptions class specifies the options to use when capturing map-based imagery. After creating and configuring an instance of this class, you pass that instance to an MKMapSnapshotter object. The snapshotter uses the options you specify to determine the portion of the map to capture, the viewing angle to use for the camera, and the map appearance.

Tasks

Configuring the Map Data

Configuring the Image Output

Properties

camera

The camera to use when taking the map snapshot.

@property (nonatomic, copy) MKMapCamera *camera
Discussion

Specify a camera object if you want to change the pitch, altitude, or heading information applied to the map.

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

mapRect

The map rect that you want to capture.

@property (nonatomic, assign) MKMapRect rect
Discussion

Use this property to specify the map using map view points. If you assign a value for this property, the value in the region property is updated to match the corresponding map rect as closely as possible.

The default value of this property is set to a map rect that encompasses the user’s country, as determined by the current locale information.

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

mapType

The map’s visual style.

@property (nonatomic, assign) MKMapType mapType;
Discussion

The default value of this property is MKMapTypeStandard.

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

region

The map region that you want to capture.

@property (nonatomic, assign) MKCoordinateRegion region;
Discussion

Use this property to specify the map using geographical coordinates. If you assign a value for this property, the value in the mapRect property is updated to match the corresponding region as closely as possible.

The default value of this property is set to a region that encompasses the user’s country, as determined by the current locale information.

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

scale

The scale factor to use when creating the image.

@property (nonatomic, assign) CGFloat scale;
Discussion

The value of this property is either 1.0 or 2.0, depending on whether the device has a standard or Retina display. Set the value to 1.0 if you want to display the resulting image on a standard resolution display. Set the value to 2.0 if you want to display the image on a Retina display or want to use the image for printing.

This property is set to a default value that corresponds to the resolution of the current device’s display. You can change the value as needed to generate an image suitable for display on a different device.

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

showsBuildings

A Boolean indicating whether the map displays extruded building information.

@property (nonatomic) BOOL showsBuildings;
Discussion

When this property is set to YES and the camera has a pitch angle greater than 0, the map extrudes buildings so that they appear to extend above the map plane, creating a 3D effect. The mapType property must be set to MKMapTypeStandard for extruded buildings to be displayed. The default value of this property is YES.

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

showsPointsOfInterest

A Boolean indicating whether the map displays point-of-interest information.

@property (nonatomic) BOOL showsPointsOfInterest;
Discussion

When this property is set to YES, the map displays icons and labels for restaurants, schools, and other relevant points of interest. The default value of this property is YES.

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

size

The size of the image that you want to create.

@property (nonatomic, assign) CGSize size;
Discussion

The default value of this property is 256 by 256 points.

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