diff --git a/maps-compose/src/main/java/com/google/maps/android/compose/streetview/StreetViewCameraPositionState.kt b/maps-compose/src/main/java/com/google/maps/android/compose/streetview/StreetViewCameraPositionState.kt index 2d5a4d40c..cf3607d2e 100644 --- a/maps-compose/src/main/java/com/google/maps/android/compose/streetview/StreetViewCameraPositionState.kt +++ b/maps-compose/src/main/java/com/google/maps/android/compose/streetview/StreetViewCameraPositionState.kt @@ -71,12 +71,10 @@ public class StreetViewCameraPositionState private constructor() { * @param source the source of the panoramas */ public fun setPosition(position: LatLng, radius: Int? = null, source: StreetViewSource? = null) { - if (radius == null && source == null) { - panorama?.setPosition(position) - } else if (radius != null && source == null) { - panorama?.setPosition(position, radius) - } else if (radius != null) { - panorama?.setPosition(position, radius, source) + when { + radius != null && source != null -> panorama?.setPosition(position, radius, source) + radius != null -> panorama?.setPosition(position, radius) + else -> panorama?.setPosition(position) } } @@ -96,4 +94,4 @@ public class StreetViewCameraPositionState private constructor() { public operator fun invoke(): StreetViewCameraPositionState = StreetViewCameraPositionState() } -} \ No newline at end of file +}