Skip to content

Commit 6ad06ae

Browse files
[google_maps_flutter] Add CameraUpdate.newLatLngBoundsWithEdgeInsets on iOS (#183439)
1 parent 8c3019e commit 6ad06ae

43 files changed

Lines changed: 13662 additions & 12178 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,11 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform {
10071007
dy: update.dy,
10081008
),
10091009
);
1010+
case CameraUpdateType.newLatLngBoundsWithEdgeInsets:
1011+
throw UnsupportedError(
1012+
'CameraUpdate.newLatLngBoundsWithEdgeInsets is not supported on Android. '
1013+
'Use CameraUpdate.newLatLngBounds with uniform padding instead.',
1014+
);
10101015
}
10111016
}
10121017

packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ dependencies:
2121
flutter:
2222
sdk: flutter
2323
flutter_plugin_android_lifecycle: ^2.0.1
24-
google_maps_flutter_platform_interface: ^2.13.0
24+
google_maps_flutter_platform_interface: ^2.16.0
2525
stream_transform: ^2.0.0
2626

2727
dev_dependencies:

packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.19.0
2+
3+
* Adds support for `CameraUpdate.newLatLngBoundsWithEdgeInsets` using native `GMSCameraUpdate.fitBounds(_:withEdgeInsets:)`.
4+
15
## 2.18.1
26

37
* Removes conditional header logic that broke add-to-app builds.

packages/google_maps_flutter/google_maps_flutter_ios/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/FGMConversionUtils.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,14 @@ GMSCollisionBehavior FGMGetCollisionBehaviorForPigeonCollisionBehavior(
241241
return
242242
[GMSCameraUpdate fitBounds:FGMGetCoordinateBoundsForPigeonLatLngBounds(typedUpdate.bounds)
243243
withPadding:typedUpdate.padding];
244+
} else if ([update isKindOfClass:[FGMPlatformCameraUpdateNewLatLngBoundsWithEdgeInsets class]]) {
245+
FGMPlatformCameraUpdateNewLatLngBoundsWithEdgeInsets *typedUpdate =
246+
(FGMPlatformCameraUpdateNewLatLngBoundsWithEdgeInsets *)update;
247+
FGMPlatformEdgeInsets *padding = typedUpdate.padding;
248+
return
249+
[GMSCameraUpdate fitBounds:FGMGetCoordinateBoundsForPigeonLatLngBounds(typedUpdate.bounds)
250+
withEdgeInsets:UIEdgeInsetsMake(padding.top, padding.left,
251+
padding.bottom, padding.right)];
244252
} else if ([update isKindOfClass:[FGMPlatformCameraUpdateNewLatLngZoom class]]) {
245253
FGMPlatformCameraUpdateNewLatLngZoom *typedUpdate =
246254
(FGMPlatformCameraUpdateNewLatLngZoom *)update;

0 commit comments

Comments
 (0)