diff --git a/platform/macos/app/AppDelegate.m b/platform/macos/app/AppDelegate.m index d3fe2d204..44f87092c 100644 --- a/platform/macos/app/AppDelegate.m +++ b/platform/macos/app/AppDelegate.m @@ -261,6 +261,14 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask"; [self.preferencesWindow makeKeyAndOrderFront:sender]; } +- (IBAction)print:(id)sender { + NSDocument *currentDocument = [NSDocumentController sharedDocumentController].currentDocument; + if ([currentDocument isKindOfClass:[MapDocument class]]) { + MGLMapView *mapView = [(MapDocument *)currentDocument mapView]; + [mapView print:sender]; + } +} + - (IBAction)openAccessTokenManager:(id)sender { [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://www.mapbox.com/studio/account/tokens/"]]; } @@ -277,6 +285,9 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask"; if (menuItem.action == @selector(showOfflinePacksPanel:)) { return YES; } + if (menuItem.action == @selector(print:)) { + return YES; + } if (menuItem.action == @selector(delete:)) { return self.offlinePacksArrayController.selectedObjects.count; } diff --git a/platform/macos/app/Base.lproj/MainMenu.xib b/platform/macos/app/Base.lproj/MainMenu.xib index 9faf1ba04..b6d2a5030 100644 --- a/platform/macos/app/Base.lproj/MainMenu.xib +++ b/platform/macos/app/Base.lproj/MainMenu.xib @@ -135,7 +135,7 @@ - +