diff options
author | Julian Rex <julian.rex@mapbox.com> | 2018-07-10 10:09:02 -0400 |
---|---|---|
committer | Julian Rex <julian.rex@mapbox.com> | 2018-08-29 10:44:52 -0400 |
commit | ab6806850f8a010086f9dc8c07c61c83e6946c6d (patch) | |
tree | 0bab0934e8598efef166743eb613fdf7c489b14b | |
parent | f10c7e2a5bb0295f3f08216e69d3dd52083f7efd (diff) | |
download | qtlocation-mapboxgl-ab6806850f8a010086f9dc8c07c61c83e6946c6d.tar.gz |
Updated for macos
-rw-r--r-- | platform/darwin/src/MGLMapSnapshotter.mm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/platform/darwin/src/MGLMapSnapshotter.mm b/platform/darwin/src/MGLMapSnapshotter.mm index eff15dfcec..89e0b6c436 100644 --- a/platform/darwin/src/MGLMapSnapshotter.mm +++ b/platform/darwin/src/MGLMapSnapshotter.mm @@ -220,10 +220,10 @@ const CGFloat MGLSnapshotterMinimumPixelSize = 64; _mbglMapSnapshotter->snapshot(_snapshotCallback->self()); } -+ (UIImage*)drawAttributedSnapshotWorker:(mbgl::MapSnapshotter::Attributions)attributions snapshotImage:(MGLImage *)mglImage pointForFn:(mbgl::MapSnapshotter::PointForFn)pointForFn latLngForFn:(mbgl::MapSnapshotter::LatLngForFn)latLngForFn scale:(CGFloat)scale size:(CGSize)size { - ++ (MGLImage*)drawAttributedSnapshotWorker:(mbgl::MapSnapshotter::Attributions)attributions snapshotImage:(MGLImage *)mglImage pointForFn:(mbgl::MapSnapshotter::PointForFn)pointForFn latLngForFn:(mbgl::MapSnapshotter::LatLngForFn)latLngForFn scale:(CGFloat)scale size:(CGSize)size { + NSArray<MGLAttributionInfo *>* attributionInfo = [MGLMapSnapshotter generateAttributionInfos:attributions]; - + #if TARGET_OS_IPHONE MGLAttributionInfoStyle attributionInfoStyle = MGLAttributionInfoStyleLong; for (NSUInteger styleValue = MGLAttributionInfoStyleLong; styleValue >= MGLAttributionInfoStyleShort; styleValue--) { @@ -283,8 +283,9 @@ const CGFloat MGLSnapshotterMinimumPixelSize = 64; UIGraphicsEndImageContext(); return compositedImage; - + #else + NSSize targetSize = NSMakeSize(size.width, size.height); NSRect targetFrame = NSMakeRect(0, 0, targetSize.width, targetSize.height); @@ -345,7 +346,6 @@ const CGFloat MGLSnapshotterMinimumPixelSize = 64; [compositedImage unlockFocus]; return compositedImage; - #endif } @@ -364,7 +364,7 @@ const CGFloat MGLSnapshotterMinimumPixelSize = 64; dispatch_async(workQueue, ^{ // Call a class method to ensure we're not accidentally capturing self - UIImage *compositedImage = [MGLMapSnapshotter drawAttributedSnapshotWorker:attributions snapshotImage:mglImage pointForFn:pointForFn latLngForFn:latLngForFn scale:scale size:size]; + MGLImage *compositedImage = [MGLMapSnapshotter drawAttributedSnapshotWorker:attributions snapshotImage:mglImage pointForFn:pointForFn latLngForFn:latLngForFn scale:scale size:size]; // Dispatch result to origin queue dispatch_async(originQueue, ^{ |