Skip to content

Instantly share code, notes, and snippets.

@arvindhsukumar
Last active April 11, 2016 17:40
Show Gist options
  • Save arvindhsukumar/8d93ed92a1195d75347427526ceb87c4 to your computer and use it in GitHub Desktop.
Save arvindhsukumar/8d93ed92a1195d75347427526ceb87c4 to your computer and use it in GitHub Desktop.
let mapSnapshotOptions = MKMapSnapshotOptions()
// Set the region of the map that is rendered.
let location = CLLocationCoordinate2DMake(37.332077, -122.02962) // Apple HQ
let region = MKCoordinateRegionMakeWithDistance(location, 1000, 1000)
mapSnapshotOptions.region = region
// Set the scale of the image. We'll just use the scale of the current device, which is 2x scale on Retina screens.
mapSnapshotOptions.scale = UIScreen.mainScreen().scale
// Set the size of the image output.
mapSnapshotOptions.size = CGSizeMake(300, 300)
// Show buildings and Points of Interest on the snapshot
mapSnapshotOptions.showsBuildings = true
mapSnapshotOptions.showsPointsOfInterest = true
let snapShotter = MKMapSnapshotter(options: mapSnapshotOptions)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment