Skip to content

Commit

Permalink
fix(ios-google): remove redundant if/else
Browse files Browse the repository at this point in the history
edgePadding is always passed from js to the native side.
  • Loading branch information
monholm committed May 10, 2023
1 parent 657e05f commit db5aadc
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions ios/GoogleMaps/RNMGoogleMapViewModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -261,17 +261,13 @@ - (dispatch_queue_t)methodQueue

GMSCameraUpdate* cameraUpdate;

if ([edgePadding count] != 0) {
// Set Map viewport
CGFloat top = [RCTConvert CGFloat:edgePadding[@"top"]];
CGFloat right = [RCTConvert CGFloat:edgePadding[@"right"]];
CGFloat bottom = [RCTConvert CGFloat:edgePadding[@"bottom"]];
CGFloat left = [RCTConvert CGFloat:edgePadding[@"left"]];
// Set Map viewport
CGFloat top = [RCTConvert CGFloat:edgePadding[@"top"]];
CGFloat right = [RCTConvert CGFloat:edgePadding[@"right"]];
CGFloat bottom = [RCTConvert CGFloat:edgePadding[@"bottom"]];
CGFloat left = [RCTConvert CGFloat:edgePadding[@"left"]];

cameraUpdate = [GMSCameraUpdate fitBounds:bounds withEdgeInsets:UIEdgeInsetsMake(top, left, bottom, right)];
} else {
cameraUpdate = [GMSCameraUpdate fitBounds:bounds withPadding:55.0f];
}
cameraUpdate = [GMSCameraUpdate fitBounds:bounds withEdgeInsets:UIEdgeInsetsMake(top, left, bottom, right)];
if (duration > 0.0f) {
[CATransaction begin];
[CATransaction setCompletionBlock:^{
Expand Down

0 comments on commit db5aadc

Please sign in to comment.