Last active
April 11, 2016 17:40
-
-
Save arvindhsukumar/8d93ed92a1195d75347427526ceb87c4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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