iOS Developer Library

Developer

MKMapSnapshotOptions Class Reference

Options
Deployment Target:

On This Page
Language:

MKMapSnapshotOptions

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.

Inheritance


Conforms To


Import Statement


import MapKit @import MapKit;

Availability


Available in iOS 7.0 and later.
  • camera camera Property

    The camera to use when taking the map snapshot.

    Declaration

    Swift

    @NSCopying var camera: MKMapCamera!

    Objective-C

    @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.

    Import Statement

    import MapKit

    Availability

    Available in iOS 7.0 and later.

  • region region Property

    The map region that you want to capture.

    Declaration

    Swift

    var region: MKCoordinateRegion

    Objective-C

    @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.

    Import Statement

    import MapKit

    Availability

    Available in iOS 7.0 and later.

  • mapRect mapRect Property

    The map rect that you want to capture.

    Declaration

    Swift

    var mapRect: MKMapRect

    Objective-C

    @property(nonatomic, assign) MKMapRect mapRect

    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.

    Import Statement

    import MapKit

    Availability

    Available in iOS 7.0 and later.

  • mapType mapType Property

    The map’s visual style.

    Declaration

    Swift

    var mapType: MKMapType

    Objective-C

    @property(nonatomic, assign) MKMapType mapType

    Discussion

    The default value of this property is MKMapTypeStandard.

    Import Statement

    import MapKit

    Availability

    Available in iOS 7.0 and later.

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

    Declaration

    Swift

    var showsPointsOfInterest: Bool

    Objective-C

    @property(nonatomic) BOOL showsPointsOfInterest

    Discussion

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

    Import Statement

    import MapKit

    Availability

    Available in iOS 7.0 and later.

  • A Boolean indicating whether the map displays extruded building information.

    Declaration

    Swift

    var showsBuildings: Bool

    Objective-C

    @property(nonatomic) BOOL showsBuildings

    Discussion

    When this property is set to YEStrue 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 YEStrue.

    Import Statement

    import MapKit

    Availability

    Available in iOS 7.0 and later.

  • size size Property

    The size of the image that you want to create.

    Declaration

    Swift

    var size: CGSize

    Objective-C

    @property(nonatomic, assign) CGSize size

    Discussion

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

    Import Statement

    import MapKit

    Availability

    Available in iOS 7.0 and later.

  • scale scale Property

    The scale factor to use when creating the image.

    Declaration

    Swift

    var scale: CGFloat

    Objective-C

    @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.

    Import Statement

    import MapKit

    Availability

    Available in iOS 7.0 and later.