Skip to content

Commit 8e5e3a6

Browse files
authored
feat: change GoogleMap() content parameter default to {} and make content non-nullable (#521)
Fixes #493 BREAKING CHANGE: Adds optional contentDescriptor parameter to MarkerComposable and AdvancedMarker. Makes content parameter of GoogleMap non-nullable, but with an empty default value.
1 parent 9886813 commit 8e5e3a6

File tree

1 file changed

+3
-4
lines changed
  • maps-compose/src/main/java/com/google/maps/android/compose

1 file changed

+3
-4
lines changed

maps-compose/src/main/java/com/google/maps/android/compose/GoogleMap.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public fun GoogleMap(
8989
onMyLocationClick: ((Location) -> Unit)? = null,
9090
onPOIClick: ((PointOfInterest) -> Unit)? = null,
9191
contentPadding: PaddingValues = NoPadding,
92-
content: (@Composable @GoogleMapComposable () -> Unit)? = null,
92+
content: @Composable @GoogleMapComposable () -> Unit = {},
9393
) {
9494
// When in preview, early return a Box with the received modifier preserving layout
9595
if (LocalInspectionMode.current) {
@@ -140,9 +140,8 @@ public fun GoogleMap(
140140

141141
CompositionLocalProvider(
142142
LocalCameraPositionState provides currentCameraPositionState,
143-
) {
144-
currentContent?.invoke()
145-
}
143+
currentContent
144+
)
146145
}
147146
}
148147
}

0 commit comments

Comments
 (0)