diff options
Diffstat (limited to 'platform/darwin/src/MGLMapSnapshotter.h')
-rw-r--r-- | platform/darwin/src/MGLMapSnapshotter.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLMapSnapshotter.h b/platform/darwin/src/MGLMapSnapshotter.h index 1ee9bd99bb..0f20cf1bb2 100644 --- a/platform/darwin/src/MGLMapSnapshotter.h +++ b/platform/darwin/src/MGLMapSnapshotter.h @@ -6,6 +6,30 @@ NS_ASSUME_NONNULL_BEGIN /** + An overlay that is placed within a `MGLMapSnapshot`. + To access this object, use `-[MGLMapSnapshotter startWithOverlayHandler:completionHandler:]`. + */ + +MGL_EXPORT +@interface MGLMapSnapshotOverlay : NSObject + +/** + The current `CGContext` that snapshot is drawing within. You may use this context + to perform additional custom drawing. + */ +@property (nonatomic, readonly) CGContextRef context; + +@end + +/** +A block provided during the snapshot drawing process, enabling the ability to +draw custom overlays rendered with Core Graphics. + + @param snapshotOverlay The `MGLMapSnapshotOverlay` provided during snapshot drawing. + */ +typedef void (^MGLMapSnapshotOverlayHandler)(MGLMapSnapshotOverlay * snapshotOverlay); + +/** The options to use when creating images with the `MGLMapSnapshotter`. */ MGL_EXPORT @@ -201,6 +225,16 @@ 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. Once you call this method, you cannot resume the snapshot. In order to obtain |