diff options
author | Ivo van Dongen <info@ivovandongen.nl> | 2017-10-09 19:50:21 +0300 |
---|---|---|
committer | Fabian Guerra Soto <fabian.guerra@mapbox.com> | 2017-11-01 09:23:53 -0400 |
commit | de9098cf99463e433e9e9d6088865bc63948e567 (patch) | |
tree | 45669b918e2549e367742cb2e924f69277febf7a /platform/macos/app | |
parent | 9c3e78a9b95782e8fbf15cf7a4052f46f27922fd (diff) | |
download | qtlocation-mapboxgl-de9098cf99463e433e9e9d6088865bc63948e567.tar.gz |
[darwin][ios][macos] map snapshotter - add MGLMapSnapshot wrapper
Diffstat (limited to 'platform/macos/app')
-rw-r--r-- | platform/macos/app/MapDocument.m | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/platform/macos/app/MapDocument.m b/platform/macos/app/MapDocument.m index feef53062b..0df6b10518 100644 --- a/platform/macos/app/MapDocument.m +++ b/platform/macos/app/MapDocument.m @@ -167,7 +167,7 @@ NS_ARRAY_OF(id <MGLAnnotation>) *MBXFlattenedShapes(NS_ARRAY_OF(id <MGLAnnotatio // Create and start the snapshotter snapshotter = [[MGLMapSnapshotter alloc] initWithOptions:options]; - [snapshotter startWithCompletionHandler:^(NSImage *image, NSError *error) { + [snapshotter startWithCompletionHandler:^(MGLMapSnapshot *snapshot, NSError *error) { if (error) { NSLog(@"Could not load snapshot: %@", error.localizedDescription); } else { @@ -182,7 +182,7 @@ NS_ARRAY_OF(id <MGLAnnotation>) *MBXFlattenedShapes(NS_ARRAY_OF(id <MGLAnnotatio NSURL *fileURL = panel.URL; NSBitmapImageRep *bitmapRep; - for (NSImageRep *imageRep in image.representations) { + for (NSImageRep *imageRep in snapshot.image.representations) { if ([imageRep isKindOfClass:[NSBitmapImageRep class]]) { bitmapRep = (NSBitmapImageRep *)imageRep; break; // stop on first bitmap rep we find @@ -190,7 +190,7 @@ NS_ARRAY_OF(id <MGLAnnotation>) *MBXFlattenedShapes(NS_ARRAY_OF(id <MGLAnnotatio } if (!bitmapRep) { - bitmapRep = [NSBitmapImageRep imageRepWithData:image.TIFFRepresentation]; + bitmapRep = [NSBitmapImageRep imageRepWithData:snapshot.image.TIFFRepresentation]; } CFStringRef uti = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)fileURL.pathExtension, NULL /* inConformingToUTI */); |