summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLMapSnapshotter.mm
diff options
context:
space:
mode:
authorm-stephen <truestyle2005@163.com>2019-09-20 10:14:44 +0800
committerGitHub <noreply@github.com>2019-09-20 10:14:44 +0800
commit8128d709b62189e0745ea64be3d35e8c6dab59fa (patch)
tree0cc8d278b0a1f7ca626f5a0e67a4287d4da18ab5 /platform/darwin/src/MGLMapSnapshotter.mm
parentda6a7e9318e911ab03cacde781235b50326770ec (diff)
downloadqtlocation-mapboxgl-8128d709b62189e0745ea64be3d35e8c6dab59fa.tar.gz
[ios]Add errors reporting (#15391)
* add errors reporting * [ios] report error if rendering takes > 1 second. (#15633)
Diffstat (limited to 'platform/darwin/src/MGLMapSnapshotter.mm')
-rw-r--r--platform/darwin/src/MGLMapSnapshotter.mm8
1 files changed, 7 insertions, 1 deletions
diff --git a/platform/darwin/src/MGLMapSnapshotter.mm b/platform/darwin/src/MGLMapSnapshotter.mm
index 3a258d146a..85619a780b 100644
--- a/platform/darwin/src/MGLMapSnapshotter.mm
+++ b/platform/darwin/src/MGLMapSnapshotter.mm
@@ -252,12 +252,15 @@ const CGFloat MGLSnapshotterMinimumPixelSize = 64;
NSString *description = @(mbgl::util::toString(mbglError).c_str());
NSDictionary *userInfo = @{NSLocalizedDescriptionKey: description};
NSError *error = [NSError errorWithDomain:MGLErrorDomain code:MGLErrorCodeSnapshotFailed userInfo:userInfo];
-
+#if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR
+ [[MMEEventsManager sharedManager] reportError:error];
+#endif
// Dispatch to result queue
dispatch_async(queue, ^{
strongSelf.completion(nil, error);
strongSelf.completion = nil;
});
+
} else {
#if TARGET_OS_IPHONE
MGLImage *mglImage = [[MGLImage alloc] initWithMGLPremultipliedImage:std::move(image) scale:strongSelf.options.scale];
@@ -636,6 +639,9 @@ const CGFloat MGLSnapshotterMinimumPixelSize = 64;
NSError *error = [NSError errorWithDomain:MGLErrorDomain
code:errorCode
userInfo:userInfo];
+#if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR
+ [[MMEEventsManager sharedManager] reportError:error];
+#endif
completion(NULL, error);
});
}