diff options
Diffstat (limited to 'platform/darwin/src/MGLMapSnapshotter.h')
-rw-r--r-- | platform/darwin/src/MGLMapSnapshotter.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLMapSnapshotter.h b/platform/darwin/src/MGLMapSnapshotter.h index 1ee9bd99bb..79767a8110 100644 --- a/platform/darwin/src/MGLMapSnapshotter.h +++ b/platform/darwin/src/MGLMapSnapshotter.h @@ -5,6 +5,27 @@ NS_ASSUME_NONNULL_BEGIN +MGL_EXPORT + +/** + An overlay that is placed within a `MGLMapSnapshot`. + + To access this object, use `-[MGLMapSnapshotter startWithOverlayHandler:completionHandler:]`. + */ + +@interface MGLMapSnapshotOverlay : NSObject + +/** + The current `CGContext` that snapshot is drawing within. You may use this context + to perform additional custom drawing. + */ +@property CGContextRef context; + +@end + + +typedef void (^MGLMapSnapshotOverlayHandler)(MGLMapSnapshotOverlay * _Nullable snapshotOverlay); + /** The options to use when creating images with the `MGLMapSnapshotter`. */ @@ -200,6 +221,18 @@ MGL_EXPORT */ - (void)startWithQueue:(dispatch_queue_t)queue completionHandler:(MGLMapSnapshotCompletionHandler)completionHandler; + +/* + Starts the snapshot creation and executes the specified blocks with the result + on the specified queue. Use this option if you want to add custom drawing on top of the + resulting `MGLMapSnapShot`. + + @param queue The queue to handle the result on. + @param overlayHandler The block to handle manipulation of the `MGLMapSnapshotter`'s `CGContext`. + @param completionHandler The block to handle the result in. + */ +- (void)startWithOverlayHandler:(MGLMapSnapshotOverlayHandler)overlayHandler completionHandler:(MGLMapSnapshotCompletionHandler)completionHandler; + /** Cancels the snapshot creation request, if any. |