summaryrefslogtreecommitdiff
path: root/platform/macos/app/MapDocument.m
diff options
context:
space:
mode:
authorIvo van Dongen <info@ivovandongen.nl>2017-10-09 19:50:21 +0300
committerIvo van Dongen <ivovandongen@users.noreply.github.com>2017-10-31 19:52:08 +0200
commit3cdb249c703b9e21a111afe060f78033f0933138 (patch)
tree67b3e0e7b7320340a53e8c491ee53ccd1d4e8539 /platform/macos/app/MapDocument.m
parentdde1a922919770fa009c90ff0525b69488e30bb1 (diff)
downloadqtlocation-mapboxgl-3cdb249c703b9e21a111afe060f78033f0933138.tar.gz
[darwin][ios][macos] map snapshotter - add MGLMapSnapshot wrapper
Diffstat (limited to 'platform/macos/app/MapDocument.m')
-rw-r--r--platform/macos/app/MapDocument.m6
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 */);