Last active
March 19, 2018 08:10
-
-
Save lloydsheng/b7ec1375e9b79fa4d8f49c4a45070a13 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 centerLocation = CLLocationCoordinate2D(latitude: 0, longitude: 66) | |
let styleURL = URL(string: "mapbox://styles/lloydsheng/cjdjzspzq5b4b2sobtqxeooll") | |
let camera = MGLMapCamera(lookingAtCenter: centerLocation, fromDistance: 100, pitch: 0, heading: 0) | |
let options = MGLMapSnapshotOptions(styleURL: styleURL, camera: camera, size: CGSize(width: 300, height: 300)) | |
let snapShooter = MGLMapSnapshotter(options: options) | |
snapShooter.start { (shooter, error) in | |
let image = shooter?.image; | |
print("\(image)") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment