diff options
author | Fabian Guerra <fabian.guerra@mapbox.com> | 2017-10-03 20:29:13 -0400 |
---|---|---|
committer | Fabian Guerra <fabian.guerra@mapbox.com> | 2017-10-03 20:29:13 -0400 |
commit | a072ecc0a9b60891feef003e5fd5b436fa83db87 (patch) | |
tree | 3b5db1d13c97430b0369d8fa64925ff55aa476a4 | |
parent | 21fe8117d63ea0f7503a3779287f1c42fcbb1e4e (diff) | |
download | qtlocation-mapboxgl-a072ecc0a9b60891feef003e5fd5b436fa83db87.tar.gz |
[ios, macos] Add snapshotter header example.
-rw-r--r-- | platform/darwin/src/MGLMapSnapshotter.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLMapSnapshotter.h b/platform/darwin/src/MGLMapSnapshotter.h index be4258e0ad..615d39bee4 100644 --- a/platform/darwin/src/MGLMapSnapshotter.h +++ b/platform/darwin/src/MGLMapSnapshotter.h @@ -89,6 +89,26 @@ typedef void (^MGLMapSnapshotCompletionHandler)(NSImage* _Nullable snapshot, NSE /** An immutable utility object for capturing map-based images. + + ### Example + + ```swift + var camera = MGLMapCamera() + camera.centerCoordinate = CLLocationCoordinate2D(latitude: 37.7184, longitude: -122.4365) + camera.pitch = 20 + + var options = MGLMapSnapshotOptions(styleURL: MGLStyle.satelliteStreetsStyleURL(), camera: camera, size: CGSize(width: 320, height: 480)) + options.zoomLevel = 10 + + var snapshotter = MGLMapSnapshotter(options: options) + snapshotter.start { (image, error) in + if error { + // error handler + } else { + // image handler + } + } + ``` */ MGL_EXPORT @interface MGLMapSnapshotter : NSObject |