Skip to content

Commit 26ec483

Browse files
[google_maps_flutter] Add CameraUpdate.newLatLngBoundsWithEdgeInsets on iOS (#183439)
1 parent c7d680f commit 26ec483

44 files changed

Lines changed: 13667 additions & 12179 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/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.19.6
2+
3+
* Throws `UnsupportedError` for `CameraUpdate.newLatLngBoundsWithEdgeInsets` (not supported on Android).
4+
15
## 2.19.5
26

37
* Fixes a crash when using the legacy map renderer by adding the `org.apache.http.legacy` library.

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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: google_maps_flutter_android
22
description: Android implementation of the google_maps_flutter plugin.
33
repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_android
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22
5-
version: 2.19.5
5+
version: 2.19.6
66

77
environment:
88
sdk: ^3.9.0
@@ -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)