Last active
July 25, 2020 11:14
-
-
Save jeslyvarghese/662444ebbf4d23027f441c4e573014b7 to your computer and use it in GitHub Desktop.
This file contains 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 coordinates = CLLocationCoordinate2D(latitude: 37.3319, longitude: -122.0307812) | |
let snapShotOptions = MKMapSnapshotter.Options.init() | |
snapShotOptions.size = CGSize(width: 100, height: 100) | |
snapShotOptions.mapType = .satelliteFlyover | |
let span = MKCoordinateSpan(latitudeDelta: 0.05, longitudeDelta: 0.05) | |
snapShotOptions.region = MKCoordinateRegion(center: coordinates, span: span) | |
let snapShotter = MKMapSnapshotter(options: snapShotOptions) | |
snapShotter.start(with: .main) { (snapshot, error) in | |
self.mapImage = snapshot?.image | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment