Skip to content

Commit 9b1ac99

Browse files
author
masashiGMS
committed
Issue #856: Add uncompress parameter. (iOS)
1 parent 55db4c4 commit 9b1ac99

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/ios/GoogleMaps/Map.m

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,18 @@ -(void)updateCameraPosition: (NSString*)action command:(CDVInvokedUrlCommand *)c
257257

258258

259259
- (void)toDataURL:(CDVInvokedUrlCommand *)command {
260-
UIGraphicsBeginImageContext(self.mapCtrl.view.frame.size);
260+
261+
NSDictionary *opts = [command.arguments objectAtIndex:1];
262+
BOOL uncompress = NO;
263+
if ([opts objectForKey:@"uncompress"]) {
264+
uncompress = [[opts objectForKey:@"uncompress"] boolValue];
265+
}
266+
267+
if (uncompress) {
268+
UIGraphicsBeginImageContextWithOptions(self.mapCtrl.view.frame.size, NO, 0.0f);
269+
} else {
270+
UIGraphicsBeginImageContext(self.mapCtrl.view.frame.size);
271+
}
261272
[self.mapCtrl.view drawViewHierarchyInRect:self.mapCtrl.map.layer.bounds afterScreenUpdates:NO];
262273
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
263274
UIGraphicsEndImageContext();

0 commit comments

Comments
 (0)