Skip to content

Commit

Permalink
fix: add zoom level assert to ios groundoverlays
Browse files Browse the repository at this point in the history
  • Loading branch information
illuminati1911 committed Jan 8, 2025
1 parent 9909a05 commit 6a8c0cf
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,13 @@ class GoogleMapsFlutterIOS extends GoogleMapsFlutterPlatform {
GroundOverlayUpdates groundOverlayUpdates, {
required int mapId,
}) {
assert(
groundOverlayUpdates.groundOverlaysToAdd.every(
(GroundOverlay groundOverlay) =>
groundOverlay.position == null ||
groundOverlay.zoomLevel != null),
'On ios zoom level must be set when position is set for ground overlays.');

return _hostApi(mapId).updateGroundOverlays(
groundOverlayUpdates.groundOverlaysToAdd
.map(_platformGroundOverlayFromGroundOverlay)
Expand Down Expand Up @@ -471,6 +478,11 @@ class GoogleMapsFlutterIOS extends GoogleMapsFlutterPlatform {
required MapWidgetConfiguration widgetConfiguration,
MapObjects mapObjects = const MapObjects(),
}) {
assert(
mapObjects.groundOverlays.every((GroundOverlay groundOverlay) =>
groundOverlay.position == null || groundOverlay.zoomLevel != null),
'On ios zoom level must be set when position is set for ground overlays.');

final PlatformMapViewCreationParams creationParams =
PlatformMapViewCreationParams(
initialCameraPosition: _platformCameraPositionFromCameraPosition(
Expand Down

0 comments on commit 6a8c0cf

Please sign in to comment.