Yuri Astrakhan
2025-02-08 22:33:24 -05:00
committed by GitHub
parent 14559245d8
commit a8f4f70636
297 changed files with 10306 additions and 10320 deletions

View File

@@ -93,7 +93,7 @@ private:
const mbgl::OfflineRegionDefinition &regionDefinition = _mbglOfflineRegion->getDefinition();
MLNAssert([MLNTilePyramidOfflineRegion conformsToProtocol:@protocol(MLNOfflineRegion_Private)], @"MLNTilePyramidOfflineRegion should conform to MLNOfflineRegion_Private.");
MLNAssert([MLNShapeOfflineRegion conformsToProtocol:@protocol(MLNOfflineRegion_Private)], @"MLNShapeOfflineRegion should conform to MLNOfflineRegion_Private.");
return std::visit(mbgl::overloaded{
[&] (const mbgl::OfflineTilePyramidRegionDefinition def){
return (id <MLNOfflineRegion>)[[MLNTilePyramidOfflineRegion alloc] initWithOfflineRegionDefinition:def];
@@ -113,10 +113,10 @@ private:
- (void)setContext:(NSData *)context completionHandler:(void (^_Nullable)(NSError * _Nullable error))completion {
MLNAssertOfflinePackIsValid();
mbgl::OfflineRegionMetadata metadata(context.length);
[context getBytes:&metadata[0] length:metadata.size()];
[self willChangeValueForKey:@"context"];
__weak MLNOfflinePack *weakSelf = self;
_mbglDatabaseFileSource->updateOfflineMetadata(_mbglOfflineRegion->getID(), metadata, [&, completion, weakSelf](mbgl::expected<mbgl::OfflineRegionMetadata, std::exception_ptr> mbglOfflineRegionMetadata) {
@@ -262,7 +262,7 @@ private:
- (void)didReceiveError:(NSError *)error {
MLNLogError(@"Error: %@", error.localizedDescription);
MLNLogInfo(@"Notifying about pack error.");
NSDictionary *userInfo = @{ MLNOfflinePackUserInfoKeyError: error };
NSNotificationCenter *noteCenter = [NSNotificationCenter defaultCenter];
[noteCenter postNotificationName:MLNOfflinePackErrorNotification