-
-
Notifications
You must be signed in to change notification settings - Fork 936
Closed
Description
Describe the bug
When i use MapboxGL.snapshotManager.takeSnap(options) i get this error:
Error: Could not create snapshot
The error comes from this function in MGLSnapshotModule.m
and there is no script for MGLMapSnapshotter in the repo.
RCT_EXPORT_METHOD(takeSnap:(NSDictionary *)jsOptions
resolver:(RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject)
{
dispatch_async(dispatch_get_main_queue(), ^{
MGLMapSnapshotOptions *options = [self _getOptions:jsOptions];
MGLMapSnapshotter *snapshotter = [[MGLMapSnapshotter alloc] initWithOptions:options];
[snapshotter startWithCompletionHandler:^(MGLMapSnapshot *snapshot, NSError *err) {
if (err != nil) {
reject(@"takeSnap", @"Could not create snapshot", err);
return;
}
NSString *result = nil;
if ([jsOptions[@"writeToDisk"] boolValue]) {
result = [RNMBImageUtils createTempFile:snapshot.image];
} else {
result = [RNMBImageUtils createBase64:snapshot.image];
}
resolve(result);
}];
});
}
To Reproduce
Just try to take a snapshot with snapshot manager.
Expected behavior
It should return an uri or a base64 file
Versions (please complete the following information):
- Platfrom: iOS
- React Native Version 0.59
- SDK: 7.0.0-rc3
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels